2019-07-28 04:56:12 +08:00
|
|
|
export enum TaskTriggerType {
|
|
|
|
never = 1, scheduled = 2, periodic = 3
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TaskTrigger {
|
|
|
|
type: TaskTriggerType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NeverTaskTrigger {
|
|
|
|
type: TaskTriggerType.never;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ScheduledTaskTrigger extends TaskTrigger {
|
|
|
|
type: TaskTriggerType.scheduled;
|
2019-08-20 18:54:45 +08:00
|
|
|
time: number; // data time
|
2019-07-28 04:56:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface PeriodicTaskTrigger extends TaskTrigger {
|
|
|
|
type: TaskTriggerType.periodic;
|
2019-12-06 22:53:34 +08:00
|
|
|
periodicity: number; // 0-6: week days 7 every day
|
2019-08-20 18:54:45 +08:00
|
|
|
atTime: number; // day time
|
2019-07-28 04:56:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TaskScheduleDTO {
|
|
|
|
priority: number;
|
|
|
|
taskName: string;
|
|
|
|
config: any;
|
|
|
|
trigger: NeverTaskTrigger | ScheduledTaskTrigger | PeriodicTaskTrigger;
|
|
|
|
}
|