add comment and category

This commit is contained in:
liuyi 2025-05-20 10:18:39 +08:00
parent e2f1180a14
commit e487cf7555
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import { Column, Entity, PrimaryColumn } from 'typeorm';
@Entity('content_category')
export class CategoryEntity {
@PrimaryColumn({ type: 'varchar', generated: 'uuid', length: 36 })
id: string;
@Column({ comment: '分类名称', unique: true })
name: string;
@Column({ comment: '分类排序', default: 0 })
customOrder: number;
}

View File

@ -0,0 +1,13 @@
import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm';
@Entity('content_comment')
export class CommentEntity {
@PrimaryColumn({ type: 'varchar', length: 36, generated: 'uuid' })
id: string;
@Column({ comment: '评论内容', type: 'text' })
body: string;
@CreateDateColumn({ comment: '创建时间' })
createdAt: Date;
}

View File

@ -0,0 +1,13 @@
import { Column, Entity, PrimaryColumn } from 'typeorm';
@Entity('content_tag')
export class TagEntity {
@PrimaryColumn({ type: 'varchar', generated: 'uuid', length: 36 })
id: string;
@Column({ comment: '标签名称', unique: true })
name: string;
@Column({ comment: '标签描述', nullable: true })
desc?: string;
}