export interface JobLogVO extends BaseEntity {
  id: number | string;
  jobGroup: number;
  jobId: number;
  executorAddress: string;
  executorHandler: string;
  executorParam: string;
  executorShardingParam: string;
  executorFailRetryCount: number;
  triggerTime: string;
  triggerCode: number;
  triggerMsg: string;
  handleTime: string;
  handleCode: number;
  handleMsg: string;
  alarmStatus: number;
}

export interface JobLogQuery extends PageQuery {
  jobGroup: number | string;
  jobId: number | string;
  logStatus: number | string;
  filterTime: string[];
  startTime: string;
  endTime: string;
}

// 日志状态枚举 (根据后台 Mapper 中的逻辑)
export enum LogStatus {
  SUCCESS = 1,    // handle_code = 200
  FAIL = 2,       // trigger_code NOT IN (0, 200) OR handle_code NOT IN (0, 200)
  RUNNING = 3     // trigger_code = 200 AND handle_code = 0
}

// 调度状态码
export enum TriggerCode {
  WAIT = 0,       // 等待
  SUCCESS = 200,  // 成功
  FAIL = 500      // 失败
}

// 执行状态码
export enum HandleCode {
  RUNNING = 0,    // 进行中
  SUCCESS = 200,  // 成功
  FAIL = 500      // 失败
}

// 日志详情
export interface JobLogDetail {
  triggerCode: number;
  triggerMsg: string;
  handleCode: number;
  handleMsg: string;
  executorAddress: string;
  logContent: string;
}
