feat: 邮箱管理
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import type { PageResult } from '@vben/request';
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// TODO @puhui999:代码风格的统一
|
||||
export namespace SystemMailAccountApi {
|
||||
export interface MailAccountVO {
|
||||
/** 邮箱信息 */
|
||||
export interface MailAccount {
|
||||
id: number;
|
||||
mail: string;
|
||||
username: string;
|
||||
@@ -19,16 +19,17 @@ export namespace SystemMailAccountApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询邮箱账号列表
|
||||
export const getMailAccountPage = async (params: any) => {
|
||||
return await requestClient.get<
|
||||
PageResult<SystemMailAccountApi.MailAccountVO>
|
||||
>('/system/mail-account/page', { params });
|
||||
/** 查询邮箱账号列表 */
|
||||
export const getMailAccountPage = async (params: PageParam) => {
|
||||
return await requestClient.get<PageResult<SystemMailAccountApi.MailAccount>>(
|
||||
'/system/mail-account/page',
|
||||
{ params },
|
||||
);
|
||||
};
|
||||
|
||||
// 查询邮箱账号详情
|
||||
/** 查询邮箱账号详情 */
|
||||
export const getMailAccount = async (id: number) => {
|
||||
return await requestClient.get<SystemMailAccountApi.MailAccountVO>(
|
||||
return await requestClient.get<SystemMailAccountApi.MailAccount>(
|
||||
'/system/mail-account/get',
|
||||
{
|
||||
params: { id },
|
||||
@@ -36,41 +37,41 @@ export const getMailAccount = async (id: number) => {
|
||||
);
|
||||
};
|
||||
|
||||
// 新增邮箱账号
|
||||
/** 新增邮箱账号 */
|
||||
export const createMailAccount = async (
|
||||
data: SystemMailAccountApi.MailAccountVO,
|
||||
data: SystemMailAccountApi.MailAccount,
|
||||
) => {
|
||||
return await requestClient.post<SystemMailAccountApi.MailAccountVO>(
|
||||
return await requestClient.post<SystemMailAccountApi.MailAccount>(
|
||||
'/system/mail-account/create',
|
||||
data,
|
||||
);
|
||||
};
|
||||
|
||||
// 修改邮箱账号
|
||||
/** 修改邮箱账号 */
|
||||
export const updateMailAccount = async (
|
||||
data: SystemMailAccountApi.MailAccountVO,
|
||||
data: SystemMailAccountApi.MailAccount,
|
||||
) => {
|
||||
return await requestClient.put<SystemMailAccountApi.MailAccountVO>(
|
||||
return await requestClient.put<SystemMailAccountApi.MailAccount>(
|
||||
'/system/mail-account/update',
|
||||
data,
|
||||
);
|
||||
};
|
||||
|
||||
// 删除邮箱账号
|
||||
/** 删除邮箱账号 */
|
||||
export const deleteMailAccount = async (id: number) => {
|
||||
return await requestClient.delete<boolean>('/system/mail-account/delete', {
|
||||
params: { id },
|
||||
});
|
||||
};
|
||||
|
||||
// 获得邮箱账号精简列表
|
||||
/** 获得邮箱账号精简列表 */
|
||||
export const getSimpleMailAccountList = async () => {
|
||||
return await requestClient.get<SystemMailAccountApi.MailAccountVO[]>(
|
||||
return await requestClient.get<SystemMailAccountApi.MailAccount[]>(
|
||||
'/system/mail-account/simple-list',
|
||||
);
|
||||
};
|
||||
|
||||
// 测试邮箱连接
|
||||
/** 测试邮箱连接 */
|
||||
export const testMailAccount = async (id: number) => {
|
||||
return await requestClient.post<boolean>('/system/mail-account/test', null, {
|
||||
params: { id },
|
||||
|
||||
Reference in New Issue
Block a user