This commit is contained in:
yxw
2025-12-22 17:54:57 +08:00
parent 903d6d9304
commit 1f0c84f75e
6 changed files with 139 additions and 8 deletions

View File

@@ -16,9 +16,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AntDesign" Version="1.5.0" />
<PackageReference Include="AntDesign" Version="1.5.1" />
<PackageReference Include="AntDesign.ProLayout" Version="1.4.0" />
<PackageReference Include="Blazilla" Version="2.0.1" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Blazored.FluentValidation" Version="2.2.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />

View File

@@ -32,7 +32,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.1" />
<PackageReference Include="Scalar.AspNetCore" Version="2.11.5" />
<PackageReference Include="Scalar.AspNetCore" Version="2.11.7" />
<PackageReference Include="Serilog.Settings.Configuration" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />

View File

@@ -1,12 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 内容数据表
/// </summary>
[Table("Posts")]
public class Post
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
public int Type { get; set; }
/// <summary>
/// 作者ID
/// </summary>
public long AuthorId { get; set; }
/// <summary>
/// 标题
/// </summary>
[Column(TypeName = "varchar(256)")]
public string Title { get; set; } = string.Empty;
/// <summary>
/// 浏览数
/// </summary>
public int ViewCount { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 内容标签关系表
/// </summary>
[Table("PostTagRelations")]
public class PostTagRelation
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
public long ContentType { get; set; }
/// <summary>
/// 内容ID
/// </summary>
public long ContentId { get; set; }
/// <summary>
/// 标签ID
/// </summary>
public long TagId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; }
}
}

View File

@@ -0,0 +1,57 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 标签
/// </summary>
[Table("Tags")]
public class Tag
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 标签名称
/// </summary>
[Column(TypeName = "varchar(64)")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 颜色
/// </summary>
[Column(TypeName = "varchar(12)")]
public string Color { get; set; } = string.Empty;
/// <summary>
/// URL标识
/// </summary>
[Column(TypeName = "varchar(128)")]
public string Slug { get; set; } = string.Empty;
/// <summary>
/// 使用次数
/// </summary>
public int Count { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public int Enabled { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}

View File

@@ -167,6 +167,11 @@ namespace Atomx.Data
/// </summary>
public DbSet<Menu> Menus { get; set; }
/// <summary>
/// 标签
/// </summary>
public DbSet<Tag> Tags { get; set; }
/// <summary>
/// 上传文件
/// </summary>