|
|
@@ -2,10 +2,11 @@ package com.izouma.nineth.service;
|
|
|
|
|
|
import com.izouma.nineth.domain.BlindBoxItem;
|
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
|
+import com.izouma.nineth.dto.PageWrapper;
|
|
|
import com.izouma.nineth.repo.BlindBoxItemRepo;
|
|
|
import com.izouma.nineth.utils.JpaUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@Service
|
|
|
@@ -14,7 +15,8 @@ public class BlindBoxItemService {
|
|
|
|
|
|
private BlindBoxItemRepo blindBoxItemRepo;
|
|
|
|
|
|
- public Page<BlindBoxItem> all(PageQuery pageQuery) {
|
|
|
- return blindBoxItemRepo.findAll(JpaUtils.toSpecification(pageQuery, BlindBoxItem.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
+ @Cacheable(value = "blindBoxList", key = "#pageQuery.hashCode()")
|
|
|
+ public PageWrapper<BlindBoxItem> all(PageQuery pageQuery) {
|
|
|
+ return PageWrapper.of(blindBoxItemRepo.findAll(JpaUtils.toSpecification(pageQuery, BlindBoxItem.class), JpaUtils.toPageRequest(pageQuery)));
|
|
|
}
|
|
|
}
|