zhangwencui
8 天以前 4eaf74efba7ead917bf53155a9b9fa59c4743cf8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace SystemNotifyTemplateApi {
  /** 站内信模板信息 */
  export interface NotifyTemplate {
    id?: number;
    name: string;
    nickname: string;
    code: string;
    content: string;
    type?: number;
    params: string[];
    status: number;
    remark: string;
  }
 
  /** 站内信模板精简信息 */
  export interface NotifyTemplateSimple {
    id: number;
    name: string;
    code: string;
  }
 
  /** 发送站内信请求 */
  export interface NotifySendReqVO {
    userId: number;
    userType: number;
    templateCode: string;
    templateParams: Record<string, any>;
  }
}
 
/** 查询站内信模板列表 */
export function getNotifyTemplatePage(params: PageParam) {
  return requestClient.get<PageResult<SystemNotifyTemplateApi.NotifyTemplate>>(
    '/system/notify-template/page',
    { params },
  );
}
 
/** 查询站内信模板精简列表 */
export function getSimpleNotifyTemplateList() {
  return requestClient.get<SystemNotifyTemplateApi.NotifyTemplateSimple[]>(
    '/system/notify-template/simple-list',
  );
}
 
/** 查询站内信模板详情 */
export function getNotifyTemplate(id: number) {
  return requestClient.get<SystemNotifyTemplateApi.NotifyTemplate>(
    `/system/notify-template/get?id=${id}`,
  );
}
 
/** 新增站内信模板 */
export function createNotifyTemplate(
  data: SystemNotifyTemplateApi.NotifyTemplate,
) {
  return requestClient.post('/system/notify-template/create', data);
}
 
/** 修改站内信模板 */
export function updateNotifyTemplate(
  data: SystemNotifyTemplateApi.NotifyTemplate,
) {
  return requestClient.put('/system/notify-template/update', data);
}
 
/** 删除站内信模板 */
export function deleteNotifyTemplate(id: number) {
  return requestClient.delete(`/system/notify-template/delete?id=${id}`);
}
 
/** 批量删除站内信模板 */
export function deleteNotifyTemplateList(ids: number[]) {
  return requestClient.delete(
    `/system/notify-template/delete-list?ids=${ids.join(',')}`,
  );
}
 
/** 导出站内信模板 */
export function exportNotifyTemplate(params: any) {
  return requestClient.download('/system/notify-template/export-excel', {
    params,
  });
}
 
/** 发送站内信 */
export function sendNotify(data: SystemNotifyTemplateApi.NotifySendReqVO) {
  return requestClient.post('/system/notify-template/send-notify', data);
}