feat:全基础流程跑通
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Furion.Core.Bbs.Enums;
|
||||
|
||||
namespace Yi.Furion.Core.Bbs.Dtos.Discuss
|
||||
{
|
||||
/// <summary>
|
||||
/// Discuss输入创建对象
|
||||
/// </summary>
|
||||
public class DiscussCreateInputVo
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Types { get; set; }
|
||||
public string Introduction { get; set; }
|
||||
public DateTime? CreateTime { get; set; } = DateTime.Now;
|
||||
public string Content { get; set; }
|
||||
public string Color { get; set; }
|
||||
|
||||
public long PlateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认公开
|
||||
/// </summary>
|
||||
public DiscussPermissionTypeEnum PermissionType { get; set; } = DiscussPermissionTypeEnum.Public;
|
||||
/// <summary>
|
||||
/// 封面
|
||||
/// </summary>
|
||||
public string Cover { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Yi.Framework.Infrastructure.Ddd.Dtos;
|
||||
using Yi.Furion.Core.Bbs.Enums;
|
||||
|
||||
namespace Yi.Furion.Core.Bbs.Dtos.Discuss
|
||||
{
|
||||
public class DiscussGetListInputVo : PagedAndSortedResultRequestDto
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public long? PlateId { get; set; }
|
||||
|
||||
//Ĭ<>ϲ<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD>ö<EFBFBD>
|
||||
public bool IsTop { get; set; } = false;
|
||||
|
||||
|
||||
//<2F><>ѯ<EFBFBD><D1AF>ʽ
|
||||
public QueryDiscussTypeEnum Type { get; set; } = QueryDiscussTypeEnum.New;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
|
||||
using Yi.Furion.Core.Bbs.Consts;
|
||||
using Yi.Furion.Core.Bbs.Enums;
|
||||
using Yi.Furion.Core.Rbac.Dtos.User;
|
||||
|
||||
namespace Yi.Furion.Core.Bbs.Dtos.Discuss
|
||||
{
|
||||
public class DiscussGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// <20>Ƿ<EFBFBD><C7B7>ѵ<EFBFBD><D1B5><EFBFBD>
|
||||
/// </summary>
|
||||
public bool IsAgree { get; set; }
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Types { get; set; }
|
||||
public string Introduction { get; set; }
|
||||
|
||||
public int AgreeNum { get; set; }
|
||||
public int SeeNum { get; set; }
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD>
|
||||
//public string Content { get; set; }
|
||||
public string Color { get; set; }
|
||||
|
||||
public long PlateId { get; set; }
|
||||
|
||||
//<2F>Ƿ<EFBFBD><C7B7>ö<EFBFBD><C3B6><EFBFBD>Ĭ<EFBFBD><C4AC>false
|
||||
public bool IsTop { get; set; }
|
||||
|
||||
public DiscussPermissionTypeEnum PermissionType { get; set; }
|
||||
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ֹ<EFBFBD><D6B9>Ĭ<EFBFBD><C4AC>false
|
||||
public bool IsBan { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string Cover { get; set; }
|
||||
|
||||
//˽<><CBBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ж<EFBFBD>codeȨ<65><C8A8>
|
||||
public string PrivateCode { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
public List<long> PermissionUserIds { get; set; }
|
||||
|
||||
public UserGetListOutputDto User { get; set; }
|
||||
|
||||
public void SetBan()
|
||||
{
|
||||
Title = DiscussConst.˽<EFBFBD><EFBFBD>;
|
||||
Introduction = "";
|
||||
Cover = null;
|
||||
//<2F><><EFBFBD><EFBFBD>ֹ
|
||||
IsBan = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class DiscussGetListOutputDtoExtension
|
||||
{
|
||||
|
||||
public static void ApplyPermissionTypeFilter(this List<DiscussGetListOutputDto> dtos, long userId)
|
||||
{
|
||||
dtos?.ForEach(dto =>
|
||||
{
|
||||
switch (dto.PermissionType)
|
||||
{
|
||||
case DiscussPermissionTypeEnum.Public:
|
||||
break;
|
||||
case DiscussPermissionTypeEnum.Oneself:
|
||||
//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD>Լ<EFBFBD><D4BC>ɼ<EFBFBD><C9BC><EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD>ǵ<EFBFBD>ǰ<EFBFBD><C7B0>¼<EFBFBD>û<EFBFBD>
|
||||
if (dto.User.Id != userId)
|
||||
{
|
||||
dto.SetBan();
|
||||
}
|
||||
break;
|
||||
case DiscussPermissionTypeEnum.User:
|
||||
//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ֿɼ<D6BF><C9BC><EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD>ǵ<EFBFBD>ǰ<EFBFBD><C7B0>¼<EFBFBD>û<EFBFBD> Ҳ <20><><EFBFBD>ڿɼ<DABF><C9BC>û<EFBFBD><C3BB>б<EFBFBD><D0B1><EFBFBD>
|
||||
if (dto.User.Id != userId && !dto.PermissionUserIds.Contains(userId))
|
||||
{
|
||||
dto.SetBan();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
|
||||
using Yi.Furion.Core.Bbs.Enums;
|
||||
using Yi.Furion.Core.Rbac.Dtos.User;
|
||||
|
||||
namespace Yi.Furion.Core.Bbs.Dtos.Discuss
|
||||
{
|
||||
public class DiscussGetOutputDto : IEntityDto<long>
|
||||
{
|
||||
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Types { get; set; }
|
||||
public string Introduction { get; set; }
|
||||
public int AgreeNum { get; set; }
|
||||
public int SeeNum { get; set; }
|
||||
public string Content { get; set; }
|
||||
public string Color { get; set; }
|
||||
|
||||
public long PlateId { get; set; }
|
||||
//<2F>Ƿ<EFBFBD><C7B7>ö<EFBFBD><C3B6><EFBFBD>Ĭ<EFBFBD><C4AC>false
|
||||
public bool IsTop { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string Cover { get; set; }
|
||||
//<2F>Ƿ<EFBFBD>˽<EFBFBD>У<EFBFBD>Ĭ<EFBFBD><C4AC>false
|
||||
public bool IsPrivate { get; set; }
|
||||
|
||||
//˽<><CBBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ж<EFBFBD>codeȨ<65><C8A8>
|
||||
public string PrivateCode { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
public DiscussPermissionTypeEnum PermissionType { get; set; }
|
||||
|
||||
public List<long> PermissionUserIds { get; set; }
|
||||
public UserGetListOutputDto User { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Yi.Furion.Core.Bbs.Enums;
|
||||
|
||||
namespace Yi.Furion.Core.Bbs.Dtos.Discuss
|
||||
{
|
||||
public class DiscussUpdateInputVo
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Types { get; set; }
|
||||
public string Introduction { get; set; }
|
||||
public int AgreeNum { get; set; }
|
||||
public int SeeNum { get; set; }
|
||||
public string Content { get; set; }
|
||||
public string Color { get; set; }
|
||||
|
||||
public List<long> PermissionUserIds { get; set; }
|
||||
|
||||
public DiscussPermissionTypeEnum PermissionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string Cover { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user