feature: 사용자 로그인 계정 모델과 저장소 추가 - #8
Conversation
🧪 테스트 결과
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf4f05d242
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import jakarta.persistence.Table | ||
|
|
||
| @Entity | ||
| @Table(name = "login_account") |
There was a problem hiding this comment.
application-dev.yml과 application-prod.yml은 ddl-auto: validate를 사용하지만, 대상 커밋에는 이 테이블들을 만드는 Flyway/Liquibase/SQL 마이그레이션이 없습니다. 새 환경 또는 아직 login_account 테이블이 없는 배포 DB에서 애플리케이션을 시작하면 Hibernate의 스키마 검증이 실패하여 기동하지 못합니다. UserEntity 테이블을 포함해 이 변경으로 추가된 스키마를 생성하는 마이그레이션을 함께 추가해야 합니다.
Useful? React with 👍 / 👎.
| @field:Column(name = "provider_id", nullable = false, length = 255) | ||
| var providerId: String, |
There was a problem hiding this comment.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d1b3c503e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 077a2c37f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| companion object { | ||
| fun fromDomain(user: User): UserEntity = | ||
| UserEntity(nickname = user.nickname) | ||
| } |
There was a problem hiding this comment.
이미 저장된 User를 toDomain()으로 읽어 닉네임을 변경한 뒤 UserEntity.fromDomain()으로 다시 저장하는 흐름에서는 user.id가 이 Entity에 전달되지 않아 ID가 항상 null입니다. 따라서 JpaRepository.save()가 기존 행 갱신 대신 새 행을 삽입하여 사용자가 중복 생성됩니다. 현재 테스트도 이 문제를 피해 조회한 Entity를 직접 수정하고 있으므로, 도메인 변환을 사용하는 Service에서는 막아주지 못합니다.
Useful? React with 👍 / 👎.
|
|
||
| companion object { | ||
| fun fromDomain(loginAccount: LoginAccount): LoginAccountEntity = | ||
| LoginAccountEntity( |
There was a problem hiding this comment.
저장된 LoginAccount를 도메인으로 변환해 changeProvider()를 호출한 뒤 LoginAccountEntity.fromDomain()으로 저장하면 loginAccount.id가 버려져 새 Entity가 만들어집니다. 이 경우 제공자 변경이 기존 로그인 계정을 갱신하지 않고 새 행을 삽입하므로, 동일 사용자에게 이전 제공자 계정과 변경 후 계정이 함께 남습니다. 테스트가 Entity의 필드를 직접 수정하는 방식이라 이 변환 경로의 중복 저장을 검증하지 못합니다.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 727cd5df40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| private fun validateNickname(nickname: String) { | ||
| require(nickname.length in MIN_NICKNAME_LENGTH..MAX_NICKNAME_LENGTH) { |
📌 작업 개요
사용자와 로그인 계정 도메인·JPA Entity·Repository를 추가하고, 로컬 PostgreSQL 개발 환경을 구성했습니다.
🔖 PR 유형
📝 변경 사항
User,LoginAccount,LoginProvider도메인 모델과 Entity 변환을 추가했습니다.UserRepository,LoginAccountRepository와 각각의 CRUD 통합 테스트를 추가했습니다.fromDomain()변환 시 기존 Entity ID를 보존하도록 수정했습니다.local프로필 접속 설정을 추가했습니다.APPLE을 추가했습니다.🔗 관련 이슈
✅ 테스트 / 확인 방법
./gradlew check통과UserRepositoryTest,LoginAccountRepositoryTest통과docker compose up -d postgres실행 후local프로필 애플리케이션 시작 확인💬 리뷰어에게
LoginAccount는 생성 이후 변경하지 않으며, 생성 시provider_id를 DB 컬럼 길이와 같은 최대 255자로 검증합니다.LoginAccountEntity에userId만 저장합니다.🧹 셀프 체크리스트