feat:增加 notice 通知告警

This commit is contained in:
YunaiV
2025-04-06 09:53:19 +08:00
parent 67dafcc72a
commit 99797f6618
4 changed files with 428 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
import { requestClient } from '#/api/request';
import type { PageParam, PageResult } from '@vben/request';
export namespace SystemNoticeApi {
/** 公告信息 */
export interface SystemNotice {
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.SystemNotice>>('/system/notice/page', { params });
}
/** 查询公告详情 */
export function getNotice(id: number) {
return requestClient.get<SystemNoticeApi.SystemNotice>(`/system/notice/get?id=${id}`);
}
/** 新增公告 */
export function createNotice(data: SystemNoticeApi.SystemNotice) {
return requestClient.post('/system/notice/create', data);
}
/** 修改公告 */
export function updateNotice(data: SystemNoticeApi.SystemNotice) {
return requestClient.put('/system/notice/update', data);
}
/** 删除公告 */
export function deleteNotice(id: number) {
return requestClient.delete(`/system/notice/delete?id=${id}`);
}
/** 推送公告 */
export function pushNotice(id: number) {
return requestClient.post(`/system/notice/push?id=${id}`);
}