12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import {
- Model,
- DataTypes,
- CreationOptional,
- InferAttributes,
- InferCreationAttributes,
- } from 'sequelize';
- import sequelize from '../sequelizeInstance';
- class TrackTask extends Model<
- // eslint-disable-next-line no-use-before-define
- InferAttributes<TrackTask>,
- // eslint-disable-next-line no-use-before-define
- InferCreationAttributes<TrackTask>
- > {
- declare id: CreationOptional<number>;
- declare schoolId: string;
- declare semesterId: string;
- declare examId: string;
- declare pathRule: string;
- declare status: number;
- }
- TrackTask.init(
- {
- id: {
- type: DataTypes.INTEGER.UNSIGNED,
- autoIncrement: true,
- primaryKey: true,
- },
- schoolId: {
- type: DataTypes.STRING,
- allowNull: false,
- },
- semesterId: {
- type: DataTypes.STRING,
- allowNull: false,
- },
- examId: {
- type: DataTypes.STRING,
- allowNull: false,
- },
- pathRule: {
- type: DataTypes.STRING,
- allowNull: false,
- comment: '保存路径规则',
- },
- status: {
- type: DataTypes.INTEGER,
- allowNull: false,
- defaultValue: 0,
- // 任务状态:0:未开始,1:运行中,2:已完成
- },
- },
- {
- sequelize,
- modelName: 'TrackTask',
- underscored: true,
- tableName: 'trackTask',
- }
- );
- export type TrackTaskCreationAttributes = InferCreationAttributes<TrackTask>;
- export default TrackTask;
|