Authored by tanling

Merge branch 'hotfix-invite-activity' of http://git.yoho.cn/ufo/yohoufo-fore int…

…o hotfix-invite-activity
@@ -6,6 +6,7 @@ import com.yoho.error.exception.ServiceException; @@ -6,6 +6,7 @@ import com.yoho.error.exception.ServiceException;
6 import com.yohoufo.common.ApiResponse; 6 import com.yohoufo.common.ApiResponse;
7 import lombok.extern.slf4j.Slf4j; 7 import lombok.extern.slf4j.Slf4j;
8 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.beans.factory.annotation.Value;
9 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
10 import org.springframework.web.bind.annotation.RequestParam; 11 import org.springframework.web.bind.annotation.RequestParam;
11 import org.springframework.web.bind.annotation.ResponseBody; 12 import org.springframework.web.bind.annotation.ResponseBody;
@@ -25,31 +26,32 @@ public class BankcardController { @@ -25,31 +26,32 @@ public class BankcardController {
25 @Autowired 26 @Autowired
26 ServiceCaller serviceCaller; 27 ServiceCaller serviceCaller;
27 28
28 - private String erpGatewayUrl = "${erp-gateway.url}"; 29 + @Value("${erp-gateway.url}")
  30 + private String erpGatewayUrl;
29 31
30 - @RequestMapping(params = "method=ufo.getBankCard") 32 + @RequestMapping(params = "method=ufo.bankcard.getBankCard")
31 public ApiResponse getBankCard(@RequestParam(value = "uid") int uid) { 33 public ApiResponse getBankCard(@RequestParam(value = "uid") int uid) {
32 log.info("get bank card, uid is {}", uid); 34 log.info("get bank card, uid is {}", uid);
33 String url = erpGatewayUrl + "/erp/union/bankcard/getBankCard"; 35 String url = erpGatewayUrl + "/erp/union/bankcard/getBankCard";
34 Map<String, Object> params = Maps.newHashMap(); 36 Map<String, Object> params = Maps.newHashMap();
35 params.put("uid", uid); 37 params.put("uid", uid);
36 - return proxyGet("ufo.getBankCard", url, params); 38 + return proxyGet("ufo.bankcard.getBankCard", url, params);
37 } 39 }
38 40
39 - @RequestMapping(params = "method=ufo.getBankList") 41 + @RequestMapping(params = "method=ufo.bankcard.getBankList")
40 @ResponseBody 42 @ResponseBody
41 public ApiResponse getBankList(@RequestParam(value = "uid", defaultValue = "0") Integer uid) { 43 public ApiResponse getBankList(@RequestParam(value = "uid", defaultValue = "0") Integer uid) {
42 log.info("getBankList.uid is {}", uid); 44 log.info("getBankList.uid is {}", uid);
43 String url = erpGatewayUrl + "/erp/union/bankcard/getBankList"; 45 String url = erpGatewayUrl + "/erp/union/bankcard/getBankList";
44 Map<String, Object> params = Maps.newHashMap(); 46 Map<String, Object> params = Maps.newHashMap();
45 params.put("uid", uid); 47 params.put("uid", uid);
46 - return proxyGet("ufo.getBankList", url, params); 48 + return proxyGet("ufo.bankcard.getBankList", url, params);
47 } 49 }
48 50
49 /** 51 /**
50 * 绑定银行卡 52 * 绑定银行卡
51 */ 53 */
52 - @RequestMapping(params = "method=ufo.bindBankCard") 54 + @RequestMapping(params = "method=ufo.bankcard.bindBankCard")
53 @ResponseBody 55 @ResponseBody
54 public ApiResponse bindBankCard(@RequestParam(value = "uid", defaultValue = "0") Integer uid, 56 public ApiResponse bindBankCard(@RequestParam(value = "uid", defaultValue = "0") Integer uid,
55 @RequestParam(value = "idCardNo") String idCardNo, 57 @RequestParam(value = "idCardNo") String idCardNo,
@@ -69,13 +71,13 @@ public class BankcardController { @@ -69,13 +71,13 @@ public class BankcardController {
69 params.put("bankCardNo", bankCardNo); 71 params.put("bankCardNo", bankCardNo);
70 params.put("bankBranch", bankBranch); 72 params.put("bankBranch", bankBranch);
71 params.put("bankCode", bankCode); 73 params.put("bankCode", bankCode);
72 - return proxyPost("ufo.bindBankCard", url, params); 74 + return proxyPost("ufo.bankcard.bindBankCard", url, params);
73 } 75 }
74 76
75 /** 77 /**
76 * 校验绑卡信息 78 * 校验绑卡信息
77 */ 79 */
78 - @RequestMapping(params = "method=ufo.checkBankCard") 80 + @RequestMapping(params = "method=ufo.bankcard.checkBankCard")
79 @ResponseBody 81 @ResponseBody
80 public ApiResponse checkBankCard(@RequestParam(value = "uid", defaultValue = "0") Integer uid, 82 public ApiResponse checkBankCard(@RequestParam(value = "uid", defaultValue = "0") Integer uid,
81 @RequestParam(value = "idCardNo") String idCardNo, 83 @RequestParam(value = "idCardNo") String idCardNo,
@@ -95,7 +97,7 @@ public class BankcardController { @@ -95,7 +97,7 @@ public class BankcardController {
95 params.put("bankCardNo", bankCardNo); 97 params.put("bankCardNo", bankCardNo);
96 params.put("bankBranch", bankBranch); 98 params.put("bankBranch", bankBranch);
97 params.put("bankCode", bankCode); 99 params.put("bankCode", bankCode);
98 - return proxyPost("ufo.checkBankCard", url, params); 100 + return proxyPost("ufo.bankcard.checkBankCard", url, params);
99 } 101 }
100 102
101 103
@@ -109,7 +111,8 @@ public class BankcardController { @@ -109,7 +111,8 @@ public class BankcardController {
109 111
110 private ApiResponse proxyCall(String serviceName, String url, Map<String, Object> params) { 112 private ApiResponse proxyCall(String serviceName, String url, Map<String, Object> params) {
111 try { 113 try {
112 - params.put("from", "ufo"); 114 + // 接口调用者:1 UFO, 0 CPS
  115 + params.put("source", 1);
113 ApiResponse response = serviceCaller.get(serviceName, url, params, ApiResponse.class, null).get(500, TimeUnit.MILLISECONDS); 116 ApiResponse response = serviceCaller.get(serviceName, url, params, ApiResponse.class, null).get(500, TimeUnit.MILLISECONDS);
114 return response; 117 return response;
115 } catch (ServiceException e) { 118 } catch (ServiceException e) {