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