add comment and category
This commit is contained in:
parent
e2f1180a14
commit
e487cf7555
13
src/modules/content/entities/CategoryEntity.ts
Normal file
13
src/modules/content/entities/CategoryEntity.ts
Normal 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;
|
||||||
|
}
|
13
src/modules/content/entities/comment.entity.ts
Normal file
13
src/modules/content/entities/comment.entity.ts
Normal 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;
|
||||||
|
}
|
13
src/modules/content/entities/tag.entity.ts
Normal file
13
src/modules/content/entities/tag.entity.ts
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user