Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/com/petlog/pet/service/PetService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.petlog.petgroup.repository.PetGroupRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.time.LocalDateTime;
Expand All @@ -36,6 +37,7 @@ public class PetService {
private final WateringDailyRecordRepository wateringDailyRecordRepository;
private final PoopDailyRecordRepository poopDailyRecordRepository;

@Transactional(readOnly = true)
public GetPetProfileDto getPetProfile(final Long memberId, final Long groupId) {
final Member member = getMember(memberId);
final PetGroup petGroup = getPetGroup(groupId);
Expand Down Expand Up @@ -67,6 +69,7 @@ private PetGroupMember getPetGroupMember(final Member member, final PetGroup pet
.orElseThrow(() -> new IllegalArgumentException("그룹에 존재하지 않는 회원입니다."));
}

@Transactional(readOnly = true)
public GetFeedingInfoDto getFeedingInfo(final Long memberId, final Long groupId) {
final Member member = getMember(memberId);
final PetGroup petGroup = getPetGroup(groupId);
Expand All @@ -83,6 +86,7 @@ public GetFeedingInfoDto getFeedingInfo(final Long memberId, final Long groupId)
);
}

@Transactional(readOnly = true)
public GetWateringInfoDto getWateringInfo(final Long memberId, final Long groupId) {
final Member member = getMember(memberId);
final PetGroup petGroup = getPetGroup(groupId);
Expand All @@ -99,6 +103,7 @@ public GetWateringInfoDto getWateringInfo(final Long memberId, final Long groupI
);
}

@Transactional(readOnly = true)
public GetPoopInfoDto getPoopInfo(final Long memberId, final Long groupId) {
final Member member = getMember(memberId);
final PetGroup petGroup = getPetGroup(groupId);
Expand Down
Loading