From c906c6d88661c134d93fbf75910c76d1ace238c9 Mon Sep 17 00:00:00 2001 From: heejung0413 Date: Sun, 14 Apr 2024 16:53:21 +0900 Subject: [PATCH] =?UTF-8?q?Comment:=20comment=20api=20type=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(1=EC=B0=A8=20=EC=9E=91=EC=97=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/@types/Comment.ts | 49 ++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/src/api/@types/Comment.ts b/src/api/@types/Comment.ts index 2e45659..5e12045 100644 --- a/src/api/@types/Comment.ts +++ b/src/api/@types/Comment.ts @@ -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; + getComment(request: GetCommentRequest): Promise; + delete(request: DeleteCommentRequest): Promise; + getAllComment(): Promise; }