Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Province Enum 입력 값에 대한 유연한 처리(제주, 제주도, 제주특별자치도 등) #242

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

xGreenNarae
Copy link
Contributor

작업 내용

  • Jackson의 @JsonCreator와 Converter 를 사용해서 처리했습니다.
  • DB에서 Province가 integer 타입으로 관리되고 있어서 @Enumetrated String 설정 추가했습니다(기존 데이터도 모두 변경)

Close #240 ,
Close #241

Copy link

github-actions bot commented Nov 5, 2023

Test Coverage Report

Overall Project 66.1% -0.49% 😞
Files changed 65.22% 😍

File Coverage
ProvinceConverter.java 100% 😍
EnumConverterConfiguration.java 100% 😍
ShelterAddress.java 87.05% 😍
Province.java 80.12% -19.88% 😍

제주특별자치도;
제주;

@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
Copy link
Contributor Author

@xGreenNarae xGreenNarae Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RequestBody 입력에 대해서는 @JsonCreator 를 타고 Deserialize 된다고 합니다.

@@ -22,6 +24,7 @@ public class ShelterAddress {
private double y;

@NotNull
@Enumerated(EnumType.STRING)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

대참사

@Override
public Province convert(final String source) {
return Province.fromJson(source);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RequestParam 입력에 대한 처리입니다. - 1

@Override
public void addFormatters(final FormatterRegistry registry) {
registry.addConverter(new ProvinceConverter());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RequestParam 입력에 대한 처리입니다. - 2

@xGreenNarae xGreenNarae merged commit 4ca2af5 into develop Nov 5, 2023
2 checks passed
@xGreenNarae xGreenNarae deleted the feat/#240 branch November 5, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant