返回 AiToEarn
pubRecord.ts
1 /*
2 * @Author: nevin
3 * @Date: 2025-01-20 16:24:16
4 * @LastEditTime: 2025-02-05 17:00:23
5 * @LastEditors: nevin
6 * @Description: 发布记录
7 */
8 import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
9 import { TempModel } from './temp';
10 import { PubStatus, PubType } from '../../../commont/publish/PublishEnum';
11
12 @Entity({ name: 'pubRecord' })
13 export class PubRecordModel extends TempModel {
14 @PrimaryGeneratedColumn({ type: 'int', comment: 'id' })
15 id!: number;
16
17 @Column({ type: 'varchar', nullable: false, comment: '用户id' })
18 userId!: string;
19
20 @Column({
21 type: 'varchar',
22 enum: PubType,
23 nullable: false,
24 comment: '发布类型',
25 })
26 type!: PubType;
27
28 // 标题 视频发布没有标题
29 @Column({ type: 'varchar', nullable: false, comment: '标题' })
30 title?: string;
31
32 // 简介
33 @Column({ type: 'varchar', nullable: false, comment: '简介' })
34 desc!: string;
35
36 // 视频路径
37 @Column({ type: 'varchar', nullable: true, comment: '视频路径' })
38 videoPath?: string;
39
40 // 定时发布日期
41 @Column({ type: 'datetime', nullable: true, comment: '定时发布日期' })
42 timingTime?: Date;
43
44 // 封面路径
45 @Column({
46 type: 'varchar',
47 nullable: false,
48 comment: '封面路径,展示给前台用',
49 })
50 coverPath!: string;
51
52 // 通用封面路径
53 @Column({ type: 'varchar', nullable: true, comment: '通用封面路径' })
54 commonCoverPath?: string;
55
56 // 发布时间
57 @Column({ type: 'datetime', nullable: false, comment: '发布时间' })
58 publishTime!: Date;
59
60 // 状态
61 @Column({
62 type: 'tinyint',
63 nullable: false,
64 comment: '状态 0=未发布/草稿 1=已发布',
65 default: PubStatus.UNPUBLISH,
66 })
67 status!: PubStatus;
68 }
69
69 lines TYPESCRIPT