import request from '@/config/axios'

export interface MailNotifyConfigVO {
  configId?: number
  configName: string
  configCode: string
  notifyCycle?: string
  notifyTime?: string
  notifyType?: string
  status?: string
  remark?: string
  createTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  configName?: string
  configCode?: string
  status?: string
}

// 查看系统邮件提醒周期配置-分页
export const listIsMailNotifyConfigPage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/mail-notify-config/getMailNotifyConfigPage', params })
}

// 新增系统邮件提醒周期配置
export const addIsMailNotifyConfig = async (data: MailNotifyConfigVO) => {
  return await request.post({ url: '/iscs/mail-notify-config/insertMailNotifyConfig', data })
}

// 删除系统邮件提醒周期配置
export const deleteIsMailNotifyConfig = async (ids: number) => {
  return await request.delete({
    url: '/iscs/mail-notify-config/deleteMailNotifyConfigList?ids='+ids,
  })
}

// 修改系统邮件提醒周期配置
export const updateIsMailNotifyConfig = async (data: MailNotifyConfigVO) => {
  return await request.put({ url: '/iscs/mail-notify-config/updateMailNotifyConfig', data })
}

// 获取系统邮件提醒周期配置详细信息
export const getIsMailNotifyConfigById = async (id: number) => {
  return await request.get({
    url: '/iscs/mail-notify-config/selectMailNotifyConfigById',
    params: { id }
  })
}
