Skip to content

Commit

Permalink
🐛 Fix : API 응답 이상 수정 (#173)
Browse files Browse the repository at this point in the history
result에 null 포함 시 필드 자체 사라지는 버그 수정
  • Loading branch information
CYY1007 authored Oct 8, 2023
1 parent d651f1a commit 24056c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class ResponseDto<T> {
@Schema(description = "응답 메시지", requiredMode = Schema.RequiredMode.REQUIRED, example = "요청에 성공하였습니다.")
private final String message;
@Schema(description = "응답 결과", requiredMode = Schema.RequiredMode.REQUIRED, example = "응답 결과")
@JsonInclude(JsonInclude.Include.NON_NULL)
private T result;


Expand All @@ -35,7 +34,8 @@ public static <T> ResponseDto<T> of(T result){
}

public static <T> ResponseDto<T> of(BaseCode code,T result){
return new ResponseDto<>(true, 2000 , code.getReasonHttpStatus().getMessage(), result);
ResponseDto<T> tResponseDto = new ResponseDto<>(true, code.getReasonHttpStatus().getCode(), code.getReasonHttpStatus().getMessage(), result);
return tResponseDto;
}

// 실패한 경우 응답 생성
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spring:
## # local redis
# redis:
# host: localhost

#
redis:
host: zipdabang-redis.osattk.ng.0001.apn2.cache.amazonaws.com
batch:
Expand Down

0 comments on commit 24056c2

Please sign in to comment.