-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feat] 인벤토리 API #46
[Feat] 인벤토리 API #46
Conversation
Test Results22 tests 22 ✅ 3s ⏱️ Results for commit 55b1214. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 내용에도 담겨 있는데, 유저 <-> 인벤토리 그림이 아닌 캐릭터 <-> 인벤토리가 아닌가 생각이 듭니다. 아이템을 실질적으로 사용하고 관리하는 주체는 캐릭터가 아닌가라는 생각입니다. 만약 캐릭터를 삭제하는 로직이 들어간다면 인벤토리를 모두 이어 받아서 사용할 수 있는가 하면 그것은 아니라는 생각이라. 의견이 궁금합니다.
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private Long userId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 본문에도 궁금했던 내용인데 유저와 인벤토리가 연결되는 이유를 모르겠습니다. 인벤토리는 캐릭터와 연결되는게 맞는 그림이 아닌가 생각하는데 의도하신 이유가 궁금합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘못생각했습니다. 캐릭터와 관계를 가져야 하는 것이 맞다고 생각합니다
public Inventory findByUserId(Long userId){ | ||
Optional<Inventory> inventoryOptional = inventoryRepository.findByUserId(userId); | ||
if(inventoryOptional.isEmpty()) | ||
throw new RuntimeException("해당하는 인벤토리가 없습니다. 회원가입된 아이디가 아닙니다."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예외 내용에 두 가지가 들어가는거 같은데 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 개발된 비즈니스 로직에 따르면 유저를 생성하면서 인벤토리를 생성하기 때문에 인벤토리가 없는경우가 직접삭제하거나 회원가입조차되지 않은 경우에 해당합니다
수정이 필요한 부분 같습니다. 관련된 내용으로 캐릭터가 생성될때 인벤토리가 같이 생성되도록 변경해야 합니다.
비즈니스로 로직상으로 회원가입이 된 이후에 해당 API를 호출한다는 점에서 "회원가입된 아이디가 아닙니다" 가 삭제되어야합니다
같이 삭제되는 것이 맞다고 생각합니다 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저번 로직과 비슷해보이네요. 수고하셨습니다.
/쿠타버스 배포 |
1 similar comment
/쿠타버스 배포 |
🌎 배포하였습니다. |
✏️ 작업 개요
⛳ 작업 분류
🔨 작업 상세 내용
💡 생각해볼 문제