Skip to content

Commit

Permalink
[FIX] API Enum 관련 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Jan 16, 2024
1 parent 1f68635 commit de79b93
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,31 +187,31 @@ public static Application create(ApplicationCreateRequest request, User user, in
.gender(Gender.DEFAULT)
.major(request.major())
.multiMajor(request.multiMajor())
.part(ApplyPart.valueOf(request.part()))
.part(ApplyPart.of(request.part()))
.name("")
.phone(request.phone())
.semester(Semester.valueOf(request.semester()))
.semester(Semester.of(request.semester()))
.studentNumber(null)
.user(user)
.generation(generation)
.pathToKnow(PathType.valueOf(request.pathToKnow()))
.pathToKnow(PathType.of(request.pathToKnow()))
.build();
}

public void updateApplicationPage1(ApplicationPage1Request request) {
validateSubmitStatus();
this.email = request.email();
this.gender = Gender.valueOf(request.gender());
this.gender = Gender.of(request.gender());
this.major = request.major();
this.multiMajor = request.multiMajor();
this.part = ApplyPart.valueOf(request.part());
this.part = ApplyPart.of(request.part());
this.name = request.name();
this.phone = request.phone();
this.semester = Semester.valueOf(request.semester());
this.semester = Semester.of(request.semester());
this.studentNumber = request.studentNumber();
this.isPersonalInformationAgreed = request.isAgreed();

if (ApplyPart.valueOf(request.part()) == ApplyPart.PM) {
if (ApplyPart.of(request.part()) == ApplyPart.PM) {
this.partAnswer1Limit = PLAN_PART_ANSWER_LIMIT;
this.partAnswer2Limit = PLAN_PART_ANSWER_LIMIT;
this.partAnswer3Limit = PLAN_PART_ANSWER_LIMIT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ public enum ApplyPart {
DESIGN("디자인"),
PM("기획");
private final String name;

public static ApplyPart of(String name) {
for (ApplyPart applyPart : ApplyPart.values()) {
if (applyPart.name.equals(name)) {
return applyPart;
}
}
return DEFAULT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ public enum Gender {
F("female");

private final String name;

public static Gender of(String name) {
for (Gender gender : Gender.values()) {
if (gender.name.equals(name)) {
return gender;
}
}
return DEFAULT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ public enum PathType {
ETC("기타");

private final String name;

public static PathType of(String name) {
for (PathType pathType : PathType.values()) {
if (pathType.name.equals(name)) {
return pathType;
}
}
return ETC;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ public enum Semester {

private final String name;

public static Semester of(String name) {
for (Semester semester : Semester.values()) {
if (semester.name.equals(name)) {
return semester;
}
}
return DEFAULT;
}

}

0 comments on commit de79b93

Please sign in to comment.