|
@@ -37,14 +37,15 @@ public class ApiUserServiceImpl extends BaseService implements ApiUserService {
|
|
|
public Integer validateUser(ApiRequestParam param) {
|
|
|
// 无效用户
|
|
|
UserPo userPo = userService.getUserByAppKey(param.getAppKey());
|
|
|
-
|
|
|
+ // TODO 余额控制需要测试
|
|
|
if (userPo == null) {
|
|
|
return ApiResponseCodeEnum.CODE_1000.getValue();
|
|
|
} else if (!userPo.getAppSecret().equals(param.getAppSecret())) {
|
|
|
return ApiResponseCodeEnum.CODE_1000.getValue();
|
|
|
} else if (!ArrayUtils.contains(CommonConstant.CAR_FREE_API_ARGS, param.getApi())) {
|
|
|
return ApiResponseCodeEnum.CODE_1080.getValue();
|
|
|
- } else if (CommonUtil.parseDouble(userPo.getBalance()) / CommonUtil.parseDouble(userPo.getPrice()) < CommonUtil.parseDouble(userPo.getPrice())) {
|
|
|
+ } else if (CommonUtil.parseDouble(userPo.getBalance()) / CommonUtil.parseDouble(userPo.getPrice()) < CommonUtil.parseDouble(userPo.getPrice())
|
|
|
+ && (param.getApi().equals(CommonConstant.WAY_BILL_START) || param.getApi().equals(CommonConstant.WAY_BILL_HISTORY_START))) {
|
|
|
return ApiResponseCodeEnum.CODE_1090.getValue();
|
|
|
} else {
|
|
|
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(param.getData()));
|