import request from '@/config/axios'

export interface EmailTemplateVO {
  templateId?: number
  templateName: string
  templateCode: string
  templateContent?: string
  templateType?: string
  status?: string
  remark?: string
  createTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  templateName?: string
  templateCode?: string
  templateType?: string
  status?: string
}

// 查询邮件模板列表
export const listEmailTemplates = async (params: PageParam) => {
  return await request.get({ url: '/iscs/mail-send-task-item/getMailSendTaskItemPage', params })
}

// 查询邮件模板详细
export const getEmailTemplatesInfo = async (id: number) => {
  return await request.get({
    url: '/iscs/mail-send-task-item/selectMailSendTaskItemById',
    params: { id }
  })
}

// 新增邮件模板
export const addEmailTemplates = async (data: EmailTemplateVO) => {
  return await request.post({ url: '/iscs/mail-send-task-item/insertMailSendTaskItem', data })
}

// 修改邮件模板
export const updateEmailTemplates = async (data: EmailTemplateVO) => {
  return await request.put({ url: '/iscs/mail-send-task-item/updateMailSendTaskItem', data })
}

// 删除邮件模板
export const delEmailTemplates = async (ids: number) => {
  return await request.post({
    url: '/iscs/mail-send-task-item/deleteMailSendTaskItemList?ids='+ids,
  })
}
