提交代碼

yy_dev
胡锐 1 year ago
parent e466112f39
commit 17fa2006ce
  1. 2
      bweb/src/main/resources/dev/application.yml
  2. 4
      open-api/src/main/java/com/api/controller/v1/TradeController.java
  3. 4
      service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.9.154.68:3306/gratia_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.9.154.68:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource

@ -332,8 +332,8 @@ public class TradeController {
if (!SignatureUtil.checkSign(body.getSign(), body, merKeyService.getKeyByMerNo(body.getMerchantNo()))) { if (!SignatureUtil.checkSign(body.getSign(), body, merKeyService.getKeyByMerNo(body.getMerchantNo()))) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, ""); throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, "");
} }
// 最大周期范围1个月 30 // 最大周期范围1个月 31
Long maxTime = 60*24*30L; Long maxTime = 60*24*31L;
if (maxTime.compareTo(DateUtil.getMinutesDiff(new Date(body.getBillDateS()), new Date(body.getBillDateE()))) < 0) { if (maxTime.compareTo(DateUtil.getMinutesDiff(new Date(body.getBillDateS()), new Date(body.getBillDateE()))) < 0) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "时间范围大于1个月"); throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "时间范围大于1个月");
} }

@ -83,8 +83,8 @@ public class SignatureUtil {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String paramStr = "{\n" + String paramStr = "{\n" +
" \"merchantNo\": \"2023051910562136809\",\n" + " \"merchantNo\": \"2023051910562136809\",\n" +
" \"billDateS\": 1690819200000,\n" + " \"billDateS\": 1688918400000,\n" +
" \"billDateE\": 1691078400000" + " \"billDateE\": 1691596800000\n" +
"}"; "}";
String sign = createSign(JSONObject.parseObject(paramStr), "NGixVhkzVYFFMj8tjj4zOkYQtUiU3bd4"); String sign = createSign(JSONObject.parseObject(paramStr), "NGixVhkzVYFFMj8tjj4zOkYQtUiU3bd4");
System.out.println(sign); System.out.println(sign);

Loading…
Cancel
Save