调整数据库结构、添加博客权限enum
This commit is contained in:
5
tone-page-server/src/blog/blog.permission.enum.ts
Normal file
5
tone-page-server/src/blog/blog.permission.enum.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export enum BlogPermission {
|
||||
Public = 'Public',
|
||||
ByPassword = 'ByPassword',
|
||||
List = 'List',
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { BlogComment } from './BlogComment.entity';
|
||||
import { BlogPermission } from '../Blog.Permission.enum';
|
||||
|
||||
@Entity()
|
||||
export class Blog {
|
||||
@@ -35,7 +36,12 @@ export class Blog {
|
||||
@DeleteDateColumn({ precision: 3, nullable: true })
|
||||
deletedAt: Date;
|
||||
|
||||
// 权限关系 TODO
|
||||
// 权限
|
||||
@Column('simple-array', { default: '' })
|
||||
permissions: BlogPermission[];
|
||||
|
||||
@Column({ nullable: true })
|
||||
password_hash: string | null;
|
||||
|
||||
// 关系
|
||||
@OneToMany(() => BlogComment, (blog) => blog.id)
|
||||
|
||||
Reference in New Issue
Block a user