Skip to content

Commit

Permalink
feat: Modify CommentsResponseDto (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahyun0326 committed Mar 22, 2024
1 parent 30b7df8 commit 2091bac
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@

@Getter
public class CommentsResponseDto extends ResponseDto{
public CommentsResponseDto() {

private String name;
private String profileImageUrl;

public CommentsResponseDto(String name, String profileImageUrl) {
super(ResponseCode.SUCCESS, ResponseMessage.SUCCESS);
this.name = name;
this.profileImageUrl = profileImageUrl;
}

public static ResponseEntity<CommentsResponseDto> success() {
CommentsResponseDto result = new CommentsResponseDto();
public static ResponseEntity<CommentsResponseDto> success(String name, String profileImageUrl) {
CommentsResponseDto result = new CommentsResponseDto(name, profileImageUrl);
return ResponseEntity.status(HttpStatus.OK).body(result);
}

Expand All @@ -32,4 +38,9 @@ public static ResponseEntity<? super CommentsResponseDto> 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 2091bac

Please sign in to comment.