-
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.
feat(#53): converted user dto v1 classes java to kotlin
- Loading branch information
1 parent
5f8c0fc
commit 19b594b
Showing
10 changed files
with
107 additions
and
144 deletions.
There are no files selected for viewing
35 changes: 0 additions & 35 deletions
35
archive-application/src/main/java/site/archive/dto/v1/user/BaseUserDtoV1.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
archive-application/src/main/java/site/archive/dto/v1/user/BaseUserDtoV1.kt
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,35 @@ | ||
package site.archive.dto.v1.user | ||
|
||
import site.archive.common.dateTimeFormatter | ||
import site.archive.domain.user.BaseUser | ||
import site.archive.domain.user.UserRole | ||
import java.time.LocalDateTime | ||
|
||
data class BaseUserDtoV1( | ||
val userId: Long, | ||
val mailAddress: String, | ||
val userRole: UserRole, | ||
val profileImage: String, | ||
val nickname: String, | ||
private val createdAt: LocalDateTime | ||
) { | ||
|
||
fun getCreatedAt(): String { | ||
return dateTimeFormatter.format(createdAt) | ||
} | ||
|
||
companion object { | ||
@JvmStatic | ||
fun from(baseUser: BaseUser): BaseUserDtoV1 { | ||
return BaseUserDtoV1( | ||
userId = baseUser.id, | ||
mailAddress = baseUser.mailAddress, | ||
userRole = baseUser.role, | ||
createdAt = baseUser.createdAt, | ||
profileImage = baseUser.profileImage, | ||
nickname = baseUser.nickname | ||
) | ||
} | ||
} | ||
|
||
} |
23 changes: 0 additions & 23 deletions
23
archive-application/src/main/java/site/archive/dto/v1/user/OAuthRegisterRequestDtoV1.java
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
archive-application/src/main/java/site/archive/dto/v1/user/OAuthRegisterRequestDtoV1.kt
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,8 @@ | ||
package site.archive.dto.v1.user | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
|
||
data class OAuthRegisterRequestDtoV1( | ||
val provider: String, | ||
@field: JsonProperty("providerAccessToken") val token: String | ||
) |
32 changes: 0 additions & 32 deletions
32
archive-application/src/main/java/site/archive/dto/v1/user/SpecificUserDtoV1.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
archive-application/src/main/java/site/archive/dto/v1/user/SpecificUserDtoV1.kt
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,33 @@ | ||
package site.archive.dto.v1.user | ||
|
||
import site.archive.common.dateTimeFormatter | ||
import site.archive.domain.user.BaseUser | ||
import site.archive.domain.user.UserRole | ||
|
||
data class SpecificUserDtoV1( | ||
val userId: Long, | ||
val mailAddress: String, | ||
val userRole: UserRole, | ||
val createdAt: String, | ||
val profileImage: String, | ||
val nickname: String, | ||
val userType: String | ||
) { | ||
|
||
companion object { | ||
@JvmStatic | ||
fun from(baseUser: BaseUser) : SpecificUserDtoV1 { | ||
val createdAt = dateTimeFormatter.format(baseUser.createdAt) | ||
return SpecificUserDtoV1( | ||
userId = baseUser.id, | ||
mailAddress = baseUser.mailAddress, | ||
userRole = baseUser.role, | ||
createdAt = createdAt, | ||
profileImage = baseUser.profileImage, | ||
nickname = baseUser.nickname, | ||
userType = baseUser.userType | ||
) | ||
} | ||
} | ||
|
||
} |
21 changes: 0 additions & 21 deletions
21
archive-application/src/main/java/site/archive/dto/v1/user/UserEmailRequestDtoV1.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
archive-application/src/main/java/site/archive/dto/v1/user/UserEmailRequestDtoV1.kt
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,10 @@ | ||
package site.archive.dto.v1.user | ||
|
||
import jakarta.validation.constraints.Email | ||
import jakarta.validation.constraints.NotBlank | ||
|
||
data class UserEmailRequestDtoV1( | ||
@field: NotBlank(message = "์ด๋ฉ์ผ์ ํ์ ์ ๋ ฅ ํญ๋ชฉ์ ๋๋ค.") | ||
@field: Email(message = "์ฌ๋ฐ๋ฅธ ์ด๋ฉ์ผ์ ์ ๋ ฅํด ์ฃผ์ธ์.") | ||
val email: String | ||
) |
33 changes: 0 additions & 33 deletions
33
...ive-application/src/main/java/site/archive/dto/v1/user/UserPasswordResetRequestDtoV1.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
archive-application/src/main/java/site/archive/dto/v1/user/UserPasswordResetRequestDtoV1.kt
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,21 @@ | ||
package site.archive.dto.v1.user | ||
|
||
import jakarta.validation.constraints.Email | ||
import jakarta.validation.constraints.NotBlank | ||
import jakarta.validation.constraints.Pattern | ||
|
||
data class UserPasswordResetRequestDtoV1( | ||
@field: NotBlank(message = "์ด๋ฉ์ผ์ ํ์ ์ ๋ ฅ ํญ๋ชฉ์ ๋๋ค.") | ||
@field: Email(message = "์ฌ๋ฐ๋ฅธ ์ด๋ฉ์ผ์ ์ ๋ ฅํด ์ฃผ์ธ์.") | ||
val email: String, | ||
|
||
@field: NotBlank(message = "ํ์ฌ ๋น๋ฐ๋ฒํธ๋ ํ์ ์ ๋ ฅ ํญ๋ชฉ์ ๋๋ค.") | ||
val currentPassword: String, | ||
|
||
@field: NotBlank(message = "์๋ก์ด ๋น๋ฐ๋ฒํธ๋ ํ์ ์ ๋ ฅ ํญ๋ชฉ์ ๋๋ค.") | ||
@field: Pattern( | ||
regexp = "(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9@$!%*#?&]{8,20}$", | ||
message = "๋น๋ฐ๋ฒํธ๋ ์๋ฌธ/์ซ์ ๋ฅผ ๊ผญ ํฌํจํ์ฌ 8~20์๋ฆฌ๋ก ์ ๋ ฅํด ์ฃผ์ธ์." | ||
) | ||
val newPassword: String | ||
) |