[+] 结构调整
This commit is contained in:
@@ -5,9 +5,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.acgist.taoyao.boot.config.MediaProperties;
|
||||
import com.acgist.taoyao.boot.config.WebrtcProperties;
|
||||
import com.acgist.taoyao.boot.model.Message;
|
||||
import com.acgist.taoyao.boot.property.MediaProperties;
|
||||
import com.acgist.taoyao.boot.property.WebrtcProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.acgist.taoyao.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.acgist.taoyao.boot.model.Message;
|
||||
import com.acgist.taoyao.signal.protocol.media.MediaRebootProtocol;
|
||||
import com.acgist.taoyao.signal.protocol.media.MediaShutdownProtocol;
|
||||
import com.acgist.taoyao.signal.protocol.platform.PlatformRebootProtocol;
|
||||
import com.acgist.taoyao.signal.protocol.platform.PlatformShutdownProtocol;
|
||||
import com.acgist.taoyao.signal.protocol.system.SystemRebootProtocol;
|
||||
import com.acgist.taoyao.signal.protocol.system.SystemShutdownProtocol;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
/**
|
||||
* 控制
|
||||
*
|
||||
* @author acgist
|
||||
*/
|
||||
@Tag(name = "控制", description = "控制管理")
|
||||
@RestController
|
||||
@RequestMapping("/control")
|
||||
public class ControlController {
|
||||
|
||||
@Autowired
|
||||
private MediaRebootProtocol mediaRebootProtocol;
|
||||
@Autowired
|
||||
private MediaShutdownProtocol mediaShutdownProtocol;
|
||||
@Autowired
|
||||
private SystemRebootProtocol systemRebootProtocol;
|
||||
@Autowired
|
||||
private SystemShutdownProtocol systemShutdownProtocol;
|
||||
@Autowired
|
||||
private PlatformRebootProtocol platformRebootProtocol;
|
||||
@Autowired
|
||||
private PlatformShutdownProtocol platformShutdownProtocol;
|
||||
|
||||
@Operation(summary = "重启媒体", description = "重启媒体")
|
||||
@GetMapping("/media/reboot/{mediaId}")
|
||||
public Message mediaReboot(@PathVariable String mediaId) {
|
||||
this.mediaRebootProtocol.execute(mediaId);
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "关闭媒体", description = "关闭媒体")
|
||||
@GetMapping("/media/shutdown/{mediaId}")
|
||||
public Message mediaShutdown(@PathVariable String mediaId) {
|
||||
this.mediaShutdownProtocol.execute(mediaId);
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "重启系统", description = "重启系统")
|
||||
@GetMapping("/system/reboot")
|
||||
public Message systemReboot() {
|
||||
this.systemRebootProtocol.execute();
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "关闭系统", description = "关闭系统")
|
||||
@GetMapping("/system/shutdown")
|
||||
public Message systemShutdown() {
|
||||
this.systemShutdownProtocol.execute();
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "重启平台", description = "重启平台")
|
||||
@GetMapping("/platform/reboot")
|
||||
public Message platformReboot() {
|
||||
this.platformRebootProtocol.execute();
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "关闭平台", description = "关闭平台")
|
||||
@GetMapping("/platform/shutdown")
|
||||
public Message platformShutdown() {
|
||||
this.platformShutdownProtocol.execute();
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,8 +9,8 @@ import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import com.acgist.taoyao.boot.config.SecurityProperties;
|
||||
import com.acgist.taoyao.boot.interceptor.InterceptorAdapter;
|
||||
import com.acgist.taoyao.boot.property.SecurityProperties;
|
||||
import com.acgist.taoyao.signal.service.SecurityService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.acgist.taoyao.interceptor;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.acgist.taoyao.boot.config.TaoyaoProperties;
|
||||
import com.acgist.taoyao.boot.interceptor.InterceptorAdapter;
|
||||
import com.acgist.taoyao.boot.property.TaoyaoProperties;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -2,7 +2,9 @@ taoyao:
|
||||
media:
|
||||
media-server-list:
|
||||
- media-id: media-local-a
|
||||
enabled: true
|
||||
enabled: false
|
||||
rewrite-ip: true
|
||||
# host: 192.168.1.110
|
||||
host: 192.168.8.110
|
||||
port: 9443
|
||||
schema: wss
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
taoyao:
|
||||
media:
|
||||
media-server-list:
|
||||
- media-id: media-local-a
|
||||
enabled: true
|
||||
host: 192.168.1.110
|
||||
port: 9443
|
||||
schema: wss
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
security:
|
||||
permit: /v3/api-docs/**,/swagger-ui/**,/swagger-ui.html,/,/error,/index.html,/favicon.ico
|
||||
@@ -20,7 +20,7 @@ server:
|
||||
# context-path: /taoyao
|
||||
spring:
|
||||
profiles:
|
||||
active: local
|
||||
active: dev
|
||||
application:
|
||||
name: taoyao-signal-server
|
||||
servlet:
|
||||
@@ -51,6 +51,7 @@ taoyao:
|
||||
name: 桃夭信令服务
|
||||
version: 1.0.0
|
||||
description: 桃夭WebRTC信令服务
|
||||
ip-mask: 24
|
||||
timeout: 5000
|
||||
id:
|
||||
index: 0
|
||||
@@ -102,14 +103,16 @@ taoyao:
|
||||
media-server-list:
|
||||
- media-id: media-local-a
|
||||
enabled: true
|
||||
host: localhost
|
||||
rewrite-ip: true
|
||||
host: 127.0.0.1
|
||||
port: 9443
|
||||
schema: wss
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
- media-id: media-local-z
|
||||
enabled: true
|
||||
host: localhost
|
||||
rewrite-ip: true
|
||||
host: 127.0.0.1
|
||||
port: 9443
|
||||
schema: wss
|
||||
username: taoyao
|
||||
@@ -126,21 +129,21 @@ taoyao:
|
||||
thread-name-prefix: ${spring.application.name}-signal-
|
||||
keep-alive-time: 60000
|
||||
buffer-size: 2048
|
||||
# WebRTC配置:没有P2P所以不会用到
|
||||
# WebRTC配置
|
||||
webrtc:
|
||||
# STUN服务
|
||||
stun:
|
||||
- host: stun1.l.google.com
|
||||
port: 19302
|
||||
- host: stun2.l.google.com
|
||||
port: 19302
|
||||
# TURN服务:需要自己搭建coturn
|
||||
turn:
|
||||
- host: 192.168.1.110
|
||||
port: 3478
|
||||
- host: 192.168.8.110
|
||||
port: 3478
|
||||
# TURN服务
|
||||
turn:
|
||||
- host: 192.168.1.110
|
||||
port: 3478
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
- host: 192.168.8.111
|
||||
- host: 192.168.8.110
|
||||
port: 3478
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
@@ -158,8 +161,8 @@ taoyao:
|
||||
# 脚本配置
|
||||
script:
|
||||
enabled: true
|
||||
media-reboot: pm2 restart taoyao-media-server
|
||||
media-shutdown: pm2 stop taoyao-media-server
|
||||
media-reboot: pm2 restart taoyao-client-media
|
||||
media-shutdown: pm2 stop taoyao-client-media
|
||||
system-reboot: reboot
|
||||
system-shutdown: shutdown now
|
||||
platform-reboot: systemctl restart taoyao-signal-server
|
||||
|
||||
Reference in New Issue
Block a user