新增srs rtmp回调接口
This commit is contained in:
parent
5fa7d5feab
commit
1ce76e9f56
@ -1,58 +0,0 @@
|
||||
package ink.wgink.module.file.media.controller.api.srs.rtmp;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.result.SuccessResultCode;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName: RtmpController
|
||||
* @Description: rtmp 回调
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/4/22 10:39
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "rtmp接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/rtmp")
|
||||
public class RtmpCallbackController extends DefaultBaseController {
|
||||
|
||||
@PostMapping("on-connect")
|
||||
public SuccessResultCode<Integer> onConnect() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-onClose")
|
||||
public SuccessResultCode<Integer> onClose() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-onPublish")
|
||||
public SuccessResultCode<Integer> onPublish() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-onUnPublish")
|
||||
public SuccessResultCode<Integer> onUnPublish() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-onPlay")
|
||||
public SuccessResultCode<Integer> onPlay() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-onStop")
|
||||
public SuccessResultCode<Integer> onStop() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-onDvr")
|
||||
public SuccessResultCode<Integer> onDvr() {
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package ink.wgink.module.file.media.controller.app.srs.rtmp;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.file.media.pojo.vos.srs.rtmp.RtmpCallbackVO;
|
||||
import ink.wgink.pojo.result.SuccessResultCode;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName: RtmpController
|
||||
* @Description: rtmp 回调
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/4/22 10:39
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "rtmp回调接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.APP_PREFIX + "/rtmp-callback")
|
||||
public class RtmpCallbackAppController extends DefaultBaseController {
|
||||
|
||||
@PostMapping("on-connect")
|
||||
public SuccessResultCode<Integer> onConnect(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onConnect");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-close")
|
||||
public SuccessResultCode<Integer> onClose(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onClose");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-publish")
|
||||
public SuccessResultCode<Integer> onPublish(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onPublish");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-unpublish")
|
||||
public SuccessResultCode<Integer> onUnPublish(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onUnPublish");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-play")
|
||||
public SuccessResultCode<Integer> onPlay(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onPlay");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-stop")
|
||||
public SuccessResultCode<Integer> onStop(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onStop");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
@PostMapping("on-dvr")
|
||||
public SuccessResultCode<Integer> onDvr(@RequestBody RtmpCallbackVO rtmpCallbackVO) {
|
||||
System.out.println("onDvr");
|
||||
System.out.println(rtmpCallbackVO);
|
||||
return new SuccessResultCode<>(0);
|
||||
}
|
||||
|
||||
}
|
@ -21,5 +21,145 @@ public class RtmpCallbackVO {
|
||||
private String pageUrl;
|
||||
private String send_bytes;
|
||||
private String recv_bytes;
|
||||
private String stream;
|
||||
private String param;
|
||||
private String cwd;
|
||||
private String file;
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getClient_id() {
|
||||
return client_id;
|
||||
}
|
||||
|
||||
public void setClient_id(String client_id) {
|
||||
this.client_id = client_id;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getVhost() {
|
||||
return vhost;
|
||||
}
|
||||
|
||||
public void setVhost(String vhost) {
|
||||
this.vhost = vhost;
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getTcUrl() {
|
||||
return tcUrl;
|
||||
}
|
||||
|
||||
public void setTcUrl(String tcUrl) {
|
||||
this.tcUrl = tcUrl;
|
||||
}
|
||||
|
||||
public String getPageUrl() {
|
||||
return pageUrl;
|
||||
}
|
||||
|
||||
public void setPageUrl(String pageUrl) {
|
||||
this.pageUrl = pageUrl;
|
||||
}
|
||||
|
||||
public String getSend_bytes() {
|
||||
return send_bytes;
|
||||
}
|
||||
|
||||
public void setSend_bytes(String send_bytes) {
|
||||
this.send_bytes = send_bytes;
|
||||
}
|
||||
|
||||
public String getRecv_bytes() {
|
||||
return recv_bytes;
|
||||
}
|
||||
|
||||
public void setRecv_bytes(String recv_bytes) {
|
||||
this.recv_bytes = recv_bytes;
|
||||
}
|
||||
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public String getParam() {
|
||||
return param;
|
||||
}
|
||||
|
||||
public void setParam(String param) {
|
||||
this.param = param;
|
||||
}
|
||||
|
||||
public String getCwd() {
|
||||
return cwd;
|
||||
}
|
||||
|
||||
public void setCwd(String cwd) {
|
||||
this.cwd = cwd;
|
||||
}
|
||||
|
||||
public String getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(String file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{\"RtmpCallbackVO\":{"
|
||||
+ "\"action\":\""
|
||||
+ action + '\"'
|
||||
+ ",\"client_id\":\""
|
||||
+ client_id + '\"'
|
||||
+ ",\"ip\":\""
|
||||
+ ip + '\"'
|
||||
+ ",\"vhost\":\""
|
||||
+ vhost + '\"'
|
||||
+ ",\"app\":\""
|
||||
+ app + '\"'
|
||||
+ ",\"tcUrl\":\""
|
||||
+ tcUrl + '\"'
|
||||
+ ",\"pageUrl\":\""
|
||||
+ pageUrl + '\"'
|
||||
+ ",\"send_bytes\":\""
|
||||
+ send_bytes + '\"'
|
||||
+ ",\"recv_bytes\":\""
|
||||
+ recv_bytes + '\"'
|
||||
+ ",\"stream\":\""
|
||||
+ stream + '\"'
|
||||
+ ",\"param\":\""
|
||||
+ param + '\"'
|
||||
+ ",\"cwd\":\""
|
||||
+ cwd + '\"'
|
||||
+ ",\"file\":\""
|
||||
+ file + '\"'
|
||||
+ "}}";
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user