Files
iot-device-management-frontend/apps/web-antd/src/api/system/notify/template/index.ts

64 lines
1.9 KiB
TypeScript
Raw Normal View History

2025-04-04 14:13:30 +08:00
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace SystemNotifyTemplateApi {
/** 站内信模板信息 */
export interface SystemNotifyTemplate {
2025-04-04 14:13:30 +08:00
id?: number;
name: string;
nickname: string;
code: string;
content: string;
type?: number;
params: string[];
status: number;
remark: string;
}
/** 发送站内信请求 */
export interface SystemNotifySendReqVO {
2025-04-04 14:13:30 +08:00
userId: number;
templateCode: string;
templateParams: Record<string, any>;
}
}
/** 查询站内信模板列表 */
export function getNotifyTemplatePage(params: PageParam) {
return requestClient.get<PageResult<SystemNotifyTemplateApi.SystemNotifyTemplate>>(
2025-04-04 14:13:30 +08:00
'/system/notify-template/page',
{ params },
);
}
/** 查询站内信模板详情 */
export function getNotifyTemplate(id: number) {
return requestClient.get<SystemNotifyTemplateApi.SystemNotifyTemplate>(`/system/notify-template/get?id=${id}`);
2025-04-04 14:13:30 +08:00
}
/** 新增站内信模板 */
export function createNotifyTemplate(data: SystemNotifyTemplateApi.SystemNotifyTemplate) {
2025-04-04 14:13:30 +08:00
return requestClient.post('/system/notify-template/create', data);
}
/** 修改站内信模板 */
export function updateNotifyTemplate(data: SystemNotifyTemplateApi.SystemNotifyTemplate) {
2025-04-04 14:13:30 +08:00
return requestClient.put('/system/notify-template/update', data);
}
/** 删除站内信模板 */
export function deleteNotifyTemplate(id: number) {
return requestClient.delete(`/system/notify-template/delete?id=${id}`);
}
/** 导出站内信模板 */
export function exportNotifyTemplate(params: any) {
return requestClient.download('/system/notify-template/export-excel', { params });
2025-04-04 14:13:30 +08:00
}
/** 发送站内信 */
export function sendNotify(data: SystemNotifyTemplateApi.SystemNotifySendReqVO) {
2025-04-04 14:13:30 +08:00
return requestClient.post('/system/notify-template/send-notify', data);
}