完善订阅接口

This commit is contained in:
whyour
2022-05-14 21:38:26 +08:00
parent 5a21247cbb
commit 5523d537dc
5 changed files with 90 additions and 23 deletions
+9 -1
View File
@@ -7,7 +7,8 @@ export class Subscription {
name?: string;
type?: 'public-repo' | 'private-repo' | 'file';
schedule_type?: 'crontab' | 'interval';
schedule?: string | SimpleIntervalSchedule;
schedule?: string;
intervalSchedule?: SimpleIntervalSchedule;
url?: string;
whitelist?: string;
blacklist?: string;
@@ -22,6 +23,7 @@ export class Subscription {
isDisabled?: 1 | 0;
log_path?: string;
alias: string;
command?: string;
constructor(options: Subscription) {
this.id = options.id;
@@ -41,6 +43,7 @@ export class Subscription {
this.log_path = options.log_path;
this.schedule_type = options.schedule_type;
this.alias = options.alias;
this.intervalSchedule = options.intervalSchedule;
}
}
@@ -69,6 +72,11 @@ export const SubscriptionModel = sequelize.define<SubscriptionInstance>(
unique: 'compositeIndex',
type: DataTypes.STRING,
},
intervalSchedule: {
unique: 'compositeIndex',
type: DataTypes.JSON,
},
type: DataTypes.STRING,
whitelist: DataTypes.STRING,
blacklist: DataTypes.STRING,
status: DataTypes.NUMBER,