|
@@ -1,6 +1,8 @@
|
|
|
package com.ruixuan.isc.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.kuaishou.merchant.open.api.KsMerchantApiException;
|
|
|
+import com.kuaishou.merchant.open.api.common.utils.KsStringUtils;
|
|
|
import com.kuaishou.merchant.open.api.common.utils.PlatformEventSecurityUtil;
|
|
|
import com.ruixuan.common.core.controller.BaseController;
|
|
|
import com.ruixuan.common.core.page.TableDataInfo;
|
|
@@ -12,10 +14,14 @@ import com.ruixuan.isc.service.ISupplyChainService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.SneakyThrows;
|
|
|
+import org.apache.commons.codec.binary.Base64;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.crypto.Cipher;
|
|
|
+import javax.crypto.spec.IvParameterSpec;
|
|
|
+import javax.crypto.spec.SecretKeySpec;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
@@ -1881,7 +1887,12 @@ public class SupplyChainController extends BaseController {
|
|
|
@PostMapping(value = "/accept")
|
|
|
public Map<String, Object> acceptEvent(@RequestBody String eventsEncoded) {
|
|
|
System.err.println(eventsEncoded);
|
|
|
- // String events = PlatformEventSecurityUtil.decode(eventsEncoded, null);
|
|
|
+ try {
|
|
|
+ String events = PlatformEventSecurityUtil.decode(eventsEncoded, "JRowMMndTkSlvVORNvtJbw==");
|
|
|
+ logger.info("回调信息:",events);
|
|
|
+ } catch (KsMerchantApiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
//events为明文,这里加入自己代码逻辑
|
|
|
|
|
|
//返回成功
|
|
@@ -1891,4 +1902,5 @@ public class SupplyChainController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|