feat:全基础流程跑通

This commit is contained in:
橙子
2023-04-15 22:44:33 +08:00
parent 9b1a978cb5
commit 1655870d4d
151 changed files with 3120 additions and 209 deletions

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.Argee
{
public class AgreeDto
{
public AgreeDto(bool isAgree)
{
IsAgree = isAgree;
if (isAgree)
{
Message = "点赞成功,点赞+1";
}
else
{
Message = "取消点赞,点赞-1";
}
}
public bool IsAgree { get; set; }
public string Message { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Article
{
public class ArticleAllOutputDto : IEntityDto<long>
{
public long Id { get; set; }
//批量查询,不给内容,性能考虑
//public string Content { get; set; }
public string Name { get; set; }
public long DiscussId { get; set; }
public long ParentId { get; set; }
public List<ArticleAllOutputDto> Children { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.Article
{
/// <summary>
/// Article输入创建对象
/// </summary>
public class ArticleCreateInputVo
{
public string Content { get; set; }
public string Name { get; set; }
public long DiscussId { get; set; }
public long ParentId { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using Yi.Framework.Infrastructure.Ddd.Dtos;
namespace Yi.Furion.Core.Bbs.Dtos.Article
{
public class ArticleGetListInputVo : PagedAndSortedResultRequestDto
{
public long Id { get; set; }
public string Content { get; set; }
public string Name { get; set; }
public long DiscussId { get; set; }
public long ParentId { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Article
{
public class ArticleGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
//批量查询,不给内容,性能考虑
//public string Content { get; set; }
public string Name { get; set; }
public long DiscussId { get; set; }
public List<ArticleGetListOutputDto> Children { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Article
{
public class ArticleGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Content { get; set; }
public string Name { get; set; }
public long DiscussId { get; set; }
public long ParentId { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace Yi.Furion.Core.Bbs.Dtos.Article
{
public class ArticleUpdateInputVo
{
public string Content { get; set; }
public string Name { get; set; }
public long DiscussId { get; set; }
public long ParentId { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.Banner
{
/// <summary>
/// Banner输入创建对象
/// </summary>
public class BannerCreateInputVo
{
public string Name { get; set; }
public string Logo { get; set; }
public string Color { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Infrastructure.Ddd.Dtos;
namespace Yi.Furion.Core.Bbs.Dtos.Banner
{
public class BannerGetListInputVo : PagedAndSortedResultRequestDto
{
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Banner
{
public class BannerGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Color { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Banner
{
public class BannerGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Color { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Yi.Furion.Core.Bbs.Dtos.Banner
{
public class BannerUpdateInputVo
{
public string Name { get; set; }
public string Logo { get; set; }
public string Color { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace Yi.Furion.Core.Bbs.Dtos.Comment
{
/// <summary>
/// Comment输入创建对象
/// </summary>
public class CommentCreateInputVo
{
/// <summary>
/// 评论id
/// </summary>
public string Content { get; set; }
/// <summary>
/// 主题id
/// </summary>
public long DiscussId { get; set; }
/// <summary>
/// 第一层评论id第一层为0
/// </summary>
public long RootId { get; set; }
/// <summary>
/// 被回复的CommentId第一层为0
/// </summary>
public long ParentId { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
namespace Yi.Furion.Core.Bbs.Dtos.Comment
{
public class CommentGetListInputVo
{
public DateTime? creationTime { get; set; }
public string Content { get; set; }
//应该选择具体莫个主题查询
public long? DiscussId { get; set; }
}
}

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
using Yi.Furion.Core.Rbac.Dtos.User;
namespace Yi.Furion.Core.Bbs.Dtos.Comment
{
/// <summary>
/// 评论多反
/// </summary>
public class CommentGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public DateTime? CreationTime { get; set; }
public string Content { get; set; }
/// <summary>
/// 主题id
/// </summary>
public long DiscussId { get; set; }
public long ParentId { get; set; }
public long RootId { get; set; }
/// <summary>
/// 用户,评论人用户信息
/// </summary>
public UserGetOutputDto CreateUser { get; set; }
/// <summary>
/// 被评论的用户信息
/// </summary>
public UserGetOutputDto CommentedUser { get; set; }
/// <summary>
/// 这个不是一个树形而是存在一个二维数组该Children只有在顶级时候只有一层
/// </summary>
public List<CommentGetListOutputDto> Children { get; set; } = new List<CommentGetListOutputDto>();
}
}

View File

@@ -0,0 +1,36 @@
using System;
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
using Yi.Furion.Core.Rbac.Dtos.User;
namespace Yi.Furion.Core.Bbs.Dtos.Comment
{
/// <summary>
/// 单返回,返回单条评论即可
/// </summary>
public class CommentGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public DateTime? CreateTime { get; set; }
public string Content { get; set; }
public long DiscussId { get; set; }
/// <summary>
/// 用户id联表为用户对象
/// </summary>
public UserGetOutputDto User { get; set; }
/// <summary>
/// 根节点的评论id
/// </summary>
public long RootId { get; set; }
/// <summary>
/// 被回复的CommentId
/// </summary>
public long ParentId { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace Yi.Furion.Core.Bbs.Dtos.Comment
{
public class CommentUpdateInputVo
{
public string Content { get; set; }
//更新不能将评论转移
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
//默认查询非置顶
public bool IsTop { get; set; } = false;
//查询方式
public QueryDiscussTypeEnum Type { get; set; } = QueryDiscussTypeEnum.New;
}
}

View File

@@ -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>
/// 是否已点赞
/// </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; }
//批量查询,不给内容,性能考虑
//public string Content { get; set; }
public string Color { get; set; }
public long 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<long> PermissionUserIds { get; set; }
public UserGetListOutputDto User { get; set; }
public void SetBan()
{
Title = DiscussConst.;
Introduction = "";
Cover = null;
//被禁止
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:
//当前主题是仅自己可见,同时不是当前登录用户
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,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; }
//是否置顶默认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<long> PermissionUserIds { get; set; }
public UserGetListOutputDto User { get; set; }
}
}

View File

@@ -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>
/// ·âÃæ
/// </summary>
public string Cover { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.MyType
{
/// <summary>
/// Label输入创建对象
/// </summary>
public class MyTypeCreateInputVo
{
public string Name { get; set; }
public string Color { get; set; }
public string BackgroundColor { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Infrastructure.Ddd.Dtos;
namespace Yi.Furion.Core.Bbs.Dtos.MyType
{
public class MyTypeGetListInputVo : PagedAndSortedResultRequestDto
{
public long Id { get; set; }
public string Name { get; set; }
public string Color { get; set; }
public string BackgroundColor { get; set; }
public long UserId { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.MyType
{
public class MyTypeGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public string Color { get; set; }
public string BackgroundColor { get; set; }
public long UserId { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.MyType
{
public class MyTypeOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public string Color { get; set; }
public string BackgroundColor { get; set; }
public long UserId { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.MyType
{
public class MyTypeUpdateInputVo
{
public long Id { get; set; }
public string Name { get; set; }
public string Color { get; set; }
public string BackgroundColor { get; set; }
public long UserId { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.Plate
{
/// <summary>
/// Plate输入创建对象
/// </summary>
public class PlateCreateInputVo
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Introduction { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using Yi.Framework.Infrastructure.Ddd.Dtos;
namespace Yi.Furion.Core.Bbs.Dtos.Plate
{
public class PlateGetListInputVo : PagedAndSortedResultRequestDto
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Introduction { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Plate
{
public class PlateGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Introduction { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.Bbs.Dtos.Plate
{
public class PlateGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Introduction { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Furion.Core.Bbs.Dtos.Plate
{
public class PlateUpdateInputVo
{
public long Id { get; set; }
public string Name { get; set; }
public string Logo { get; set; }
public string Introduction { get; set; }
}
}