diff --git a/src/main/java/com/noplanb/domain/character/application/CharacterService.java b/src/main/java/com/noplanb/domain/character/application/CharacterService.java index c045610..2fde0a6 100644 --- a/src/main/java/com/noplanb/domain/character/application/CharacterService.java +++ b/src/main/java/com/noplanb/domain/character/application/CharacterService.java @@ -199,6 +199,7 @@ public ResponseEntity createInitialCharacter(UserPrincipal userPrincipal, New } + @Transactional public ResponseEntity myCharacterEquipItem(UserPrincipal userPrincipal, MyCharacterEquipItemReq myCharacterEquipItemReq) { Character character = characterRepository.findByUserId(userPrincipal.getId()).orElseThrow(() -> new IllegalArgumentException("캐릭터를 찾을 수 없습니다.")); List item = character.getItems(); @@ -220,6 +221,7 @@ public ResponseEntity myCharacterEquipItem(UserPrincipal userPrincipal, MyCha Item equitItem = (Item) itemRepository.findById(itemId).orElseThrow(()->new IllegalArgumentException("아이템을 찾을 수 없습니다.")); equitItem.updateEquipped(true); + // // 장착 해제할 아이템 찾기 후 isEquipped = false로 변경 // Item itemToUnequip = item.stream() // .filter(i -> i.getItemImage().getItemType().equals(itemType) && i.isEquipped())