|
@@ -184,38 +184,27 @@ public class ByteDanceVideoInfoController {
|
|
// if (null != event && event.equals("verify_webhook")) {
|
|
// if (null != event && event.equals("verify_webhook")) {
|
|
// return new CallbackResponse(BaseResponse.ok(), challenge);
|
|
// return new CallbackResponse(BaseResponse.ok(), challenge);
|
|
// }
|
|
// }
|
|
- System.out.println("=========================");
|
|
|
|
- System.out.println("challenge= " + challenge);
|
|
|
|
- System.out.println("event= " + event);
|
|
|
|
|
|
+ log.info("=========================");
|
|
|
|
+ log.info("challenge= " + challenge);
|
|
|
|
+ log.info("event= " + event);
|
|
Enumeration pNames = request.getParameterNames();
|
|
Enumeration pNames = request.getParameterNames();
|
|
while (pNames.hasMoreElements()) {
|
|
while (pNames.hasMoreElements()) {
|
|
String name = (String) pNames.nextElement();
|
|
String name = (String) pNames.nextElement();
|
|
- System.out.println(name + " = " + request.getParameter(name));
|
|
|
|
|
|
+ log.info("---循环参数:" + name + " = " + request.getParameter(name));
|
|
}
|
|
}
|
|
|
|
|
|
- /* // 订阅任务配置页面的 "验证密钥"
|
|
|
|
- String secretKey = System.getenv("1e87cef23427480997cc60ea9f538ac9");
|
|
|
|
- System.out.println("secretKey= "+secretKey);
|
|
|
|
|
|
+ // 订阅任务配置页面的 "验证密钥"
|
|
|
|
+ String secretKey = "1e87cef23427480997cc60ea9f538ac9";
|
|
// 数据接收,验证消息
|
|
// 数据接收,验证消息
|
|
AuthTokenUtil.InputStreamCacher cacher = new AuthTokenUtil.InputStreamCacher(request.getInputStream());
|
|
AuthTokenUtil.InputStreamCacher cacher = new AuthTokenUtil.InputStreamCacher(request.getInputStream());
|
|
- System.out.println("cacher= "+cacher);
|
|
|
|
|
|
+ log.info("cacher= " + cacher);
|
|
boolean isValidToken = AuthTokenUtil.isValidToken(secretKey, cacher, request.getHeader("X-Open-Signature"));
|
|
boolean isValidToken = AuthTokenUtil.isValidToken(secretKey, cacher, request.getHeader("X-Open-Signature"));
|
|
- System.out.println("isValidToken=" + isValidToken);
|
|
|
|
|
|
+ log.info("isValidToken=" + isValidToken);
|
|
if (!isValidToken) {
|
|
if (!isValidToken) {
|
|
return new CallbackResponse(new BaseResponse(400, "invalid token"), 0);
|
|
return new CallbackResponse(new BaseResponse(400, "invalid token"), 0);
|
|
}
|
|
}
|
|
-
|
|
|
|
- Map<String, String[]> parameterMap2 = request.getParameterMap();
|
|
|
|
- System.out.println("------------------" + parameterMap2);
|
|
|
|
- for (Map.Entry<String, String[]> stringEntry : parameterMap2.entrySet()) {
|
|
|
|
- System.out.println("--------------key:" + stringEntry.getKey() + " value:" + stringEntry.getValue());
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
-// JSONObject parse = JSONObject.parseObject(data);
|
|
|
|
-// System.out.println(parse);
|
|
|
|
-
|
|
|
|
// 数据处理流程...
|
|
// 数据处理流程...
|
|
- return new CallbackResponse(BaseResponse.ok(), challenge);
|
|
|
|
|
|
+ return new CallbackResponse(BaseResponse.ok(), 0);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -225,10 +214,6 @@ public class ByteDanceVideoInfoController {
|
|
public CallbackResponse illegalVideosPush2(HttpServletRequest request,
|
|
public CallbackResponse illegalVideosPush2(HttpServletRequest request,
|
|
@RequestParam(value = "challenge", defaultValue = "0") int challenge,
|
|
@RequestParam(value = "challenge", defaultValue = "0") int challenge,
|
|
@RequestParam(value = "event", defaultValue = "") String event) throws IOException {
|
|
@RequestParam(value = "event", defaultValue = "") String event) throws IOException {
|
|
- // 处理 verify 事件
|
|
|
|
-// if (null != event && event.equals("verify_webhook")) {
|
|
|
|
-// return new CallbackResponse(BaseResponse.ok(), challenge);
|
|
|
|
-// }
|
|
|
|
System.out.println("=========================");
|
|
System.out.println("=========================");
|
|
System.out.println("challenge= " + challenge);
|
|
System.out.println("challenge= " + challenge);
|
|
System.out.println("event= " + event);
|
|
System.out.println("event= " + event);
|
|
@@ -237,7 +222,7 @@ public class ByteDanceVideoInfoController {
|
|
String name = (String) pNames.nextElement();
|
|
String name = (String) pNames.nextElement();
|
|
System.out.println(name + " = " + request.getParameter(name));
|
|
System.out.println(name + " = " + request.getParameter(name));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+/*
|
|
// 订阅任务配置页面的 "验证密钥"
|
|
// 订阅任务配置页面的 "验证密钥"
|
|
String secretKey = "1e87cef23427480997cc60ea9f538ac9";
|
|
String secretKey = "1e87cef23427480997cc60ea9f538ac9";
|
|
// 数据接收,验证消息
|
|
// 数据接收,验证消息
|
|
@@ -253,7 +238,7 @@ public class ByteDanceVideoInfoController {
|
|
System.out.println("------------------" + parameterMap2);
|
|
System.out.println("------------------" + parameterMap2);
|
|
for (Map.Entry<String, String[]> stringEntry : parameterMap2.entrySet()) {
|
|
for (Map.Entry<String, String[]> stringEntry : parameterMap2.entrySet()) {
|
|
System.out.println("--------------key:" + stringEntry.getKey() + " value:" + stringEntry.getValue());
|
|
System.out.println("--------------key:" + stringEntry.getKey() + " value:" + stringEntry.getValue());
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
// 数据处理流程...
|
|
// 数据处理流程...
|