修改了幂等性异常提示
This commit is contained in:
@ -64,8 +64,7 @@ public class IdempotentAspect {
|
||||
}
|
||||
Idempotent idempotent = method.getAnnotation(Idempotent.class);
|
||||
|
||||
|
||||
/*key : url + 参数列表作为区分*/
|
||||
/* key : url + 参数列表作为区分 */
|
||||
String url = request.getRequestURL().toString();
|
||||
String argString = JsonUtils.objectToJson(Arrays.asList(joinPoint.getArgs()));
|
||||
assert argString != null;
|
||||
@ -82,14 +81,13 @@ public class IdempotentAspect {
|
||||
String value = LocalDateTime.now().toString().replace("T", " ");
|
||||
if (null != rMapCache.get(key)) {
|
||||
// had stored
|
||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName(info,true);
|
||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName(info, true);
|
||||
}
|
||||
synchronized (this) {
|
||||
boolean submitAble = redisTemplate.opsForValue().setIfAbsent(key, value,expireTime,timeUnit);
|
||||
boolean submitAble = redisTemplate.opsForValue().setIfAbsent(key, value, expireTime, timeUnit);
|
||||
if (!submitAble) {
|
||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("[idempotent]:" + info,true);
|
||||
}
|
||||
else {
|
||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName(info, true);
|
||||
} else {
|
||||
log.info("[idempotent]:has stored key={},value={},expireTime={}{},now={}", key, value, expireTime,
|
||||
timeUnit, LocalDateTime.now().toString());
|
||||
}
|
||||
|
Reference in New Issue
Block a user