Skip to content

Commit 09ccab8

Browse files
committed
[#60] ✨ update community related types
1 parent d87c812 commit 09ccab8

File tree

1 file changed

+50
-9
lines changed

1 file changed

+50
-9
lines changed

src/types/community.types.d.ts

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,56 @@
11
export type CommunityCategory = 'SKILL' | 'CAREER' | 'OTHER'
22
export type CommunityLabelCategory = '기술' | '커리어' | '기타'
33

4-
export interface CommunityCreateRequest {
5-
communityCategory?: CommunityCategory
6-
communityTitle?: Title
7-
communityContent?: Content
8-
communityAI?: boolean // 아마 삭제 예정
4+
type CommunityBaseBody = {
5+
communityCategory: CommunityCategory
6+
communityTitle: string
7+
communityContent: string
98
}
109

11-
export interface CommunityUpdateRequest {
12-
communityCategory?: CommunityCategory
13-
communityTitle?: Title
14-
communityContent?: Content
10+
type CommunityTop5Member = {
11+
member: MemberInfo
12+
totalLikes: number
1513
}
14+
15+
interface CommunityListType extends PostBaseBody, CommunityBaseBody {}
16+
17+
interface CommunityDetail extends CommunityListDetail {
18+
isComment: boolean
19+
}
20+
/*
21+
path: '/v1/community'
22+
GET: 커뮤니티 글 전체 조회
23+
*/
24+
export type GetCommunityListResponse = CommunityListType
25+
/* POST: 커뮤니티 글 등록 */
26+
export interface CommunityCreateRequest extends CommunityBaseBody {
27+
isComment?: boolean // 답변 동의 여부
28+
}
29+
export interface CommunityCreateResponse extends CommunityBaseBody, TimeStamps {
30+
id: Id
31+
member: Id // 작성자 Id
32+
isComment: boolean
33+
}
34+
35+
/*
36+
path: '/v1/community/{id}'
37+
GET: 커뮤니티 글 상세 조회
38+
*/
39+
export type GetCommunityDetailResponse = CommunityDetail
40+
/* PATHCH: 커뮤니티 글 수정 */
41+
export type CommunityUpdateRequest = CommunityBaseBody
42+
export type CommunityUpdateResponse = CommunityCreateResponse
43+
/* DELETE: 커뮤니티 글 삭제
44+
반환 값:
45+
{
46+
"isSuccess": true,
47+
"code": "COMMON200",
48+
"message": "팀 모집글이 성공적으로 삭제되었습니다."
49+
}
50+
*/
51+
52+
/*
53+
path: '/v1/community/top5'
54+
GET: 인기 커뮤니티 Top5 유저 조회 (좋아요 순))
55+
*/
56+
export type GetCommunityTop5Response = CommunityTop5Member[]

0 commit comments

Comments
 (0)