-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#155 [fix] Content Type, Json 으로 나눠서 받을 수 있도록 API 수정
- Loading branch information
Showing
11 changed files
with
35 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/main/java/com/moddy/server/controller/model/dto/request/ModelApplicationRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
src/main/java/com/moddy/server/controller/model/dto/request/ModelHairServiceRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.moddy.server.controller.model.dto.request; | ||
|
||
import com.moddy.server.domain.hair_service_record.ServiceRecord; | ||
import com.moddy.server.domain.hair_service_record.ServiceRecordTerm; | ||
|
||
public record ModelHairServiceRequest( | ||
String hairService, | ||
String hairServiceTerm | ||
ServiceRecord hairService, | ||
ServiceRecordTerm hairServiceTerm | ||
) { | ||
} |
46 changes: 0 additions & 46 deletions
46
src/main/java/com/moddy/server/controller/model/dto/requestEditor/ListPropertyEditor.java
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/main/java/com/moddy/server/domain/day_off/DayOfWeek.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
package com.moddy.server.domain.day_off; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.moddy.server.common.exception.enums.ErrorCode; | ||
import com.moddy.server.common.exception.model.BadRequestException; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.stream.Stream; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum DayOfWeek { | ||
MON("월"), TUE("화"), WED("수"), THU("목"), FRI("금"), SAT("토"), SUN("일"); | ||
|
||
private final String value; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
public static DayOfWeek findByDayOfWeek(String dayOfWeek) { | ||
return Stream.of(DayOfWeek.values()) | ||
.filter(c -> c.name().equals(dayOfWeek)) | ||
.findFirst() | ||
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_DAY_OF_WEEK_EXCEPTION)); | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
src/main/java/com/moddy/server/domain/hair_model_application/HairLength.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
package com.moddy.server.domain.hair_model_application; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.moddy.server.common.exception.enums.ErrorCode; | ||
import com.moddy.server.common.exception.model.BadRequestException; | ||
import com.moddy.server.domain.user.Gender; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.stream.Stream; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public enum HairLength { | ||
SHORT("숏"), ABOVE_SHOULDER("단발"), UNDER_SHOULDER("어깨 아래"), UNDER_WAIST("허리 아래"); | ||
|
||
private final String value; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
public static HairLength findByHairLength(String hairLength) { | ||
return Stream.of(HairLength.values()) | ||
.filter(c -> c.name().equals(hairLength)) | ||
.findFirst() | ||
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_HAIR_LENGTH_EXCEPTION)); | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
package com.moddy.server.domain.hair_service_record; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.moddy.server.common.exception.enums.ErrorCode; | ||
import com.moddy.server.common.exception.model.BadRequestException; | ||
import com.moddy.server.domain.hair_model_application.HairLength; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.stream.Stream; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum ServiceRecord { | ||
PERM("펌"), DECOLOR("탈색"), BLACK("블랙 염색"), COLOR("컬러 염색"); | ||
|
||
private final String value; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
public static ServiceRecord findByServiceRecord(String serviceRecord) { | ||
return Stream.of(ServiceRecord.values()) | ||
.filter(c -> c.name().equals(serviceRecord)) | ||
.findFirst() | ||
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_HAIR_SERVICE_RECORD_EXCEPTION)); | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecordTerm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
package com.moddy.server.domain.hair_service_record; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.moddy.server.common.exception.enums.ErrorCode; | ||
import com.moddy.server.common.exception.model.BadRequestException; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.stream.Stream; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum ServiceRecordTerm { | ||
UNDER_ONE("1 개월 미만"), ONE_THREE("1 - 3 개월"), FOUR_SIX("4 - 6 개월"), SEVEN_TWELVE("7 - 12 개월"), ABOVE_TWELVE("12 개월 초과"); | ||
|
||
private final String value; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
public static ServiceRecordTerm findByServiceRecord(String serviceRecordTerm) { | ||
return Stream.of(ServiceRecordTerm.values()) | ||
.filter(c -> c.name().equals(serviceRecordTerm)) | ||
.findFirst() | ||
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_HAIR_SERVICE_RECORD_TERM_EXCEPTION)); | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
src/main/java/com/moddy/server/domain/prefer_hair_style/HairStyle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
package com.moddy.server.domain.prefer_hair_style; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.moddy.server.common.exception.enums.ErrorCode; | ||
import com.moddy.server.common.exception.model.BadRequestException; | ||
import com.moddy.server.domain.hair_model_application.HairLength; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.stream.Stream; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public enum HairStyle { | ||
NORMAL_CUT("일반 커트"), ALL_COLOR("전체 염색"), ALL_DECOLOR("전체 탈색"), SETTING_PERM("셋팅펌"), NORMAL_PERM("일반펌"), STRAIGHTENING("매직"); | ||
|
||
private final String value; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
public static HairStyle findByHairStyle(String hairStyle) { | ||
return Stream.of(HairStyle.values()) | ||
.filter(c -> c.name().equals(hairStyle)) | ||
.findFirst() | ||
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_HAIR_STYLE_EXCEPTION)); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,13 @@ | ||
package com.moddy.server.domain.user; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.moddy.server.common.exception.enums.ErrorCode; | ||
import com.moddy.server.common.exception.model.BadRequestException; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.stream.Stream; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum Gender { | ||
MALE("남성"), FEMALE("여성"); | ||
private final String value; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
public static Gender findByGender(String gender) { | ||
return Stream.of(Gender.values()) | ||
.filter(c -> c.name().equals(gender)) | ||
.findFirst() | ||
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_GENDER_EXCEPTION)); | ||
} | ||
private final String value; | ||
} |
Oops, something went wrong.