-
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.
Merge branch 'master' into feat/certification
- Loading branch information
Showing
6 changed files
with
135 additions
and
3 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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/kukerton/dto/request/OnboardingRequest.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.kukerton.dto.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.kukerton.global.enums.Category; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class OnboardingRequest{ | ||
|
||
@JsonProperty("user_id") | ||
@NotNull(message = "사용자 ID는 필수 항목입니다.") | ||
@Positive(message = "사용자 ID는 음수일 수 없습니다.") | ||
Long user_id; | ||
|
||
@NotNull(message = "interested_categories는 필수 항목입니다.") | ||
List<String> interested_categories; | ||
|
||
@NotNull(message = "restrained_categories는 필수 항목입니다.") | ||
List<String> restrained_categories; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.kukerton.global.enums; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum Category { | ||
|
||
SELF_IMPROVEMENT("자기계발"), | ||
WORKOUT("운동"), | ||
ACTIVITY("액티비티"), | ||
NIGHT_EATING("야식"), | ||
MUSIC("음악"), | ||
GAME("게임"), | ||
WATCHING_MEDIA("미디어 시청"), | ||
OUTGOING("외출"), | ||
CLEANING("청결(청소)"), | ||
ETC("기타"), | ||
DRINKING_AND_SMOKING("음주&흡연"), | ||
DELIVERY_FOOD("배달음식"), | ||
IMPULSE_BUYING("충동구매"), | ||
CAFFEINE("카페인"), | ||
OVERSPENDING("과소비"); | ||
|
||
private String category; | ||
|
||
Category(String category){ | ||
this.category = category; | ||
} | ||
|
||
public static Category fromRequest(String category){ | ||
for(Category e : Category.values()){ | ||
if(e.category.equals(category)) | ||
return e; | ||
} | ||
return null; | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/kukerton/global/exception/OnboardingException.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.kukerton.global.exception; | ||
|
||
import com.kukerton.global.enums.MemberErrorCode; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class OnboardingException extends RuntimeException{ | ||
private final MemberErrorCode errorCode; | ||
|
||
public OnboardingException(MemberErrorCode errorCode) { | ||
super(errorCode.getErrorMessage()); | ||
this.errorCode = errorCode; | ||
} | ||
} |
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