feat:【system】邮箱管理的开发:50% 初始化

This commit is contained in:
YunaiV
2025-12-20 18:04:56 +08:00
parent 968f345839
commit c48b4b908f
17 changed files with 1917 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
export interface MailAccount {
id?: number
mail: string
username: string
password?: string
host: string
port: number
sslEnable: boolean
starttlsEnable: boolean
remark?: string
createTime?: string
}
export function getMailAccountPage(params: PageParam) {
return http.get<PageResult<MailAccount>>('/system/mail-account/page', params)
}
export function getSimpleMailAccountList() {
return http.get<MailAccount[]>('/system/mail-account/simple-list')
}
export function getMailAccount(id: number) {
return http.get<MailAccount>(`/system/mail-account/get?id=${id}`)
}
export function createMailAccount(data: MailAccount) {
return http.post<number>('/system/mail-account/create', data)
}
export function updateMailAccount(data: MailAccount) {
return http.put<boolean>('/system/mail-account/update', data)
}
export function deleteMailAccount(id: number) {
return http.delete<boolean>(`/system/mail-account/delete?id=${id}`)
}

View File

@@ -0,0 +1,27 @@
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
export interface MailLog {
id?: number
userId?: number
userType?: number
templateId?: number
templateCode?: string
templateTitle?: string
templateContent?: string
templateParams?: Record<string, any>
accountId?: number
fromMail?: string
toMails?: string[]
ccMails?: string[]
bccMails?: string[]
sendStatus?: number
sendTime?: string
sendMessageId?: string
sendException?: string
createTime?: string
}
export function getMailLogPage(params: PageParam) {
return http.get<PageResult<MailLog>>('/system/mail-log/page', params)
}

View File

@@ -0,0 +1,48 @@
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
export interface MailTemplate {
id?: number
name: string
code: string
accountId?: number
nickname?: string
title: string
content: string
status: number
remark?: string
params?: string[]
createTime?: string
}
export interface MailSendReqVO {
templateCode: string
templateParams: Record<string, any>
toMails: string[]
ccMails?: string[]
bccMails?: string[]
}
export function getMailTemplatePage(params: PageParam) {
return http.get<PageResult<MailTemplate>>('/system/mail-template/page', params)
}
export function getMailTemplate(id: number) {
return http.get<MailTemplate>(`/system/mail-template/get?id=${id}`)
}
export function createMailTemplate(data: MailTemplate) {
return http.post<number>('/system/mail-template/create', data)
}
export function updateMailTemplate(data: MailTemplate) {
return http.put<boolean>('/system/mail-template/update', data)
}
export function deleteMailTemplate(id: number) {
return http.delete<boolean>(`/system/mail-template/delete?id=${id}`)
}
export function sendMail(data: MailSendReqVO) {
return http.post<number>('/system/mail-template/send-mail', data)
}