-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
098bd14
commit 80486ee
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { ApiResponse, PaginationParams } from './common'; | ||
|
||
export interface NoticeItem { | ||
id: number; | ||
title: string; | ||
content: string; | ||
writer: string; | ||
viewCount: number; | ||
createdDate: string; | ||
category: string; | ||
fileList?: string[]; | ||
} | ||
|
||
export interface NoticeResponse { | ||
message: string; | ||
page: number; | ||
totalPage: number; | ||
data: NoticeItem[]; | ||
} | ||
|
||
export interface NoticeRequest { | ||
title: string; | ||
content: string; | ||
writer: string; | ||
category: string; | ||
departmentId: number; | ||
fileList?: string[]; | ||
createDate: string; | ||
} | ||
|
||
export interface NoticeFormData extends Omit<NoticeRequest, 'fileList'> { | ||
files?: File[]; | ||
} | ||
|
||
export interface PaginatedNoticeResponse { | ||
content: NoticeItem[]; | ||
totalPages: number; | ||
totalElements: number; | ||
size: number; | ||
number: number; | ||
} | ||
|
||
export type NoticeListResponse = ApiResponse<NoticeResponse>; | ||
export type NoticeSingleResponse = ApiResponse<NoticeItem>; | ||
export type NoticeCreateResponse = ApiResponse<number>; | ||
export type NoticeUpdateResponse = ApiResponse<void>; | ||
export type NoticeDeleteResponse = ApiResponse<void>; | ||
|
||
export interface NoticeQueryParams extends PaginationParams { | ||
category?: string; | ||
sort?: string; | ||
sortDirection?: 'ASC' | 'DESC'; | ||
} | ||
|
||
// Query Keys | ||
export const noticeKeys = { | ||
all: ['notices'] as const, | ||
lists: () => [...noticeKeys.all, 'list'] as const, | ||
list: (params: NoticeQueryParams) => [...noticeKeys.lists(), params] as const, | ||
details: () => [...noticeKeys.all, 'detail'] as const, | ||
detail: (id: number) => [...noticeKeys.details(), id] as const, | ||
}; |