liu
6 天以前 5c124cdf26e4d749eae1e7fc9df366e9a5f4d259
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace OaNoticeApi {
  export interface NoticeVO {
    id: number;
    title: string;
    content: string;
    type: number;
    status: number;
    sendScope: number;
    isTop: number;
    publishUserId: number;
    publishTime: string;
    createTime: string;
    userIds?: number[];
  }
 
  export interface NoticeSaveReqVO {
    id?: number;
    title: string;
    content: string;
    type: number;
    status: number;
    sendScope: number;
    isTop?: number;
    userIds?: number[];
  }
}
 
const BASE = '/bpm/oa/notice';
 
/** 分页查询通知公告 */
export function getNoticePage(params: PageParam) {
  return requestClient.get<PageResult<OaNoticeApi.NoticeVO>>(`${BASE}/page`, {
    params,
  });
}
 
/** 查询通知公告详情(调用即标记已读) */
export function getNotice(id: number) {
  return requestClient.get<OaNoticeApi.NoticeVO>(`${BASE}/get`, {
    params: { id },
  });
}
 
/** 创建通知公告 */
export function createNotice(data: OaNoticeApi.NoticeSaveReqVO) {
  return requestClient.post(`${BASE}/create`, data);
}
 
/** 修改通知公告 */
export function updateNotice(data: OaNoticeApi.NoticeSaveReqVO) {
  return requestClient.put(`${BASE}/update`, data);
}
 
/** 删除通知公告 */
export function deleteNotice(id: number) {
  return requestClient.delete(`${BASE}/delete`, { params: { id } });
}
 
/** 获取我的未读通知公告数量 */
export function getMyUnreadNoticeCount() {
  return requestClient.get<number>(`${BASE}/my-unread-count`);
}