본문 바로가기

java25

Error Response 작업 ErrorResponse @Getter @EqualsAndHashCode public class ErrorResponse { private int code; @JsonIgnore private HttpStatus status; private String message; private T content; public ErrorResponse(ErrorCode errorCode, String status, T content) { this.code = errorCode.getCode(); this.status = errorCode.getStatus(); this.message = status; this.content = content; } public ErrorResponse(ErrorCode errorCod.. 2023. 9. 5.
Translation Error History 개요 Front End 에서 만든 GIMS 를 확인하는 도중, 15개씩 페이징이 되어야 하는데 마지막 페이지와 7페이지만 데이터의 숫자가 다른 걸 확인 KR,EN 의 다국어를 업로드 했는데 데이터의 숫자가 홀수로 확인 원인 1. 데이터 업로드 시 문제 기존 코드는 데이터를 파싱하여 Key 값을 기준으로 반복문이 돌며 Insert를 진행한다. 그러나 KR의 Value는 있지만 EN의 Value가 없는 경우 , 데이터가 EN 의 데이터가 들어가지 않아 데이터를 불러 올 시 페이징 처리 및 중간에 데이터가 꼬이는 현상이 발생하게 된다. 기존 코드 public ResponseResult createTranslations(TranslationsUploadRequest translationsUploadRequest.. 2023. 8. 22.
i18N 다국어 API 개발 Internationalization의 축약형 국제화, Internationalization은 알파벳이 20개인데, 가장 마지막 글자인 n 사이에 알파벳이 18개가 있다고 하여 i18n 이라 한다. Front End 에서 주는 JsonData 의 값은 { "content": [ { "Key": "common.button.confirm", "ko-KR": "확인", "en-US": "Confirm" }, { "Key": "common.button.delete", "ko-KR": "삭제", "en-US": "Delete" }, { "Key": "common.button.register", "ko-KR": "등록", "en-US": "Register" }, { "Key": "common.button.list".. 2023. 8. 14.
Request Test Create 기능을 개발하기 위해 Request를 개발했는데 여러가지 어노테이션이 많이 적용되서 이걸 테스트해보고 싶어졌다. 예시로 현재 개발한 DmCodeRequest를 보면 @Getter @Setter @NoArgsConstructor(access = AccessLevel.PROTECTED) public class DmCodeRequest { @Schema(description = "DM 코드" ,example = "string") @NotBlank @NotNull @Pattern(regexp = "^(?!.*\\s)[A-Za-z0-9@$!%*#?&]+$", message="올바르지 않은 정규식 입니다.") @Size(max = 30) private String dmCode; @Schema(descr.. 2023. 8. 1.