| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2025-01-20 16:24:16 |
| 4 | * @LastEditTime: 2025-03-23 09:27:54 |
| 5 | * @LastEditors: nevin |
| 6 | * @Description: 自动评论 autoComment |
| 7 | */ |
| 8 | import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; |
| 9 | import { TempModel } from './temp'; |
| 10 | import { AutoRunType } from './autoRun'; |
| 11 | |
| 12 | // 状态 进行中 失败 完成 |
| 13 | export enum AutoRunRecordStatus { |
| 14 | DOING = 1, // 进行中 |
| 15 | FAIL = 2, // 失败 |
| 16 | SUCCESS = 3, // 完成 |
| 17 | } |
| 18 | |
| 19 | @Entity({ name: 'autoRunRecord' }) |
| 20 | export class AutoRunRecordModel extends TempModel { |
| 21 | @PrimaryGeneratedColumn({ type: 'int', comment: 'id' }) |
| 22 | id!: number; |
| 23 | |
| 24 | @Column({ type: 'int', nullable: false, comment: ' 自动任务id' }) |
| 25 | autoRunId!: number; |
| 26 | |
| 27 | @Column({ type: 'varchar', nullable: false, comment: '用户id' }) |
| 28 | userId!: string; |
| 29 | |
| 30 | @Column({ |
| 31 | type: 'tinyint', |
| 32 | nullable: false, |
| 33 | comment: '自动程序运行状态', |
| 34 | default: AutoRunRecordStatus.DOING, |
| 35 | }) |
| 36 | status!: AutoRunRecordStatus; |
| 37 | |
| 38 | @Column({ |
| 39 | type: 'tinyint', |
| 40 | nullable: false, |
| 41 | comment: '类型', |
| 42 | }) |
| 43 | type!: AutoRunType; |
| 44 | |
| 45 | @Column({ |
| 46 | type: 'varchar', |
| 47 | nullable: false, |
| 48 | comment: |
| 49 | '周期类型 天 day-22 (例:每天22时) 周 week-2 (例:每周周二,周日0) 月 month-22 (例:每月22号)', |
| 50 | }) |
| 51 | cycleType!: string; |
| 52 | |
| 53 | @Column({ type: 'varchar', nullable: true, comment: '记录描述' }) |
| 54 | record?: string; |
| 55 | } |
| 56 |