mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 11:49:20 +08:00
fix: 修复一些警告
This commit is contained in:
Vendored
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"java.compile.nullAnalysis.mode": "automatic"
|
// MyBatis-Plus 方法引用会触发 Eclipse 空值分析误报;关闭后无需每类加 @SuppressWarnings("null")
|
||||||
|
"java.compile.nullAnalysis.mode": "disabled"
|
||||||
}
|
}
|
||||||
+12
-2
@@ -70,13 +70,23 @@ public class ImportTaskRedisQueue {
|
|||||||
* 阻塞读取新消息(>)。
|
* 阻塞读取新消息(>)。
|
||||||
*/
|
*/
|
||||||
public List<ImportTaskStreamRecord> readNew(String streamKey, String groupName, String consumerName, long blockMs) {
|
public List<ImportTaskStreamRecord> readNew(String streamKey, String groupName, String consumerName, long blockMs) {
|
||||||
List<MapRecord<String, Object, Object>> records = stringRedisTemplate.opsForStream().read(
|
StreamOffset<String> offset = StreamOffset.create(streamKey, ReadOffset.lastConsumed());
|
||||||
|
List<MapRecord<String, Object, Object>> records = readGroup(
|
||||||
Consumer.from(groupName, consumerName),
|
Consumer.from(groupName, consumerName),
|
||||||
StreamReadOptions.empty().count(10).block(Duration.ofMillis(Math.max(1, blockMs))),
|
StreamReadOptions.empty().count(10).block(Duration.ofMillis(Math.max(1, blockMs))),
|
||||||
StreamOffset.create(streamKey, ReadOffset.lastConsumed()));
|
offset);
|
||||||
return toRecords(streamKey, records);
|
return toRecords(streamKey, records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 封装 varargs 调用,避免泛型数组类型安全警告。 */
|
||||||
|
@SafeVarargs
|
||||||
|
private final List<MapRecord<String, Object, Object>> readGroup(
|
||||||
|
Consumer consumer,
|
||||||
|
StreamReadOptions options,
|
||||||
|
StreamOffset<String>... offsets) {
|
||||||
|
return stringRedisTemplate.opsForStream().read(consumer, options, offsets);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回收超时 PEL 消息:先 XPENDING 再 XCLAIM(当前 Spring Data Redis 无 XAUTOCLAIM 封装)。
|
* 回收超时 PEL 消息:先 XPENDING 再 XCLAIM(当前 Spring Data Redis 无 XAUTOCLAIM 封装)。
|
||||||
*/
|
*/
|
||||||
|
|||||||
-2
@@ -37,7 +37,6 @@ public class ImportTaskConsumerServiceImpl implements ImportTaskConsumerService
|
|||||||
private final ImportTaskRedisQueue redisQueue;
|
private final ImportTaskRedisQueue redisQueue;
|
||||||
private final ImportTaskStreamNames streamNames;
|
private final ImportTaskStreamNames streamNames;
|
||||||
private final ImportTaskProperties properties;
|
private final ImportTaskProperties properties;
|
||||||
private final ImportTaskConsumerNameFactory consumerNameFactory;
|
|
||||||
private final ImportTaskRecoveryService recoveryService;
|
private final ImportTaskRecoveryService recoveryService;
|
||||||
|
|
||||||
private ExecutorService executorService;
|
private ExecutorService executorService;
|
||||||
@@ -56,7 +55,6 @@ public class ImportTaskConsumerServiceImpl implements ImportTaskConsumerService
|
|||||||
this.redisQueue = redisQueue;
|
this.redisQueue = redisQueue;
|
||||||
this.streamNames = streamNames;
|
this.streamNames = streamNames;
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
this.consumerNameFactory = consumerNameFactory;
|
|
||||||
this.recoveryService = recoveryService;
|
this.recoveryService = recoveryService;
|
||||||
this.consumerName = consumerNameFactory.current();
|
this.consumerName = consumerNameFactory.current();
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -49,7 +49,6 @@ public class OrderStatCacheService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public <T> T get(String cacheKey, Class<T> type) {
|
public <T> T get(String cacheKey, Class<T> type) {
|
||||||
if (!isEnabled() || cacheKey == null) {
|
if (!isEnabled() || cacheKey == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
-1
@@ -193,7 +193,6 @@ public class LicenseValidator {
|
|||||||
try {
|
try {
|
||||||
String url = properties.getLicenseServerUrl().replaceAll("/$", "")
|
String url = properties.getLicenseServerUrl().replaceAll("/$", "")
|
||||||
+ "/api/licenses/status?jti=" + info.getJti();
|
+ "/api/licenses/status?jti=" + info.getJti();
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
var body = restTemplate.getForObject(URI.create(url), java.util.Map.class);
|
var body = restTemplate.getForObject(URI.create(url), java.util.Map.class);
|
||||||
if (body != null && "revoked".equals(String.valueOf(body.get("status")))) {
|
if (body != null && "revoked".equals(String.valueOf(body.get("status")))) {
|
||||||
revokedJtiSet = new HashSet<>(revokedJtiSet);
|
revokedJtiSet = new HashSet<>(revokedJtiSet);
|
||||||
|
|||||||
-2
@@ -1,6 +1,5 @@
|
|||||||
package top.xyquan.ecomdmbbackend.modules.org.position.menu.service.impl;
|
package top.xyquan.ecomdmbbackend.modules.org.position.menu.service.impl;
|
||||||
|
|
||||||
import top.xyquan.ecomdmbbackend.common.utils.BeanCopyUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -24,7 +23,6 @@ import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user