...
|
...
|
@@ -6,6 +6,7 @@ import com.yoho.error.exception.ServiceException; |
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
...
|
...
|
@@ -25,31 +26,32 @@ public class BankcardController { |
|
|
@Autowired
|
|
|
ServiceCaller serviceCaller;
|
|
|
|
|
|
private String erpGatewayUrl = "${erp-gateway.url}";
|
|
|
@Value("${erp-gateway.url}")
|
|
|
private String erpGatewayUrl;
|
|
|
|
|
|
@RequestMapping(params = "method=ufo.getBankCard")
|
|
|
@RequestMapping(params = "method=ufo.bankcard.getBankCard")
|
|
|
public ApiResponse getBankCard(@RequestParam(value = "uid") int uid) {
|
|
|
log.info("get bank card, uid is {}", uid);
|
|
|
String url = erpGatewayUrl + "/erp/union/bankcard/getBankCard";
|
|
|
Map<String, Object> params = Maps.newHashMap();
|
|
|
params.put("uid", uid);
|
|
|
return proxyGet("ufo.getBankCard", url, params);
|
|
|
return proxyGet("ufo.bankcard.getBankCard", url, params);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(params = "method=ufo.getBankList")
|
|
|
@RequestMapping(params = "method=ufo.bankcard.getBankList")
|
|
|
@ResponseBody
|
|
|
public ApiResponse getBankList(@RequestParam(value = "uid", defaultValue = "0") Integer uid) {
|
|
|
log.info("getBankList.uid is {}", uid);
|
|
|
String url = erpGatewayUrl + "/erp/union/bankcard/getBankList";
|
|
|
Map<String, Object> params = Maps.newHashMap();
|
|
|
params.put("uid", uid);
|
|
|
return proxyGet("ufo.getBankList", url, params);
|
|
|
return proxyGet("ufo.bankcard.getBankList", url, params);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 绑定银行卡
|
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.bindBankCard")
|
|
|
@RequestMapping(params = "method=ufo.bankcard.bindBankCard")
|
|
|
@ResponseBody
|
|
|
public ApiResponse bindBankCard(@RequestParam(value = "uid", defaultValue = "0") Integer uid,
|
|
|
@RequestParam(value = "idCardNo") String idCardNo,
|
...
|
...
|
@@ -69,13 +71,13 @@ public class BankcardController { |
|
|
params.put("bankCardNo", bankCardNo);
|
|
|
params.put("bankBranch", bankBranch);
|
|
|
params.put("bankCode", bankCode);
|
|
|
return proxyPost("ufo.bindBankCard", url, params);
|
|
|
return proxyPost("ufo.bankcard.bindBankCard", url, params);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 校验绑卡信息
|
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.checkBankCard")
|
|
|
@RequestMapping(params = "method=ufo.bankcard.checkBankCard")
|
|
|
@ResponseBody
|
|
|
public ApiResponse checkBankCard(@RequestParam(value = "uid", defaultValue = "0") Integer uid,
|
|
|
@RequestParam(value = "idCardNo") String idCardNo,
|
...
|
...
|
@@ -95,7 +97,7 @@ public class BankcardController { |
|
|
params.put("bankCardNo", bankCardNo);
|
|
|
params.put("bankBranch", bankBranch);
|
|
|
params.put("bankCode", bankCode);
|
|
|
return proxyPost("ufo.checkBankCard", url, params);
|
|
|
return proxyPost("ufo.bankcard.checkBankCard", url, params);
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -109,7 +111,8 @@ public class BankcardController { |
|
|
|
|
|
private ApiResponse proxyCall(String serviceName, String url, Map<String, Object> params) {
|
|
|
try {
|
|
|
params.put("from", "ufo");
|
|
|
// 接口调用者:1 UFO, 0 CPS
|
|
|
params.put("source", 1);
|
|
|
ApiResponse response = serviceCaller.get(serviceName, url, params, ApiResponse.class, null).get(500, TimeUnit.MILLISECONDS);
|
|
|
return response;
|
|
|
} catch (ServiceException e) {
|
...
|
...
|
|