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

[refactor]: 유저 조회 API 관련 수정 #96

Merged
merged 3 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ public static UserResponseDTO.UserDetailDTO toUserDetailDTO(User user){
public static UserResponseDTO.UserInformationResponseDTO toUserInformationResponseDTO(User user){
return UserResponseDTO.UserInformationResponseDTO.builder()
.nickname(user.getNickname())
.experienceYear(user.getExperienceYear())
.fieldOfWork(user.getFieldOfWork())
.experienceYear(user.getExperienceYear().getMypageValue())
.fieldOfWork(user.getFieldOfWork().getValue())
.job(user.getJob())
.build();
}
public static UserResponseDTO.UserModificationResponseDTO toUserModificationResponseDTO(User user){
return UserResponseDTO.UserModificationResponseDTO.builder()
.nickname(user.getNickname())
.experienceYear(user.getExperienceYear().getValue())
.experienceYear(user.getExperienceYear().getMypageValue())
.fieldOfWork(user.getFieldOfWork().getValue())
.job(user.getJob())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static List<String> getAllField() {
public static class ExperienceYearResponseDTO{
public static List<String> getAllExperience() {
return Arrays.stream(ExperienceYear.values())
.map(ExperienceYear::getValue)
.map(ExperienceYear::getSignupValue)
.collect(Collectors.toList());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public static class UserDetailDTO{
@AllArgsConstructor
public static class UserInformationResponseDTO {
private String nickname;
private FieldOfWork fieldOfWork;
private ExperienceYear experienceYear;
private String fieldOfWork;
private String experienceYear;
private String job;
}
@Builder
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
@Getter
public enum ExperienceYear {

THE_NEW("신입"),
THE_FIRST_YEAR("1년 이상 2년 미만"),
THE_SECOND_YEAR("2년 이상 3년 미만"),
THE_THIRD_YEAR("3년 이상 4년 미만"),
THE_FOURTH_YEAR("4년 이상 5년 미만"),
THE_FIFTH_YEAR_OR_MORE("5년 이상"),
THE_SENIOR("시니어");
private final String value;
THE_NEW("신입", "신입"),
THE_FIRST_YEAR("1년 이상 2년 미만", "1년차"),
THE_SECOND_YEAR("2년 이상 3년 미만", "2년차"),
THE_THIRD_YEAR("3년 이상 4년 미만", "3년차"),
THE_FOURTH_YEAR("4년 이상 5년 미만", "4년차"),
THE_FIFTH_YEAR_OR_MORE("5년 이상", "5년차"),
THE_SENIOR("시니어", "시니어");
private final String signupValue;
private final String mypageValue;

public static ExperienceYear fromValue(String value) {
for (ExperienceYear experienceYear : ExperienceYear.values()) {
if (experienceYear.getValue().equals(value)) {
if (experienceYear.getSignupValue().equals(value)) {
return experienceYear;
}
}
Expand Down
Loading