视频转码

This commit is contained in:
bianyadong
2024-05-07 19:56:31 +08:00
parent 7dec4b8c47
commit 847e1822d0
16 changed files with 982 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ public class TokenValidateFilter implements Filter {
"/**/swagger*/**", "/**/webjars/**",
//腾讯音视频回调,单独做验签
"/xfsg/pc/video/**",
"/xfsg/pc/vod/callback",
"/xfsg/pc/sysRole/**",
"/xfsg/**/api/audit/result",
"/xfsg/pc/video/**",

View File

@@ -0,0 +1,46 @@
package com.cool.store.controller.webb;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.service.VodService;
import com.cool.store.utils.vod.AliResponseUtil;
import com.cool.store.utils.vod.CallbackRequest;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* @author byd
* @date 2024-05-07 19:13
*/
@RestController
@RequestMapping("pc/vod")
@Api(tags = "视频回调接口")
@Slf4j
public class VodController {
@Autowired
private VodService vodService;
@RequestMapping("callback")
public JSONObject callback(HttpServletRequest request) throws IOException {
log.info("=================================");
log.info("VOD视频回调");
String cl = request.getHeader("content-length");
log.info("content-length:" + cl);
String vodCallbackBody = AliResponseUtil.GetPostBody(request.getInputStream(), Integer.parseInt(cl));
log.info("vodCallbackBody:" + vodCallbackBody);
CallbackRequest callback = JSON.parseObject(vodCallbackBody, CallbackRequest.class);
log.info("callback" + JSON.toJSONString(callback));
vodService.callback(callback);
log.info("=================================");
JSONObject jsonObject = new JSONObject();
jsonObject.put("Status", "OK");
return jsonObject;
}
}