동기화

This commit is contained in:
GA Pro
2026-05-14 01:21:27 +09:00
parent acea2afce5
commit 958fe6b980
379 changed files with 21786 additions and 423 deletions
+48
View File
@@ -0,0 +1,48 @@
import api, { PageResponse, unwrap } from './request';
export interface NoticeRow extends Record<string, unknown> {
noticeId: number;
title: string;
content: string;
noticeType: string; // GENERAL / IMPORTANT / SYSTEM
isPinned: boolean;
authorId: number;
authorName: string;
viewCount: number;
publishedAt?: string;
expiresAt?: string;
status: string;
createdAt: string;
}
export interface NoticeSaveReq {
title: string;
content: string;
noticeType: string;
isPinned: boolean;
publishedAt?: string;
expiresAt?: string;
}
export interface NoticeSearchParam {
title?: string;
noticeType?: string;
status?: string;
pageNum?: number;
pageSize?: number;
}
export const noticeApi = {
list: (p?: NoticeSearchParam) =>
unwrap<PageResponse<NoticeRow>>(
api.get('/api/notices', { params: p }),
),
detail: (id: number) =>
unwrap<NoticeRow>(api.get(`/api/notices/${id}`)),
create: (body: NoticeSaveReq) =>
unwrap<NoticeRow>(api.post('/api/notices', body)),
update: (id: number, body: Partial<NoticeSaveReq>) =>
unwrap<NoticeRow>(api.put(`/api/notices/${id}`, body)),
delete: (id: number) =>
unwrap<void>(api.delete(`/api/notices/${id}`)),
};