format + lint
This commit is contained in:
@@ -1,35 +1,43 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { BlogComment } from "./BlogComment";
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Entity,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { BlogComment } from './BlogComment';
|
||||
|
||||
@Entity()
|
||||
export class Blog {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column()
|
||||
title: string;
|
||||
@Column()
|
||||
title: string;
|
||||
|
||||
@Column()
|
||||
description: string;
|
||||
@Column()
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
contentUrl: string;
|
||||
@Column()
|
||||
contentUrl: string;
|
||||
|
||||
@Column({ default: 0 })
|
||||
viewCount: number;
|
||||
@Column({ default: 0 })
|
||||
viewCount: number;
|
||||
|
||||
@CreateDateColumn({ precision: 3 })
|
||||
createdAt: Date;
|
||||
@CreateDateColumn({ precision: 3 })
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn({ precision: 3 })
|
||||
updatedAt: Date;
|
||||
@UpdateDateColumn({ precision: 3 })
|
||||
updatedAt: Date;
|
||||
|
||||
@DeleteDateColumn({ precision: 3, nullable: true })
|
||||
deletedAt: Date;
|
||||
@DeleteDateColumn({ precision: 3, nullable: true })
|
||||
deletedAt: Date;
|
||||
|
||||
// 权限关系 TODO
|
||||
// 权限关系 TODO
|
||||
|
||||
// 关系
|
||||
@OneToMany(() => BlogComment, blog => blog.id)
|
||||
comments: BlogComment[];
|
||||
}
|
||||
// 关系
|
||||
@OneToMany(() => BlogComment, (blog) => blog.id)
|
||||
comments: BlogComment[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user