|
@@ -0,0 +1,35 @@
|
|
|
|
|
+package com.middle.platform.stream.biz.controller;
|
|
|
|
|
+
|
|
|
|
|
+import cn.dev33.satoken.annotation.SaIgnore;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.middle.platform.common.core.utils.DateTimeUtil;
|
|
|
|
|
+import com.middle.platform.common.core.utils.Result;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @author xucaiqin
|
|
|
|
|
+ * @date 2024-05-14 09:49:14
|
|
|
|
|
+ */
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/hook")
|
|
|
|
|
+public class HookController {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 事件对应关系
|
|
|
|
|
+ * 对方拉取monibuca流 对应 subscribe事件
|
|
|
|
|
+ * 对方断开拉取monibuca流 对应 unsubscribe事件
|
|
|
|
|
+ * 对方主动推流至monibuca 对应 publish事件
|
|
|
|
|
+ * 流关闭 对应 streamClose事件
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param object
|
|
|
|
|
+ * @param path
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @SaIgnore
|
|
|
|
|
+ @PostMapping("/{path}")
|
|
|
|
|
+ public Result<Object> server(@RequestBody Object object, @PathVariable String path) {
|
|
|
|
|
+ log.info("path:{} object:{}", path, JSONObject.toJSONString(object));
|
|
|
|
|
+ return Result.ok(DateTimeUtil.nowStr());
|
|
|
|
|
+ }
|
|
|
|
|
+}
|