File tree Expand file tree Collapse file tree 1 file changed +0
-12
lines changed
src/main/java/eatda/service/cheer Expand file tree Collapse file tree 1 file changed +0
-12
lines changed Original file line number Diff line number Diff line change 2020import java .util .List ;
2121import lombok .RequiredArgsConstructor ;
2222import org .springframework .data .domain .PageRequest ;
23- import org .springframework .data .domain .Pageable ;
2423import org .springframework .stereotype .Service ;
2524import org .springframework .transaction .annotation .Transactional ;
2625
@@ -71,17 +70,6 @@ private CheersResponse toCheersResponse(List<Cheer> cheers) {
7170 .toList ());
7271 }
7372
74- @ Transactional (readOnly = true )
75- public CheersInStoreResponse getCheersByStoreId (Long storeId , int size ) {
76- Store store = storeRepository .getById (storeId );
77- List <Cheer > cheers = cheerRepository .findAllByStoreOrderByCreatedAtDesc (store , Pageable .ofSize (size ));
78-
79- List <CheerInStoreResponse > cheersResponse = cheers .stream ()
80- .map (CheerInStoreResponse ::new )
81- .toList (); // TODO N+1 문제 해결
82- return new CheersInStoreResponse (cheersResponse );
83- }
84-
8573 @ Transactional (readOnly = true )
8674 public CheersInStoreResponse getCheersByStoreId (Long storeId , int page , int size ) {
8775 Store store = storeRepository .getById (storeId );
You can’t perform that action at this time.
0 commit comments