chore: 构建稳定版本

This commit is contained in:
陈淳
2023-12-11 09:55:12 +08:00
parent 098d4bc85f
commit 769a6a9c63
756 changed files with 10431 additions and 19867 deletions

View File

@@ -0,0 +1,28 @@
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.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 Guid PlateId { get; set; }
/// <summary>
/// 默认公开
/// </summary>
public DiscussPermissionTypeEnum PermissionType { get; set; } = DiscussPermissionTypeEnum.Public;
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussGetListInputVo : PagedAndSortedResultRequestDto
{
public string Title { get; set; }
public Guid? PlateId { get; set; }
//默认查询非置顶
public bool IsTop { get; set; } = false;
//查询方式
public QueryDiscussTypeEnum Type { get; set; } = QueryDiscussTypeEnum.New;
}
}

View File

@@ -0,0 +1,92 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussGetListOutputDto : EntityDto<Guid>
{
/// <summary>
/// 是否已点赞
/// </summary>
public bool IsAgree { 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 Guid PlateId { get; set; }
//是否置顶默认false
public bool IsTop { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
//是否禁止默认false
public bool IsBan { get; set; }
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
//私有需要判断code权限
public string? PrivateCode { get; set; }
public DateTime CreationTime { get; set; }
public List<Guid>? PermissionUserIds { get; set; }
public UserGetListOutputDto User { get; set; }
public void SetBan()
{
Title = DiscussConst.Privacy;
Introduction = "";
Cover = null;
//被禁止
IsBan = true;
}
}
public static class DiscussGetListOutputDtoExtension
{
public static void ApplyPermissionTypeFilter(this List<DiscussGetListOutputDto> dtos, Guid userId)
{
dtos?.ForEach(dto =>
{
switch (dto.PermissionType)
{
case DiscussPermissionTypeEnum.Public:
break;
case DiscussPermissionTypeEnum.Oneself:
//当前主题是仅自己可见,同时不是当前登录用户
if (dto.User.Id != userId)
{
dto.SetBan();
}
break;
case DiscussPermissionTypeEnum.User:
//当前主题为部分可见,同时不是当前登录用户 也 不在可见用户列表中
if (dto.User.Id != userId && !dto.PermissionUserIds.Contains(userId))
{
dto.SetBan();
}
break;
default:
break;
}
});
}
}
}

View File

@@ -0,0 +1,36 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussGetOutputDto : EntityDto<Guid>
{
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 Guid PlateId { get; set; }
//是否置顶默认false
public bool IsTop { get; set; }
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
//是否私有默认false
public bool IsPrivate { get; set; }
//私有需要判断code权限
public string? PrivateCode { get; set; }
public DateTime CreationTime { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
public List<Guid>? PermissionUserIds { get; set; }
public UserGetListOutputDto User { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.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<Guid> PermissionUserIds { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
/// <summary>
/// ·âÃæ
/// </summary>
public string? Cover { get; set; }
}
}