|
@@ -125,7 +125,7 @@ public class AccountServiceImpl extends ServiceImpl<IAccountMapper, Account> imp
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3021);
|
|
|
}
|
|
|
if(param.getState() != CommonStatus.NO.code().intValue()
|
|
|
- || param.getState() != CommonStatus.YES.code().intValue()){
|
|
|
+ && param.getState() != CommonStatus.YES.code().intValue()){
|
|
|
throw new BusinessException(ErrorCode.PARAM_ERROR);
|
|
|
}
|
|
|
Integer count = param.getCount();
|
|
@@ -148,11 +148,14 @@ public class AccountServiceImpl extends ServiceImpl<IAccountMapper, Account> imp
|
|
|
userAuthInfo.setAppKey(TokenUtil.createToken());
|
|
|
userAuthInfo.setTotalCount(count);
|
|
|
userAuthInfo.setCallCount(0);
|
|
|
- userAuthInfo.setState(userAuthInfo.getState());
|
|
|
+ userAuthInfo.setState(param.getState());
|
|
|
userAuthInfo.setEffectTime(param.getEffectTime());
|
|
|
userAuthInfo.setCreaterId(param.getCreaterId());
|
|
|
userAuthService.save(userAuthInfo);
|
|
|
|
|
|
+ //设置redis缓存
|
|
|
+ userAuthService.setReidsCount(userAuthInfo.getAppKey(), count, CountType.NO_LIMIT.code() == param.getCountType());
|
|
|
+
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
@@ -198,10 +201,16 @@ public class AccountServiceImpl extends ServiceImpl<IAccountMapper, Account> imp
|
|
|
|
|
|
userAuthInfo.setUserId(account.getUserId());
|
|
|
userAuthInfo.setTotalCount(totalCount);
|
|
|
+ if(totalCount == -1){//如果由限制改为无限制,调用次数置为初始状态0
|
|
|
+ userAuthInfo.setCallCount(0);
|
|
|
+ }
|
|
|
userAuthInfo.setState(param.getState());
|
|
|
userAuthInfo.setUpdaterId(param.getUpdaterId());
|
|
|
userAuthService.updateById(userAuthInfo);
|
|
|
|
|
|
+ //设置redis缓存
|
|
|
+ userAuthService.setReidsCount(userAuthInfo.getAppKey(), count, CountType.NO_LIMIT.code() == param.getCountType());
|
|
|
+
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|