2023-02-11 00:44:00 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export interface MailTemplateVO {
|
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
code: string
|
|
|
|
accountId: number
|
|
|
|
nickname: string
|
|
|
|
title: string
|
|
|
|
content: string
|
|
|
|
params: string
|
|
|
|
status: number
|
|
|
|
remark: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MailSendReqVO {
|
|
|
|
mail: string
|
|
|
|
templateCode: string
|
|
|
|
templateParams: Map<String, Object>
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询邮件模版列表
|
2023-03-18 10:39:19 +08:00
|
|
|
export const getMailTemplatePage = async (params: PageParam) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.get({ url: '/system/mail-template/page', params })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询邮件模版详情
|
2023-03-18 10:39:19 +08:00
|
|
|
export const getMailTemplate = async (id: number) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.get({ url: '/system/mail-template/get?id=' + id })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 新增邮件模版
|
2023-03-18 10:39:19 +08:00
|
|
|
export const createMailTemplate = async (data: MailTemplateVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.post({ url: '/system/mail-template/create', data })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 修改邮件模版
|
2023-03-18 10:39:19 +08:00
|
|
|
export const updateMailTemplate = async (data: MailTemplateVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.put({ url: '/system/mail-template/update', data })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除邮件模版
|
2023-03-18 10:39:19 +08:00
|
|
|
export const deleteMailTemplate = async (id: number) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.delete({ url: '/system/mail-template/delete?id=' + id })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 发送邮件
|
2023-03-18 10:39:19 +08:00
|
|
|
export const sendMail = (data: MailSendReqVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.post({ url: '/system/mail-template/send-mail', data })
|
|
|
|
}
|