zhangwencui
6 天以前 7619c19a67c2ac824f803090bab753fc5ea14408
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace SystemNoticeApi {
  /** 公告信息 */
  export interface Notice {
    id?: number;
    title: string;
    type: number;
    content: string;
    status: number;
    remark: string;
    creator?: string;
    createTime?: Date;
  }
}
 
/** 查询公告列表 */
export function getNoticePage(params: PageParam) {
  return requestClient.get<PageResult<SystemNoticeApi.Notice>>(
    '/system/notice/page',
    { params },
  );
}
 
/** 查询公告详情 */
export function getNotice(id: number) {
  return requestClient.get<SystemNoticeApi.Notice>(
    `/system/notice/get?id=${id}`,
  );
}
 
/** 新增公告 */
export function createNotice(data: SystemNoticeApi.Notice) {
  return requestClient.post('/system/notice/create', data);
}
 
/** 修改公告 */
export function updateNotice(data: SystemNoticeApi.Notice) {
  return requestClient.put('/system/notice/update', data);
}
 
/** 删除公告 */
export function deleteNotice(id: number) {
  return requestClient.delete(`/system/notice/delete?id=${id}`);
}
 
/** 批量删除公告 */
export function deleteNoticeList(ids: number[]) {
  return requestClient.delete(
    `/system/notice/delete-list?ids=${ids.join(',')}`,
  );
}
 
/** 推送公告 */
export function pushNotice(id: number) {
  return requestClient.post(`/system/notice/push?id=${id}`);
}