|
@@ -23,6 +23,7 @@ import javax.servlet.http.Part;
|
|
|
import java.io.IOException;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
|
+import java.util.Enumeration;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -183,19 +184,14 @@ public class ByteDanceVideoInfoController {
|
|
|
// if (null != event && event.equals("verify_webhook")) {
|
|
|
// return new CallbackResponse(BaseResponse.ok(), challenge);
|
|
|
// }
|
|
|
-
|
|
|
+ Enumeration<String> parameterNames = request.getParameterNames();
|
|
|
+ System.out.println("===============" + parameterNames);
|
|
|
// 订阅任务配置页面的 "验证密钥"
|
|
|
String secretKey = System.getenv("110a9016f5cf4e2fa40ebb2bd369da30");
|
|
|
-
|
|
|
- Map<String, String[]> parameterMap = request.getParameterMap();
|
|
|
- System.out.println("=============" + parameterMap);
|
|
|
- for (Map.Entry<String, String[]> stringEntry : parameterMap.entrySet()) {
|
|
|
- System.out.println("==========key:" + stringEntry.getKey() + " value:" + stringEntry.getValue());
|
|
|
- }
|
|
|
-
|
|
|
// 数据接收,验证消息
|
|
|
AuthTokenUtil.InputStreamCacher cacher = new AuthTokenUtil.InputStreamCacher(request.getInputStream());
|
|
|
boolean isValidToken = AuthTokenUtil.isValidToken(secretKey, cacher, request.getHeader("X-Open-Signature"));
|
|
|
+ System.out.println("isValidToken判断:"+isValidToken);
|
|
|
if (!isValidToken) {
|
|
|
return new CallbackResponse(new BaseResponse(400, "invalid token"), 0);
|
|
|
}
|
|
@@ -210,7 +206,7 @@ public class ByteDanceVideoInfoController {
|
|
|
// System.out.println(parse);
|
|
|
|
|
|
// 数据处理流程...
|
|
|
- return new CallbackResponse(BaseResponse.ok(), 0);
|
|
|
+ return new CallbackResponse(BaseResponse.ok(), challenge);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -235,10 +231,12 @@ public class ByteDanceVideoInfoController {
|
|
|
return new CallbackResponse(new BaseResponse(400, "invalid token"), 0);
|
|
|
}*/
|
|
|
|
|
|
- Map<String, String[]> parameterMap = request.getParameterMap();
|
|
|
- System.out.println("------------------" + parameterMap);
|
|
|
- String data = request.getParameter("data");
|
|
|
- System.out.println("============" + data);
|
|
|
+ Enumeration<String> parameterNames = request.getParameterNames();
|
|
|
+ System.out.println("------------------" + parameterNames);
|
|
|
+ String accountRelation = request.getParameter("accountRelation");
|
|
|
+ System.out.println("============" + accountRelation);
|
|
|
+ String advertiserIds = request.getParameter("advertiserIds");
|
|
|
+ System.out.println("============" + advertiserIds);
|
|
|
|
|
|
// JSONObject parse = JSONObject.parseObject(data);
|
|
|
// System.out.println(parse);
|