|
|
@@ -18,6 +18,7 @@ import com.izouma.nineth.utils.JpaUtils;
|
|
|
import com.izouma.nineth.utils.SecurityUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
@@ -40,8 +41,8 @@ public class TeamService {
|
|
|
private NeteaseMessageRepo neteaseMessageRepo;
|
|
|
private AssetRepo assetRepo;
|
|
|
|
|
|
- public Page<Team> all(PageQuery pageQuery) {
|
|
|
- Long userId = SecurityUtils.getAuthenticatedUser().getId();
|
|
|
+ @Cacheable(value = "teamAll", key = "#userId+'@'+#pageQuery.hashCode()")
|
|
|
+ public Page<Team> all(Long userId, PageQuery pageQuery) {
|
|
|
Page<Team> teams = teamRepo
|
|
|
.findAll(JpaUtils.toSpecification(pageQuery, Team.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
List<Team> content = teams.getContent();
|