gaoluyang
9 天以前 86966ec9a83b93decbd93fc8ce2be1882d4c9775
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace SystemNotifyMessageApi {
  /** 站内信消息信息 */
  export interface NotifyMessage {
    id: number;
    userId: number;
    userType: number;
    templateId: number;
    templateCode: string;
    templateNickname: string;
    templateContent: string;
    templateType: number;
    templateParams: string;
    readStatus: boolean;
    readTime: Date;
    createTime: Date;
  }
}
 
/** 查询站内信消息列表 */
export function getNotifyMessagePage(params: PageParam) {
  return requestClient.get<PageResult<SystemNotifyMessageApi.NotifyMessage>>(
    '/system/notify-message/page',
    { params },
  );
}
 
/** 获得我的站内信分页 */
export function getMyNotifyMessagePage(params: PageParam) {
  return requestClient.get<PageResult<SystemNotifyMessageApi.NotifyMessage>>(
    '/system/notify-message/my-page',
    { params },
  );
}
 
/** 批量标记已读 */
export function updateNotifyMessageRead(ids: number[]) {
  return requestClient.put(
    '/system/notify-message/update-read',
    {},
    {
      params: { ids },
    },
  );
}
 
/** 标记所有站内信为已读 */
export function updateAllNotifyMessageRead() {
  return requestClient.put('/system/notify-message/update-all-read');
}
 
/** 获取当前用户的最新站内信列表 */
export function getUnreadNotifyMessageList() {
  return requestClient.get<SystemNotifyMessageApi.NotifyMessage[]>(
    '/system/notify-message/get-unread-list',
  );
}
 
/** 获得当前用户的未读站内信数量 */
export function getUnreadNotifyMessageCount() {
  return requestClient.get<number>('/system/notify-message/get-unread-count');
}