| | |
| | | if (!party.isEnabled()) { |
| | | throw new YamiShopBindException("用户已禁用"); |
| | | } |
| | | validateTradePermission(party); |
| | | ExchangeLeverApplyOrder order = new ExchangeLeverApplyOrder(); |
| | | order.setPartyId(SecurityUtils.getCurrentUserId()); |
| | | order.setSymbol(symbol); |
| | |
| | | if (!party.isEnabled()) { |
| | | throw new BusinessException("用户已锁定"); |
| | | } |
| | | validateTradePermission(party); |
| | | // if (!party.getKyc_authority()) { |
| | | // resultObject.setCode("401"); |
| | | // resultObject.setMsg(error); |
| | |
| | | |
| | | } |
| | | |
| | | private void validateTradePermission(User user) { |
| | | if (user == null) { |
| | | throw new YamiShopBindException("用户不存在"); |
| | | } |
| | | // 模拟账户不做二步校验限制 |
| | | if (user.getAccountType() != null && user.getAccountType() == 1) { |
| | | return; |
| | | } |
| | | if (!user.isGoogleAuthBind() || StringUtils.isEmptyString(user.getSafePassword())) { |
| | | throw new YamiShopBindException("请先完成两步认证并设置资金密码后再交易"); |
| | | } |
| | | } |
| | | |
| | | } |