Skip to content

Commit

Permalink
feat: Add DeleteCommentsResponseDto (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahyun0326 committed Mar 22, 2024
1 parent be65c41 commit 30b7df8
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<DeleteCommentsResponseDto> success() {
DeleteCommentsResponseDto result = new DeleteCommentsResponseDto();
return ResponseEntity.status(HttpStatus.OK).body(result);
}

public static ResponseEntity<ResponseDto> notExistedPost(){
ResponseDto result = new ResponseDto(ResponseCode.NOT_EXISTED_POST, ResponseMessage.NOT_EXISTED_POST);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result);
}

public static ResponseEntity<ResponseDto> notExistedUser() {
ResponseDto result = new ResponseDto(ResponseCode.NOT_EXISTED_USER, ResponseMessage.NOT_EXISTED_USER);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result);
}

public static ResponseEntity<? super DeleteCommentsResponseDto> notExistedComment() {
ResponseDto result = new ResponseDto(ResponseCode.NOT_EXISTED_COMMENT, ResponseMessage.NOT_EXISTED_COMMENT);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result);
}

public static ResponseEntity<ResponseDto> noPermission() {
ResponseDto result = new ResponseDto(ResponseCode.NO_PERMISSION, ResponseMessage.NO_PERMISSION);
return ResponseEntity.status(HttpStatus.FORBIDDEN).body(result);
}
}

0 comments on commit 30b7df8

Please sign in to comment.