解决不必要的黄线警告

This commit is contained in:
click33 2022-04-23 16:24:15 +08:00
parent 0c0b08c6c3
commit b62e2dae24
4 changed files with 7 additions and 3 deletions

View File

@ -18,12 +18,13 @@ import java.util.List;
* sa 缓存处理
*/
@JbootSpi("sacache")
@SuppressWarnings({"deprecation", "unchecked", "rawtypes"})
public class SaRedisCache implements JbootCache {
protected JbootRedisConfig config;
protected JedisPool jedisPool;
private ThreadLocal<String> CACHE_NAME_PREFIX_TL = new ThreadLocal<>();
public SaRedisCache(JbootRedisConfig config) {
public SaRedisCache(JbootRedisConfig config) {
this.config = config;
String host = config.getHost();
@ -111,7 +112,7 @@ public class SaRedisCache implements JbootCache {
return null;
}
@Override
@Override
public <T> T get(String cacheName, Object key) {
Jedis jedis = getJedis();
try {

View File

@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* 使用Jboot的缓存方法存取Token数据
*/
@SuppressWarnings({"deprecation", "unchecked", "rawtypes"})
public class SaTokenCacheDao implements SaTokenDao {
protected SaRedisCache saRedisCache;

View File

@ -35,8 +35,9 @@ public class AppRun extends JbootController {
renderText("超级管理员方法!");
}
@SuppressWarnings("unused")
public void token(String token) {
Object t = Jboot.getRedis().get("xxxxx"); //默认redis库
Object t = Jboot.getRedis().get("xxxxx"); //默认redis库
SaSession saSession = StpUtil.getSessionByLoginId(StpUtil.getLoginIdByToken(token), false); //satoken redis库
renderJson(saSession);
}

View File

@ -27,6 +27,7 @@ import com.pj.test.util.SoMap;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = StartUpApplication.class)
@SuppressWarnings("deprecation")
public class LoginControllerTest {
@Autowired