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,16 @@
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("AccessLog")]
public class AccessLogEntity : Entity<Guid>, IHasModificationTime, IHasCreationTime
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public long Number { get; set; }
public DateTime? LastModificationTime { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Agree")]
public class AgreeEntity : Entity<Guid>, ICreationAuditedObject
{
public AgreeEntity()
{
}
public AgreeEntity(Guid discussId)
{
DiscussId = discussId;
}
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public DateTime CreationTime { get; set; }
/// <summary>
/// 主题id
/// </summary>
public Guid DiscussId { get; set; }
/// <summary>
/// 创建者
/// </summary>
public Guid? CreatorId { get; set; }
}
}

View File

@@ -0,0 +1,56 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Article")]
public class ArticleEntity : Entity<Guid>, ISoftDelete
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public bool IsDeleted { get; set; }
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Content { get; set; }
public string Name { get; set; }
public Guid DiscussId { get; set; }
public Guid ParentId { get; set; }
[SugarColumn(IsIgnore = true)]
public List<ArticleEntity>? Children { get; set; }
}
public static class ArticleEntityExtensions
{
/// <summary>
/// 平铺自己
/// </summary>
/// <param name="entities"></param>
/// <returns></returns>
public static List<ArticleEntity> Tile(this List<ArticleEntity> entities)
{
if (entities is null) return new List<ArticleEntity>();
var result = new List<ArticleEntity>();
return StartRecursion(entities, result);
}
private static List<ArticleEntity> StartRecursion(List<ArticleEntity> entities, List<ArticleEntity> result)
{
foreach (var entity in entities)
{
result.Add(entity);
if (entity.Children is not null && entity.Children.Where(x => x.IsDeleted == false).Count() > 0)
{
StartRecursion(entity.Children, result);
}
}
return result;
}
}
}

View File

@@ -0,0 +1,25 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Banner")]
public class BannerEntity : Entity<Guid>, ISoftDelete, IAuditedObject
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public string Name { get; set; }
public string? Logo { get; set; }
public string? Color { get; set; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; set; }
public Guid? CreatorId { get; set; }
public Guid? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

View File

@@ -0,0 +1,65 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Yi.Framework.Rbac.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
/// <summary>
/// 评论表
/// </summary>
[SugarTable("Comment")]
public class CommentEntity : Entity<Guid>, ISoftDelete, IAuditedObject
{
/// <summary>
/// 采用二维数组方式,不使用树形方式
/// </summary>
public CommentEntity()
{
}
public CommentEntity(Guid discussId)
{
DiscussId = discussId;
}
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public bool IsDeleted { get; set; }
public string Content { get; set; }
public Guid DiscussId { get; set; }
/// <summary>
/// 被回复的CommentId
/// </summary>
public Guid ParentId { get; set; }
public DateTime CreationTime { get; set; }
public Guid RootId { get; set; }
[SugarColumn(IsIgnore = true)]
public List<CommentEntity> Children { get; set; } = new();
/// <summary>
/// 用户,评论人用户信息
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(CreatorId))]
public UserEntity CreateUser { get; set; }
/// <summary>
/// 被评论的用户信息
/// </summary>
[SugarColumn(IsIgnore = true)]
public UserEntity CommentedUser { get; set; }
public Guid? CreatorId { get; set; }
public Guid? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

View File

@@ -0,0 +1,61 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Discuss")]
public class DiscussEntity : Entity<Guid>, ISoftDelete, IAuditedObject
{
public DiscussEntity()
{
}
public DiscussEntity(Guid plateId)
{
PlateId = plateId;
}
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected 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; }
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Content { get; set; }
public string? Color { get; set; }
public bool IsDeleted { get; set; }
//是否置顶默认false
public bool IsTop { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
public Guid PlateId { get; set; }
public DateTime CreationTime { get; set; }
public Guid? CreatorId { get; set; }
public Guid? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
/// <summary>
/// 当PermissionType为部分用户时候以下列表中的用户+创建者 代表拥有权限
/// </summary>
[SugarColumn(IsJson = true)]//使用json处理
public List<Guid>? PermissionUserIds { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using SqlSugar;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("DiscussMyType")]
public class DiscussMyTypeEntity : Entity<Guid>
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public Guid DiscussId { get; set; }
public Guid MyTypeId { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("MyType")]
public class MyTypeEntity : Entity<Guid>, ISoftDelete
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public bool IsDeleted { get; set; }
public string Name { get; set; }
public string? Color { get; set; }
public string? BackgroundColor { get; set; }
public Guid UserId { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using SqlSugar;
using Volo.Abp.Domain.Entities;
using Volo.Abp;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Plate")]
public class PlateEntity : Entity<Guid>, ISoftDelete
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public string Name { get; set; }
public string? Logo { get; set; }
public string? Introduction { get; set; }
public bool IsDeleted { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using SqlSugar;
using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Setting")]
public class SettingEntity : Entity<Guid>
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public int CommentPage { get; set; }
public int DiscussPage { get; set; }
public int CommentExperience { get; set; }
public int DiscussExperience { get; set; }
public string Title { get; set; }
}
}