diff --git a/server/src/main/kotlin/com/fone/user/domain/entity/User.kt b/server/src/main/kotlin/com/fone/user/domain/entity/User.kt index 15abef3a..b3f1fe2a 100644 --- a/server/src/main/kotlin/com/fone/user/domain/entity/User.kt +++ b/server/src/main/kotlin/com/fone/user/domain/entity/User.kt @@ -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 = "", diff --git a/server/src/main/kotlin/com/fone/user/presentation/dto/SignUpUserDto.kt b/server/src/main/kotlin/com/fone/user/presentation/dto/SignUpUserDto.kt index fe0b8109..e092f9ca 100644 --- a/server/src/main/kotlin/com/fone/user/presentation/dto/SignUpUserDto.kt +++ b/server/src/main/kotlin/com/fone/user/presentation/dto/SignUpUserDto.kt @@ -24,8 +24,8 @@ data class SocialSignUpUserRequest( @field:NotNull(message = "직업은 필수 값 입니다.") val job: Job, @field:Size(min = 1, message = "관심사는 1개 이상 선택 되어야 합니다") val interests: List, @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( @@ -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() }, @@ -85,8 +86,8 @@ data class EmailSignUpUserRequest( @field:Size(min = 1, message = "관심사는 1개 이상 선택 되어야 합니다") val interests: List, @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( @@ -140,7 +141,6 @@ data class SignUpUserResponse( val user: UserDto, val token: Token, ) { - constructor( user: User, token: Token, diff --git a/server/src/main/kotlin/com/fone/user/presentation/dto/common/UserDto.kt b/server/src/main/kotlin/com/fone/user/presentation/dto/common/UserDto.kt index 7add7ff8..e568beae 100644 --- a/server/src/main/kotlin/com/fone/user/presentation/dto/common/UserDto.kt +++ b/server/src/main/kotlin/com/fone/user/presentation/dto/common/UserDto.kt @@ -13,7 +13,7 @@ data class UserDto( val interests: List, val nickname: String, val birthday: LocalDate?, - val gender: Gender, + val gender: Gender?, val profileUrl: String, val phoneNumber: String, val email: String, @@ -25,7 +25,6 @@ data class UserDto( val enabled: Boolean, val isVerified: Boolean, ) { - constructor( user: User, ) : this(