Authored by ken.hu

u

... ... @@ -11,6 +11,7 @@ import com.yoho.global.model.constant.ApiCode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
... ... @@ -29,6 +30,9 @@ public class YHRestCaller {
private String yhbUrl = "http://api.yoho.cn";
@Value("${erp.gateway.address}")
private String erpGatewayAddress;
private String yhbClientType = "web";
private String yhbClientKey = "0ed29744ed318fd28d2c07985d3ba633";
... ... @@ -82,13 +86,19 @@ public class YHRestCaller {
}
// TODO: 2017/11/29 增加临时写死低版本号
requestParams.put("app_version","6.2.3");
String sign = getSign(requestParams);
requestParams.put("client_secret", sign);
ApiResponse apiResp;
//not YHMethodContants.APP_PASSPORT_VERIFY
if (!StringUtils.equals(YHMethodContants.APP_PASSPORT_VERIFY,method)){
//调用erp-gateway
requestParams.put("_sncp", "NGJjYjhkNmwwZGM0OTk0YmQyMTMwZjlmoTZmzjY4cjN");
apiResp = get(erpGatewayAddress, requestParams, ApiResponse.class);
}else {
//调用gateway
apiResp = get(yhbUrl, requestParams, ApiResponse.class);
}
String sign = getSign(requestParams);
requestParams.put("client_secret", sign);
ApiResponse apiResp = get(yhbUrl, requestParams, ApiResponse.class);
if(apiResp == null || apiResp.getCode() != 200) {
logger.warn("yhbGetMethod failed, respCode: {}, respMessage: {}, url: {}, requestParams: {}", apiResp.getCode(), apiResp.getMessage(), yhbUrl, requestParams);
throw new ServiceException(ServiceError.SYSTEM);
... ...
... ... @@ -33,4 +33,7 @@ redis.pool.testOnBorrow=false
redis.pool.testWhileIdle=true
global.task.host=172.16.6.73
file.saveDir=d:/upload/
\ No newline at end of file
file.saveDir=d:/upload/
#erp-gateway
erp.gateway.address=http://192.168.103.73:8089/erp-gateway
\ No newline at end of file
... ...
... ... @@ -33,3 +33,6 @@ redis.pool.testWhileIdle=${redis.pool.testWhileIdle}
global.task.host=${global.task.host}
file.saveDir=${file.saveDir}
#erp-gateway
erp.gateway.address=${erp.gateway.address}
\ No newline at end of file
... ...