Skip to content

Commit

Permalink
Feat [#45] Transactional 어노테이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kych4n committed Feb 1, 2025
1 parent c647fac commit 984babf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.cotato.tlinkserver.domain.room.Room;
import org.cotato.tlinkserver.domain.room.application.RoomService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import lombok.RequiredArgsConstructor;

Expand All @@ -15,16 +16,19 @@ public class DepositFacade {

private final RoomService roomService;

@Transactional(readOnly = true)
public DepositResponse getDeposit(final Long roomId) {
Room room = roomService.getRoom(roomId);
return DepositResponse.from(room);
}

@Transactional(readOnly = true)
public DepositModifyResponse getDepositModify(final Long roomId) {
Room room = roomService.getRoom(roomId);
return DepositModifyResponse.from(room);
}

@Transactional
public void modifyDeposit(final Long roomId, final DepositRequest depositRequest) {
Room room = roomService.getRoom(roomId);
room.setAccountNumber(depositRequest.accountNumber());
Expand Down

0 comments on commit 984babf

Please sign in to comment.