[Feat/add egg type to response] - 응답필드 추가#106
Conversation
WalkthroughThe changes introduce a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AuthService
participant EggGrantService
participant SignupUserResponse
User->>AuthService: Register (signup)
AuthService->>EggGrantService: grantGreetingEggToUser(savedUser)
EggGrantService-->>AuthService: Egg (with EggType)
AuthService->>SignupUserResponse: Construct with user, tokenPair, egg, eggType.code
SignupUserResponse-->>User: Response includes eggCode
sequenceDiagram
participant User
participant HatchService
participant IncubatingEggRepository
participant HatchEggResponse
User->>HatchService: Hatch Egg
HatchService->>IncubatingEggRepository: Find incubating egg (with eggType.code)
IncubatingEggRepository-->>HatchService: IncubatingEggView (with eggCode)
HatchService->>HatchEggResponse: Construct with eggCode and other data
HatchEggResponse-->>User: Response includes eggCode
Suggested labels
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/test/java/org/runimo/runimo/user/api/UserItemAcceptanceTest.java (1)
151-152: Consider using a more descriptive test value for eggCode.The addition of the "ECODE" parameter correctly updates the mock to match the new SignupUserResponse constructor. However, consider using a more descriptive test value that better represents an actual egg code format.
- "test.url", - "ECODE" + "test.url", + "EGG_001"src/test/java/org/runimo/runimo/auth/controller/AuthControllerTest.java (1)
154-162: Consider adding egg_code assertion to both signup tests for consistency.Both test methods mock
SignupUserResponsewith the neweggCodeparameter, but only the first test (회원가입_디바이스_토큰_없음_201응답) asserts theegg_codefield in the response. For comprehensive test coverage, consider adding the assertion to the second test as well.Add this assertion to the second test method:
mockMvc.perform( multipart("/api/v1/auth/signup") .param("request", "{\"registerToken\":\"valid-token\", \"nickname\":\"RunimoUser\", \"deviceToken\":\"valid_device_token\", \"devicePlatform\":\"FCM\"}")) .andExpect(status().isCreated()) + .andExpect(jsonPath("$.payload.egg_code").value("ECODE")) .andExpect(jsonPath("$.code").value(UserHttpResponseCode.SIGNUP_SUCCESS.getCode()));Also applies to: 193-201
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
src/main/java/org/runimo/runimo/auth/service/SignUpUsecaseImpl.java(2 hunks)src/main/java/org/runimo/runimo/auth/service/dto/SignupUserResponse.java(1 hunks)src/main/java/org/runimo/runimo/hatch/service/dto/HatchEggResponse.java(1 hunks)src/main/java/org/runimo/runimo/hatch/service/usecase/HatchUsecaseImpl.java(1 hunks)src/main/java/org/runimo/runimo/user/repository/IncubatingEggRepository.java(1 hunks)src/main/java/org/runimo/runimo/user/service/dto/IncubatingEggView.java(1 hunks)src/test/java/org/runimo/runimo/auth/controller/AuthControllerTest.java(3 hunks)src/test/java/org/runimo/runimo/hatch/controller/HatchControllerTest.java(1 hunks)src/test/java/org/runimo/runimo/user/api/UserItemAcceptanceTest.java(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and analyze
🔇 Additional comments (9)
src/test/java/org/runimo/runimo/hatch/controller/HatchControllerTest.java (1)
74-74: LGTM! Test properly validates the new egg_code field.The addition of the egg_code validation ensures the hatch response includes the required egg type information as per the PR requirements.
src/main/java/org/runimo/runimo/hatch/service/usecase/HatchUsecaseImpl.java (1)
58-59: LGTM! Properly adds egg code to hatch response.The implementation correctly retrieves the egg type code from the egg domain object and includes it in the HatchEggResponse, fulfilling the PR requirement to add egg type information to hatch responses.
src/main/java/org/runimo/runimo/hatch/service/dto/HatchEggResponse.java (1)
22-23: LGTM! Well-documented addition of eggCode field.The new eggCode field is properly added with appropriate Swagger documentation, consistent naming, and correct positioning in the record.
src/main/java/org/runimo/runimo/auth/service/SignUpUsecaseImpl.java (3)
15-15: LGTM! Proper import addition for EggType.The import is correctly added to support the new functionality.
54-54: LGTM! Clean extraction of egg type from granted egg.The code properly extracts the EggType from the granted egg to access its code for the response.
58-58: LGTM! Correctly integrates egg code into signup response.The implementation properly passes the egg type code to the SignupUserResponse constructor, fulfilling the PR requirement to include egg type information in user registration responses.
src/main/java/org/runimo/runimo/user/repository/IncubatingEggRepository.java (1)
29-29: LGTM! Query projection correctly updated.The JPQL query properly adds
e.eggType.codeto the constructor projection, which aligns with theIncubatingEggViewconstructor changes. The existing join with theEggentity allows access to theeggType.codefield.src/main/java/org/runimo/runimo/user/service/dto/IncubatingEggView.java (1)
19-19: LGTM! DTO properly updated with eggCode field.The
eggCodefield addition is correctly implemented:
- Field is properly declared and assigned in the constructor
- Constructor signature matches the repository query projection
- Parameter is consistently added as the last parameter for backward compatibility
Also applies to: 23-23, 30-30
src/main/java/org/runimo/runimo/auth/service/dto/SignupUserResponse.java (1)
14-14: LGTM! Record properly updated with eggCode field.The
SignupUserResponserecord is correctly updated:
- New
eggCodefield properly added to the record- Secondary constructor signature updated to accept the new parameter
- Constructor call correctly passes the
eggCodeparameter- Consistent parameter ordering maintained
Also applies to: 17-18, 25-26
|



작업 내역
Summary by CodeRabbit
New Features
Bug Fixes