-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: User 도메인 마이그레이션 #79
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
Changes from 11 commits
b0ab6da
5e5f432
5b161ad
99b3d45
69d8ce1
3b4f76c
fdf8b2d
5965034
ceedadb
ed9b459
2731a86
1e24df8
b8530a8
b432337
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package land.leets.domain.user.domain | ||
|
|
||
| import jakarta.persistence.* | ||
| import land.leets.domain.shared.BaseTimeEntity | ||
| import java.util.UUID | ||
|
|
||
| @Entity(name = "users") | ||
| class User( | ||
| @Column | ||
| var sid: String?, | ||
|
|
||
| @Column(nullable = false) | ||
| val name: String, | ||
|
|
||
| @Column | ||
| var phone: String?, | ||
|
|
||
| @Column(nullable = false) | ||
| val email: String, | ||
|
|
||
| @Column(nullable = false) | ||
| val sub: String, | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.UUID) | ||
| @Column(columnDefinition = "BINARY(16)") | ||
| val uid: UUID? = null | ||
| ) : BaseTimeEntity() { | ||
|
|
||
| fun updateUserInfo(sid: String?, phone: String) { | ||
| this.sid = sid | ||
| this.phone = phone | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package land.leets.domain.user.domain.repository | ||
|
|
||
| import land.leets.domain.user.domain.User | ||
| import org.springframework.data.jpa.repository.JpaRepository | ||
| import java.util.Optional | ||
| import java.util.UUID | ||
|
|
||
| interface UserRepository : JpaRepository<User, UUID> { | ||
| fun findBySub(sub: String): Optional<User> | ||
| fun findByEmail(email: String): Optional<User> | ||
| fun findByUid(uid: UUID): Optional<User> | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package land.leets.domain.user.exception | ||
|
|
||
| import land.leets.global.error.ErrorCode | ||
| import land.leets.global.error.exception.ServiceException | ||
|
|
||
| class UserNotFoundException : ServiceException(ErrorCode.USER_NOT_FOUND) |
Uh oh!
There was an error while loading. Please reload this page.