mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-02 23:26:36 +08:00
feat;添加评论
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
{
|
||||
@@ -11,7 +12,19 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
/// </summary>
|
||||
public class CommentCreateInputVo
|
||||
{
|
||||
|
||||
public string Content { get; set; }
|
||||
|
||||
public long DiscussId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 根节点的评论id,这里也可根据树形查询获取到根节点,但是不够优雅,前端是二维数组,选择前端传值即可,如果是根,传0,如果不是
|
||||
/// </summary>
|
||||
public long RootId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 被回复的CommentId
|
||||
/// </summary>
|
||||
public long ParentId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,17 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
{
|
||||
public class CommentGetListInputVo : PagedAndSortedResultRequestDto
|
||||
public class CommentGetListInputVo
|
||||
{
|
||||
public DateTime? CreateTime { get; set; }
|
||||
public string? Content { get; set; }
|
||||
|
||||
//应该选择具体莫个主题查询
|
||||
public long? DiscussId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,45 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
|
||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// 评论多反
|
||||
/// </summary>
|
||||
public class CommentGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public DateTime? CreateTime { get; set; }
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 根节点的评论id
|
||||
/// </summary>
|
||||
public long RootId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主题id
|
||||
/// </summary>
|
||||
public long DiscussId { get; set; }
|
||||
public long UserId { get; set; }
|
||||
|
||||
public long ParentId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户,评论人用户信息,被评论的用户信息,是他的上一个节点评论
|
||||
/// </summary>
|
||||
public UserGetOutputDto User { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 这个不是一个树形,而是存在一个二维数组,该Children只有一层
|
||||
/// </summary>
|
||||
public List<CommentGetListOutputDto> Children { get; set; } = new List<CommentGetListOutputDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,39 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
|
||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
{
|
||||
/// <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; }
|
||||
public long UserId { 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; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,15 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
{
|
||||
public class CommentUpdateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
public string Content { get; set; }
|
||||
public long DiscussId { get; set; }
|
||||
public long UserId { get; set; }
|
||||
|
||||
//更新不能将评论转移
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user