修改对外接口可支持多个ip地址

new-dev
袁野 2 years ago
parent e25f2021a8
commit dd795a536a
  1. 5
      hai-bweb/src/main/java/com/bweb/controller/ApiIpAddressController.java
  2. 2
      hai-service/src/main/java/com/hai/service/impl/ApiIpAddressServiceImpl.java
  3. 2
      v1/src/main/java/com/v1/controller/orderController.java

@ -69,6 +69,10 @@ public class ApiIpAddressController {
ApiIpAddress apiIpAddressEdit = apiIpAddressService.findByMchId(apiIpAddress.getMchId()); ApiIpAddress apiIpAddressEdit = apiIpAddressService.findByMchId(apiIpAddress.getMchId());
if (apiIpAddress.getIpAddress().length() > 250) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "超过最大可配置内容");
}
// 判断是否存在ip地址内容 // 判断是否存在ip地址内容
if (apiIpAddressEdit == null ) { if (apiIpAddressEdit == null ) {
apiIpAddress.setCreateTime(new Date()); apiIpAddress.setCreateTime(new Date());
@ -81,7 +85,6 @@ public class ApiIpAddressController {
} }
return ResponseMsgUtil.success("新增成功"); return ResponseMsgUtil.success("新增成功");
} catch (Exception e) { } catch (Exception e) {
log.error("ApiMerchantsController -> insertMerchant() error!",e); log.error("ApiMerchantsController -> insertMerchant() error!",e);

@ -55,7 +55,7 @@ public class ApiIpAddressServiceImpl implements ApiIpAddressService {
public Boolean validationIpAddressLegal(String mchId, String ipAddress) { public Boolean validationIpAddressLegal(String mchId, String ipAddress) {
ApiIpAddressExample example = new ApiIpAddressExample(); ApiIpAddressExample example = new ApiIpAddressExample();
example.createCriteria().andMchIdEqualTo(mchId).andIpAddressEqualTo(ipAddress); example.createCriteria().andMchIdEqualTo(mchId).andIpAddressLike("%" + ipAddress + "%");
List<ApiIpAddress> list = apiIpAddressMapper.selectByExample(example); List<ApiIpAddress> list = apiIpAddressMapper.selectByExample(example);

@ -62,7 +62,7 @@ public class orderController {
@RequestMapping(value = "/createOrder", method = RequestMethod.POST) @RequestMapping(value = "/createOrder", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "充值预下单") @ApiOperation(value = "创建订单")
public ResponseData createOrder(@RequestBody JSONObject object , HttpServletRequest request ) { public ResponseData createOrder(@RequestBody JSONObject object , HttpServletRequest request ) {
try { try {

Loading…
Cancel
Save