Repository navigation
refactor: 플레이어 init을 GET 로드 + POST 생성으로 분리 - #29
Conversation
PR #28 리뷰 반영: 티켓 일일 충전 설명의 '지연 지급'을 '최초 요청 시점에 충전'으로 수정해 lazy 충전 의미를 명확히 함.
POST /v1/player/init의 생성·로드 겸용과 직업 불일치 409 모호함을 GET /v1/player(로드) + POST /v1/player(생성)로 분리하는 재설계 스펙.
There was a problem hiding this comment.
Code Review
This pull request redesigns the player loading and creation flow by splitting the combined POST /v1/player/init endpoint into a GET /v1/player endpoint for loading player data and a POST /v1/player endpoint for player creation. It updates the corresponding services, controllers, DI registrations, unit tests, and client integration documentation. The review feedback highlights two important issues: first, a potential client-side deadlock if a player exists but has missing related data, where throwing a 404 instead of a 500 would cause a loop of creation failures; second, a concurrency race condition during simultaneous player creation requests that could be mitigated by handling database unique constraint violations or using locks.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
플레이어 엔티티는 있으나 resource/stage/session이 누락된 데이터 정합성 위반에서 NotFoundException(404) 대신 InvalidOperationException(500)을 던진다. 404는 클라이언트가 POST /v1/player 생성을 시도하게 만들어 409와 교착 상태에 빠뜨린다. (PR #29 리뷰 반영)
There was a problem hiding this comment.
Code Review
This pull request refactors the player initialization flow by splitting the combined load/create endpoint (POST /v1/player/init) into two distinct endpoints: GET /v1/player for loading player data and POST /v1/player for creating a new player. Correspondingly, InitPlayerService is split into GetPlayerService and CreatePlayerService, and the request DTO is renamed to CreatePlayerRequest. Additionally, the production Swagger basic authentication middleware is removed. Feedback on the changes suggests adding [EnumDataType(typeof(JobType))] validation to the CreatePlayerRequest to prevent invalid enum values from bypassing model validation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
[Required]만으로는 미정의 정수 값(예: 99)이 모델 검증을 통과해 도메인 영역으로 유입될 수 있어, [EnumDataType(typeof(JobType))]으로 정의된 JobType 값만 허용하도록 보강.
📚작업 내용
init단일 엔드포인트를GET /v1/player(로드)와POST /v1/player(생성)로 분리GetPlayerService추가: Redis 캐시 우선 조회, 미스 시 DB 조회 후 캐시 적재, 플레이어 미존재 시 404CreatePlayerService추가: 트랜잭션으로 player/resource/stage/session 생성, 이미 존재하면 409, 생성 후 Redis 캐시 적재InitPlayerService/IInitPlayerService/InitPlayerRequest제거 →CreatePlayerRequest,IGetPlayerService/ICreatePlayerService로 대체PlayerServiceConfigDI 등록을 신규 서비스에 맞게 갱신SwaggerBasicAuthMiddleware) 및 관련 Program.cs/compose.prod.yaml 설정 제거POST /v1/player/init→GET /v1/player+POST /v1/player. 클라이언트는 로드(GET) 후 404면 생성(POST)하는 흐름으로 동작GetPlayerServiceTest,CreatePlayerServiceTest신규 추가, 기존InitPlayerServiceTests제거, 라우트 테스트를 GET/POST 구조로 갱신✅체크리스트