dev-discount
= 3 years ago
commit 545e0c57fc
  1. 18
      hai-bweb/src/main/java/com/bweb/controller/TelApiController.java
  2. 20
      hai-service/src/main/java/com/hai/common/utils/MD5Util.java
  3. 37
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  4. 35
      hai-service/src/main/java/com/hai/config/TelConfig.java
  5. 1
      hai-service/src/main/java/com/hai/service/TelApiService.java
  6. 9
      hai-service/src/main/java/com/hai/service/impl/TelApiServiceImpl.java
  7. 5
      hai-service/src/main/resources/dev/commonConfig.properties
  8. 4
      hai-service/src/main/resources/prod/commonConfig.properties

@ -8,8 +8,12 @@ import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.IOUtil;
import com.hai.common.pay.util.XmlUtil;
import com.hai.common.utils.*;
import com.hai.config.CommonSysConst;
import com.hai.config.QianZhuConfig;
import com.hai.config.TelConfig;
import com.hai.entity.HighDiscount;
import com.hai.entity.HighTelOrder;
import com.hai.entity.HighUser;
import com.hai.model.ResponseData;
import com.hai.service.TelApiService;
import io.swagger.annotations.Api;
@ -164,4 +168,18 @@ public class TelApiController {
}
@RequestMapping(value = "/getMemberGoods", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取渠道商获取关联商品")
public ResponseData getMemberGoods() {
try {
JSONObject data = TelConfig.getMemberGoods();
return ResponseMsgUtil.success(data);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -42,7 +42,25 @@ public class MD5Util {
String newstr=base64en.encodeToString(md5.digest(str.getBytes("utf-8")));
return newstr;
}*/
public static String encodeS(byte[] data) throws Exception {
// 初始化MessageDigest
MessageDigest md = MessageDigest.getInstance("MD5");
// 执行摘要信息
byte[] digest = md.digest(data);
// 将摘要信息转换为32位的十六进制字符串
return new HexBinaryAdapter().marshal(digest);
}
/* public static String EncoderByMd5(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException{
//确定计算方法
MessageDigest md5=MessageDigest.getInstance("MD5");
Encoder base64en = Base64.getEncoder();
//加密后的字符串
String newstr=base64en.encodeToString(md5.digest(str.getBytes("utf-8")));
return newstr;
}*/
public static void main(String[] args) throws Exception {
String str = "123456";
System.out.println(MD5Util.encode(str.getBytes("UTF-8")));

@ -21,6 +21,11 @@ public class CommonSysConfig {
private String wx_cert;
private String telApiKey;
private String telApiSecret;
private String telMemberId;
private String telUrl;
public String getTuanYouUrl() {
return tuanYouUrl;
}
@ -92,4 +97,36 @@ public class CommonSysConfig {
public void setWx_cert(String wx_cert) {
this.wx_cert = wx_cert;
}
public String getTelApiKey() {
return telApiKey;
}
public void setTelApiKey(String telApiKey) {
this.telApiKey = telApiKey;
}
public String getTelApiSecret() {
return telApiSecret;
}
public void setTelApiSecret(String telApiSecret) {
this.telApiSecret = telApiSecret;
}
public String getTelMemberId() {
return telMemberId;
}
public void setTelMemberId(String telMemberId) {
this.telMemberId = telMemberId;
}
public String getTelUrl() {
return telUrl;
}
public void setTelUrl(String telUrl) {
this.telUrl = telUrl;
}
}

@ -0,0 +1,35 @@
package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName TelConfig
* @Author Sum1Dream
* @Version 1.0.0
* @Description // 话费接口配置
* @Date 2021/7/18 14:18
**/
public class TelConfig {
public static JSONObject getMemberGoods() throws Exception {
Map<String,Object> map = new HashMap<>();
Long time = new Date().getTime();
String sign = CommonSysConst.getSysConfig().getTelApiSecret() + "_" + time;
map.put("apiKey", CommonSysConst.getSysConfig().getTelApiKey());
map.put("memberId", CommonSysConst.getSysConfig().getTelMemberId());
map.put("time", time);
map.put("sign", MD5Util.encode(sign.getBytes()).toLowerCase());
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getTelUrl()+ "/getMemberGoods", map);
}
}

@ -71,5 +71,6 @@ public interface TelApiService {
**/
JSONObject outApiTel(String tel);
JSONObject getMemberGoods();
}

@ -87,4 +87,13 @@ public class TelApiServiceImpl implements TelApiService {
querys.put("shouji", tel);
return HttpsUtils.doGet("https://jshmgsdmfb.market.alicloudapi.com/shouji/query", querys , headers);
}
@Override
public JSONObject getMemberGoods() {
Map<String , String> map = new HashMap<>();
return null;
}
}

@ -9,3 +9,8 @@ qinzhuPlatformId=10376
qinzhuSecret=ktxb49sh2jfhgn8g
wx_cert=/home/project/wx_cert/
telApiKey=2d01f6b520254b1a80f6b167832cea18
telApiSecret=d11ee9b41e014a039f030e53ae6f5295
telMemberId=d13091df65d64aafbf0f35d2093157b7
telUrl=http://cz.jjcxy.com:80/api/2d01f6b520254b1a80f6b167832cea18

@ -9,3 +9,7 @@ qinzhuPlatformId=10376
qinzhuSecret=ktxb49sh2jfhgn8g
wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18
TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7

Loading…
Cancel
Save