Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FO-1025] 생년월일, 성별 정보 선택사항으로 변경 #432

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading