-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from donga-it-club/develop
[FE][Release] 240724 테스트 전 빌드
- Loading branch information
Showing
35 changed files
with
1,360 additions
and
164 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
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,147 @@ | ||
// get | ||
// 게시글 목록 조회 | ||
export interface GetNoticeListRequest { | ||
page: number; | ||
size: number; | ||
} | ||
|
||
export interface GetNoticeListResponse { | ||
code: number; | ||
message: string; | ||
data: GetNoticeListData; | ||
} | ||
|
||
export interface GetNoticeListData { | ||
posts: GetNoticeListPosts[]; | ||
totalPages: number; | ||
} | ||
|
||
export interface GetNoticeListPosts { | ||
id: number; | ||
title: string; | ||
content: string; | ||
status: 'PUBLISHED'; | ||
createdDate: string; | ||
modifiedDate: string; | ||
views: number; | ||
} | ||
|
||
// 개별 게시글 조회 | ||
export interface GetNoticePostsRequest { | ||
id: number; | ||
} | ||
|
||
export interface GetNoticePostsResponse { | ||
code: number; | ||
message: string; | ||
data: GetNoticePostsData; | ||
} | ||
|
||
export interface GetNoticePostsData { | ||
title: string; | ||
content: string; | ||
status: string; | ||
createdDate: string; | ||
modifiedDate: string; | ||
views: number; | ||
} | ||
|
||
//post | ||
export interface PostNoticeRequest { | ||
title: string; | ||
content: string; | ||
status: 'PUBLISHED' | 'TEMP'; | ||
} | ||
|
||
export interface PostNoticeResponse { | ||
code: number; | ||
message: string; | ||
data: PostNoticeData; | ||
} | ||
|
||
export interface PostNoticeData { | ||
title: string; | ||
content: string; | ||
status: string; | ||
createdDate: string; | ||
modifiedDate: string; | ||
views: number; | ||
} | ||
|
||
export interface PostNoticeTempPostsRequest { | ||
title: string; | ||
content: string; | ||
} | ||
|
||
export interface PostNoticeTempPostsResponse { | ||
code: number; | ||
message: string; | ||
data: PostNoticeTempPostsData; | ||
} | ||
|
||
export interface PostNoticeTempPostsData { | ||
title: string; | ||
content: string; | ||
status: string; | ||
createdDate: string; | ||
modifiedDate: string; | ||
views: number; | ||
} | ||
|
||
export interface PostNoticePresignedURLRequest { | ||
filename: string; | ||
method: 'GET' | 'PUT'; | ||
} | ||
|
||
export interface PostNoticePresignedURLResponse { | ||
code: number; | ||
message: string; | ||
data: PostNoticePresignedURLData; | ||
} | ||
|
||
export interface PostNoticePresignedURLData { | ||
filename: string; | ||
preSignedUrl: string; | ||
} | ||
|
||
// put | ||
export interface PutNoticeRequest { | ||
id: number; | ||
title: string; | ||
content: string; | ||
status: string; | ||
} | ||
|
||
export interface PutNoticeResponse { | ||
code: number; | ||
message: string; | ||
data: PutNoticeData; | ||
} | ||
|
||
export interface PutNoticeData { | ||
title: string; | ||
content: string; | ||
status: string; | ||
createdDate: string; | ||
modifiedDate: string; | ||
views: number; | ||
} | ||
|
||
// delete | ||
export interface DeleteNoticeRequest { | ||
id: number; | ||
} | ||
|
||
// export interface DeleteNoticeResponse { | ||
// code: number; | ||
// } | ||
|
||
export interface NoticeBoardClient { | ||
listGet(request: GetNoticeListRequest): Promise<GetNoticeListResponse>; | ||
postsGet(request: GetNoticePostsRequest): Promise<GetNoticePostsResponse>; | ||
create(request: PostNoticeRequest): Promise<PostNoticeResponse>; | ||
tempSave(request: PostNoticeTempPostsRequest): Promise<PostNoticeTempPostsResponse>; | ||
Img(request: PostNoticePresignedURLRequest): Promise<PostNoticePresignedURLResponse>; | ||
revise(request: PutNoticeRequest): Promise<PutNoticeResponse>; | ||
delete(request: DeleteNoticeRequest): Promise<void>; | ||
} |
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
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
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
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,14 @@ | ||
import { PutRetrospectiveGroupBoardRequest, PutRetrospectiveGroupBoardResponse } from '../@types/Groups'; | ||
import axiosInstance from '@/api/axiosConfig'; | ||
|
||
export const putBoard = async ({ | ||
retrospectiveGroupId, | ||
...request | ||
}: PutRetrospectiveGroupBoardRequest): Promise<PutRetrospectiveGroupBoardResponse> => { | ||
try { | ||
const response = await axiosInstance.put(`/retrospectiveGroups/${retrospectiveGroupId}/boards`, request); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}; |
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
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,80 @@ | ||
import { | ||
GetNoticeListRequest, | ||
GetNoticeListResponse, | ||
NoticeBoardClient, | ||
PostNoticeRequest, | ||
PostNoticeResponse, | ||
PostNoticeTempPostsRequest, | ||
PostNoticeTempPostsResponse, | ||
PostNoticePresignedURLRequest, | ||
PostNoticePresignedURLResponse, | ||
PutNoticeResponse, | ||
DeleteNoticeRequest, | ||
GetNoticePostsRequest, | ||
GetNoticePostsResponse, | ||
} from '../@types/NoticeBoard'; | ||
import axiosInstance from '../axiosConfig'; | ||
|
||
const ROUTE = 'admin/notices'; | ||
|
||
export const NoticeServices: NoticeBoardClient = { | ||
listGet: async (request: GetNoticeListRequest): Promise<GetNoticeListResponse> => { | ||
try { | ||
const response = await axiosInstance.get<GetNoticeListResponse>(`/posts`, { params: request }); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
postsGet: async ({ id }: GetNoticePostsRequest): Promise<GetNoticePostsResponse> => { | ||
try { | ||
const response = await axiosInstance.get<GetNoticePostsResponse>(`/posts/${id}`); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
create: async (request: PostNoticeRequest): Promise<PostNoticeResponse> => { | ||
try { | ||
const response = await axiosInstance.post<PostNoticeResponse>(`${ROUTE}/posts`, request); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
tempSave: async (request: PostNoticeTempPostsRequest): Promise<PostNoticeTempPostsResponse> => { | ||
try { | ||
const response = await axiosInstance.post<PostNoticeTempPostsResponse>(`${ROUTE}/temp-posts`, request); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
Img: async (request: PostNoticePresignedURLRequest): Promise<PostNoticePresignedURLResponse> => { | ||
try { | ||
const response = await axiosInstance.post<PostNoticePresignedURLResponse>( | ||
`${ROUTE}/files/presigned-url`, | ||
request, | ||
); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
revise: async ({ id, ...request }): Promise<PutNoticeResponse> => { | ||
try { | ||
const response = await axiosInstance.put<PutNoticeResponse>(`${ROUTE}/posts/${id}`, request); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
delete: async ({ id }: DeleteNoticeRequest): Promise<void> => { | ||
try { | ||
const response = await axiosInstance.delete(`${ROUTE}/posts/${id}`); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}, | ||
}; |
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
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
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
Oops, something went wrong.