Skip to content

Commit

Permalink
Comment: comment api type 설정 (1차 작업)
Browse files Browse the repository at this point in the history
  • Loading branch information
heejung0413 committed Apr 14, 2024
1 parent b2063bb commit c906c6d
Showing 1 changed file with 41 additions and 8 deletions.
49 changes: 41 additions & 8 deletions src/api/@types/Comment.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
// 임시 API

export interface CommentRequest {
export interface GetCommentRequest {
id: string;
}

export interface CommentResponse {
id: string;
name: string;
text: string;
export interface GetCommentResponse {
code: number;
message: string;
data: {
id: number;
content: string;
};
}

//put
export interface PutCommentRequest {
id: number;
}

//delete
export interface DeleteCommentRequest {
id: number;
}

export interface DeleteCommentResponse {
code: number;
message: string;
data: object;
}

//GetAllComment
export interface AllGetCommentResponse {
code: number;
message: string;
data: CommentData[];
}

export interface CommentData {
id: number;
comment: string;
}

//Post

export interface CommentClient {
getComment(): Promise<CommentResponse>;
getComment(request: GetCommentRequest): Promise<GetCommentResponse>;
delete(request: DeleteCommentRequest): Promise<DeleteCommentResponse>;
getAllComment(): Promise<AllGetCommentResponse>;
}

0 comments on commit c906c6d

Please sign in to comment.