From 30b7df82346150a95ad6d2b881ef68a885bf4111 Mon Sep 17 00:00:00 2001 From: Yeseo Date: Fri, 22 Mar 2024 14:05:47 +0900 Subject: [PATCH] feat: Add DeleteCommentsResponseDto (#31) --- .../comments/DeleteCommentsResponseDto.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/main/java/com/beotkkot/qtudy/dto/response/comments/DeleteCommentsResponseDto.java diff --git a/src/main/java/com/beotkkot/qtudy/dto/response/comments/DeleteCommentsResponseDto.java b/src/main/java/com/beotkkot/qtudy/dto/response/comments/DeleteCommentsResponseDto.java new file mode 100644 index 0000000..d623266 --- /dev/null +++ b/src/main/java/com/beotkkot/qtudy/dto/response/comments/DeleteCommentsResponseDto.java @@ -0,0 +1,40 @@ +package com.beotkkot.qtudy.dto.response.comments; + +import com.beotkkot.qtudy.common.ResponseCode; +import com.beotkkot.qtudy.common.ResponseMessage; +import com.beotkkot.qtudy.dto.response.ResponseDto; +import lombok.Getter; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +@Getter +public class DeleteCommentsResponseDto extends ResponseDto{ + public DeleteCommentsResponseDto() { + super(ResponseCode.SUCCESS, ResponseMessage.SUCCESS); + } + + public static ResponseEntity success() { + DeleteCommentsResponseDto result = new DeleteCommentsResponseDto(); + return ResponseEntity.status(HttpStatus.OK).body(result); + } + + public static ResponseEntity notExistedPost(){ + ResponseDto result = new ResponseDto(ResponseCode.NOT_EXISTED_POST, ResponseMessage.NOT_EXISTED_POST); + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result); + } + + public static ResponseEntity notExistedUser() { + ResponseDto result = new ResponseDto(ResponseCode.NOT_EXISTED_USER, ResponseMessage.NOT_EXISTED_USER); + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result); + } + + public static ResponseEntity notExistedComment() { + ResponseDto result = new ResponseDto(ResponseCode.NOT_EXISTED_COMMENT, ResponseMessage.NOT_EXISTED_COMMENT); + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result); + } + + public static ResponseEntity noPermission() { + ResponseDto result = new ResponseDto(ResponseCode.NO_PERMISSION, ResponseMessage.NO_PERMISSION); + return ResponseEntity.status(HttpStatus.FORBIDDEN).body(result); + } +}