import type { PageParam, PageResult } from '@vben/request';

import { requestClient } from '#/api/request';

export namespace AlertApi {
  export interface Alert {
    id: number;
    users: [];
    days: [];
    content: string;
    status: number;
    templateCode: string;
    remark: string;
    createTime: string;
  }

  export interface AlertPageReq extends PageParam {
    reminderName?: string;
    expireTime?: string;
    reminderDays?: number;
  }
}
// 获取告警列表
export function getAlertPage(params: PageParam) {
  return requestClient.get<PageResult<AlertApi.Alert>>('/license/alert/page', {
    params,
  });
}

// 修改告警配置
export function updateAlert(data: AlertApi.Alert) {
  return requestClient.put('/license/alert/update', data);
}
