Skip to content

Commit

Permalink
[FO-1025] 생년월일, 성별 정보 선택사항으로 변경 (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
DoodlesOnMyFood authored Mar 30, 2024
1 parent b2b1807 commit 3d1d848
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion server/src/main/kotlin/com/fone/user/domain/entity/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data class User(
@Column var name: String = "",
@Column var nickname: String = "",
@Column var birthday: LocalDate? = null,
@Enumerated(EnumType.STRING) val gender: Gender = Gender.MAN,
@Enumerated(EnumType.STRING) val gender: Gender? = null,
@Column(length = 300) var profileUrl: String = "",
@Column(unique = true) var phoneNumber: String? = "",
@Column var email: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ data class SocialSignUpUserRequest(
@field:NotNull(message = "직업은 필수 값 입니다.") val job: Job,
@field:Size(min = 1, message = "관심사는 1개 이상 선택 되어야 합니다") val interests: List<CategoryType>,
@field:NotEmpty(message = "닉네임은 필수 값 입니다.") val nickname: String,
@DateTimeFormat(pattern = "yyyy-MM-dd") val birthday: LocalDate,
@field:NotNull(message = "성별은 필수 값 입니다.") val gender: Gender,
@DateTimeFormat(pattern = "yyyy-MM-dd") val birthday: LocalDate?,
val gender: Gender?,
val profileUrl: String?,
@field:Pattern(regexp = "^\\d{2,3}-\\d{3,4}-\\d{4}\$")
@ApiModelProperty(
Expand All @@ -50,10 +50,11 @@ data class SocialSignUpUserRequest(
) {
fun toEntity(): User {
loginTypeAssertion()
val identifier = when (loginType) {
LoginType.APPLE -> identifier
else -> email
} ?: throw ServerWebInputException("애플의 경우 identifier가 명시되어 있어야함")
val identifier =
when (loginType) {
LoginType.APPLE -> identifier
else -> email
} ?: throw ServerWebInputException("애플의 경우 identifier가 명시되어 있어야함")
return User(
job = job,
interests = interests.map { it.toString() },
Expand Down Expand Up @@ -85,8 +86,8 @@ data class EmailSignUpUserRequest(
@field:Size(min = 1, message = "관심사는 1개 이상 선택 되어야 합니다") val interests: List<CategoryType>,
@field:NotEmpty(message = "이름은 필수 값 입니다.") val name: String,
@field:NotEmpty(message = "닉네임은 필수 값 입니다.") val nickname: String,
@DateTimeFormat(pattern = "yyyy-MM-dd") val birthday: LocalDate,
@field:NotNull(message = "성별은 필수 값 입니다.") val gender: Gender,
@DateTimeFormat(pattern = "yyyy-MM-dd") val birthday: LocalDate?,
val gender: Gender?,
val profileUrl: String?,
@field:Pattern(regexp = "^\\d{2,3}-\\d{3,4}-\\d{4}\$")
@ApiModelProperty(
Expand Down Expand Up @@ -140,7 +141,6 @@ data class SignUpUserResponse(
val user: UserDto,
val token: Token,
) {

constructor(
user: User,
token: Token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class UserDto(
val interests: List<CategoryType>,
val nickname: String,
val birthday: LocalDate?,
val gender: Gender,
val gender: Gender?,
val profileUrl: String,
val phoneNumber: String,
val email: String,
Expand All @@ -25,7 +25,6 @@ data class UserDto(
val enabled: Boolean,
val isVerified: Boolean,
) {

constructor(
user: User,
) : this(
Expand Down

0 comments on commit 3d1d848

Please sign in to comment.