diff --git a/src/main/java/ussum/homepage/domain/post/service/PostAdditionalReader.java b/src/main/java/ussum/homepage/domain/post/service/PostAdditionalReader.java new file mode 100644 index 0000000..f3d9c2b --- /dev/null +++ b/src/main/java/ussum/homepage/domain/post/service/PostAdditionalReader.java @@ -0,0 +1,21 @@ +package ussum.homepage.domain.post.service; + +import jakarta.transaction.Transactional; +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import ussum.homepage.domain.post.Post; +import ussum.homepage.domain.post.RightsDetail; +import ussum.homepage.domain.post.RightsDetailRepository; + +@Service +@RequiredArgsConstructor +public class PostAdditionalReader { + private final RightsDetailRepository rightsDetailRepository; + + @Transactional + public List getRightsDetailByPostId(Long postId) { + List rightsDetails = rightsDetailRepository.findAllByPostId(postId); + return rightsDetails; + } +}