|
|
@@ -2,6 +2,7 @@ package cn.reghao.tnb.account.app.controller;
|
|
|
|
|
|
import cn.reghao.tnb.account.app.model.vo.RtmpPlay;
|
|
|
import cn.reghao.tnb.account.app.model.vo.RtmpRecord;
|
|
|
+import cn.reghao.tnb.account.app.util.RabbitProducer;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -21,10 +22,18 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/api/auth/rtmp")
|
|
|
@Slf4j
|
|
|
public class AccountRtmpController {
|
|
|
+ private final RabbitProducer rabbitProducer;
|
|
|
+
|
|
|
+ public AccountRtmpController(RabbitProducer rabbitProducer) {
|
|
|
+ this.rabbitProducer = rabbitProducer;
|
|
|
+ }
|
|
|
+
|
|
|
@Operation(summary = "rtmp publish 回调", description = "N")
|
|
|
@PostMapping(value = "/on_publish", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> rtmpOnPublish(RtmpPlay rtmpPlay) {
|
|
|
+ rabbitProducer.sendRtmpMessage(rtmpPlay);
|
|
|
log.info("rtmp publish event...");
|
|
|
+
|
|
|
int statusCode = HttpStatus.OK.value();
|
|
|
int statusCode1 = HttpStatus.UNAUTHORIZED.value();
|
|
|
String body = "";
|
|
|
@@ -34,7 +43,9 @@ public class AccountRtmpController {
|
|
|
@Operation(summary = "rtmp publish done 回调", description = "N")
|
|
|
@PostMapping(value = "/on_publish_done", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> rtmpOnPublishDone(RtmpPlay rtmpPlay) {
|
|
|
+ rabbitProducer.sendRtmpMessage(rtmpPlay);
|
|
|
log.info("rtmp publish done event...");
|
|
|
+
|
|
|
int statusCode = 200;
|
|
|
String body = "";
|
|
|
return ResponseEntity.status(statusCode).body(body);
|
|
|
@@ -43,7 +54,9 @@ public class AccountRtmpController {
|
|
|
@Operation(summary = "rtmp play 回调", description = "N")
|
|
|
@PostMapping(value = "/on_play", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> rtmpOnPlay(RtmpPlay rtmpPlay) {
|
|
|
+ rabbitProducer.sendRtmpMessage(rtmpPlay);
|
|
|
log.info("rtmp play event...");
|
|
|
+
|
|
|
int statusCode = 200;
|
|
|
String body = "";
|
|
|
return ResponseEntity.status(statusCode).body(body);
|
|
|
@@ -52,7 +65,9 @@ public class AccountRtmpController {
|
|
|
@Operation(summary = "rtmp play done 回调", description = "N")
|
|
|
@PostMapping(value = "/on_play_done", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> rtmpOnPlayDone(RtmpPlay rtmpPlay) {
|
|
|
+ rabbitProducer.sendRtmpMessage(rtmpPlay);
|
|
|
log.info("rtmp play done event...");
|
|
|
+
|
|
|
int statusCode = 200;
|
|
|
String body = "";
|
|
|
return ResponseEntity.status(statusCode).body(body);
|
|
|
@@ -61,7 +76,9 @@ public class AccountRtmpController {
|
|
|
@Operation(summary = "rtmp record done 回调", description = "N")
|
|
|
@PostMapping(value = "/on_record_done", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> rtmpOnRecordDone(RtmpRecord rtmpRecord) {
|
|
|
+ //rabbitProducer.sendRtmpMessage(rtmpPlay);
|
|
|
log.info("rtmp record done event...");
|
|
|
+
|
|
|
int statusCode = 200;
|
|
|
String body = "";
|
|
|
return ResponseEntity.status(statusCode).body(body);
|