Files
FastapiAdmin/frontend/web-old/src/api/module_system/notice.ts
T
zhangtao fe9e32856f chore: 初始化前端项目基础结构与配置
添加了项目所需的基础配置文件(.editorconfig、.gitignore、环境变量文件等),创建了通用工具函数、类型定义、枚举常量、路由配置、状态管理、国际化、自定义指令与插件等核心模块,新增了多个业务组件、布局组件与页面视图,并添加了大量SVG图标资源。
2026-05-18 21:51:16 +08:00

96 lines
2.0 KiB
TypeScript

import request from "@/utils/request";
const API_PATH = "/system/notice";
const NoticeAPI = {
listNotice(query: NoticePageQuery) {
return request<ApiResponse<PageResult<NoticeTable[]>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
listNoticeAvailable() {
return request<ApiResponse<PageResult<NoticeTable[]>>>({
url: `${API_PATH}/available`,
method: "get",
});
},
detailNotice(query: number) {
return request<ApiResponse<NoticeTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
createNotice(body: NoticeForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updateNotice(id: number, body: NoticeForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deleteNotice(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batchNotice(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/available/setting`,
method: "patch",
data: body,
});
},
exportNotice(body: NoticePageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
};
export default NoticeAPI;
export interface NoticePageQuery extends PageQuery {
notice_title?: string;
notice_type?: string;
status?: string;
created_time?: string[];
updated_time?: string[];
created_id?: number;
updated_id?: number;
}
export interface NoticeTable extends BaseType {
notice_title?: string;
notice_type?: string;
notice_content?: string;
created_by?: CommonType;
updated_by?: CommonType;
deleted_by?: CommonType;
}
export interface NoticeForm extends BaseFormType {
notice_title?: string;
notice_type?: string;
notice_content?: string;
}