订阅支持自动添加和删除任务设置

This commit is contained in:
whyour
2023-02-09 00:20:28 +08:00
parent 46c9774efa
commit 76fa82c3a7
7 changed files with 96 additions and 17 deletions
+6
View File
@@ -29,6 +29,8 @@ export class Subscription {
sub_before?: string;
sub_after?: string;
proxy?: string;
autoAddCron?: 1 | 0;
autoDelCron?: 1 | 0;
constructor(options: Subscription) {
this.id = options.id;
@@ -56,6 +58,8 @@ export class Subscription {
this.sub_before = options.sub_before;
this.sub_after = options.sub_after;
this.proxy = options.proxy;
this.autoAddCron = options.autoAddCron ? 1 : 0;
this.autoDelCron = options.autoDelCron ? 1 : 0;
}
}
@@ -105,5 +109,7 @@ export const SubscriptionModel = sequelize.define<SubscriptionInstance>(
schedule_type: DataTypes.STRING,
alias: { type: DataTypes.STRING, unique: 'alias' },
proxy: { type: DataTypes.STRING, allowNull: true },
autoAddCron: { type: DataTypes.NUMBER, allowNull: true },
autoDelCron: { type: DataTypes.NUMBER, allowNull: true },
},
);