perf: 优化缓存模块

提升可读性 & 减小内存占用
This commit is contained in:
xiongxiaoyang
2025-07-25 17:03:46 +08:00
parent 7e27456a65
commit c24c68ecaf
14 changed files with 173 additions and 130 deletions

View File

@@ -9,7 +9,7 @@ import com.java2nb.novel.service.FriendLinkService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -31,7 +31,7 @@ public class FriendLinkController {
@Autowired
private FriendLinkService friendLinkService;
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
private StringRedisTemplate redisTemplate;
@GetMapping()
@RequiresPermissions("novel:friendLink:friendLink")

View File

@@ -9,7 +9,7 @@ import com.java2nb.novel.service.NewsService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
@@ -32,7 +32,7 @@ public class NewsController {
@Autowired
private NewsService newsService;
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
private StringRedisTemplate redisTemplate;
@GetMapping()
@RequiresPermissions("novel:news:news")