|
|
|
@ -28,6 +28,12 @@ public class JinZhuJiaYouService { |
|
|
|
|
|
|
|
|
|
private final static String reqUrl = "http://api.jianshiyun.com/api/gateway"; |
|
|
|
|
|
|
|
|
|
private final static String appId = CommonSysConst.getSysConfig().getJzAppId(); |
|
|
|
|
|
|
|
|
|
private final static String privateKeyUrl = CommonSysConst.getSysConfig().getJzPrivateKeyUrl(); |
|
|
|
|
|
|
|
|
|
private final static String publicKeyUrl = CommonSysConst.getSysConfig().getJzPublicKeyUrl(); |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsTripartiteReqLogService reqLogService; |
|
|
|
|
|
|
|
|
@ -111,7 +117,7 @@ public class JinZhuJiaYouService { |
|
|
|
|
private JSONObject request(String service, Map<String,Object> param) throws Exception { |
|
|
|
|
// 请求头部
|
|
|
|
|
Map<String, Object> heard = new HashMap<>(); |
|
|
|
|
heard.put("Request-App-Id", "app_xiaohan_test_01"); |
|
|
|
|
heard.put("Request-App-Id", appId); |
|
|
|
|
heard.put("Request-Service-Name", service); |
|
|
|
|
heard.put("Request-Signature", generateSign(param)); |
|
|
|
|
|
|
|
|
@ -139,7 +145,7 @@ public class JinZhuJiaYouService { |
|
|
|
|
* @throws Exception |
|
|
|
|
*/ |
|
|
|
|
private static String generateSign(final Map<String, Object> data) throws IOException { |
|
|
|
|
PrivateKey privateKey = PemUtil.loadPrivateKey(new FileInputStream("/home/project/hsg/jzKey.key")); |
|
|
|
|
PrivateKey privateKey = PemUtil.loadPrivateKey(new FileInputStream(privateKeyUrl)); |
|
|
|
|
String signStr = null; |
|
|
|
|
try { |
|
|
|
|
Signature sign = Signature.getInstance("SHA256withRSA"); |
|
|
|
|