添加评论功能
This commit is contained in:
24
Yi.Framework.Net6/Yi.Framework.Model/CommentEntity.cs
Normal file
24
Yi.Framework.Net6/Yi.Framework.Model/CommentEntity.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public partial class CommentEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 被回复的用户信息
|
||||
///</summary>
|
||||
[Navigate(NavigateType.OneToOne,nameof(UserId),nameof(UserEntity.Id))]
|
||||
public UserEntity? UserInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建评论的用户信息
|
||||
///</summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(CreateUser), nameof(UserEntity.Id))]
|
||||
public UserEntity? CreateUserInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,9 @@ namespace Yi.Framework.Model.Models
|
||||
public CommentEntity()
|
||||
{
|
||||
this.CreateTime = DateTime.Now;
|
||||
this.AgreeNum= 0;
|
||||
this.CommentNum = 0;
|
||||
this.ParentId= 0;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
|
||||
@@ -32,7 +35,7 @@ namespace Yi.Framework.Model.Models
|
||||
/// 评论内容
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Content" )]
|
||||
public string Content { get; set; }
|
||||
public string? Content { get; set; }
|
||||
/// <summary>
|
||||
/// 点赞数
|
||||
///</summary>
|
||||
@@ -77,7 +80,7 @@ namespace Yi.Framework.Model.Models
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 子评论数
|
||||
///</summary>
|
||||
|
||||
Reference in New Issue
Block a user