[*] 优化内容
This commit is contained in:
@@ -66,15 +66,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
@Import({
|
@Import({ TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class })
|
||||||
TaskExecutionAutoConfiguration.class,
|
|
||||||
TaskSchedulingAutoConfiguration.class
|
|
||||||
})
|
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||||
@EnableConfigurationProperties({ TaoyaoProperties.class, SecurityProperties.class })
|
@EnableConfigurationProperties({ TaoyaoProperties.class, WebrtcProperties.class, SecurityProperties.class })
|
||||||
public class BootAutoConfiguration {
|
public class BootAutoConfiguration {
|
||||||
|
|
||||||
@Value("${spring.application.name:taoyao}")
|
@Value("${spring.application.name:taoyao}")
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import lombok.Setter;
|
|||||||
@ConfigurationProperties(prefix = "taoyao")
|
@ConfigurationProperties(prefix = "taoyao")
|
||||||
public class TaoyaoProperties {
|
public class TaoyaoProperties {
|
||||||
|
|
||||||
private TaoyaoProperties() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址
|
* 地址
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.acgist.taoyao.boot.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WebRTC配置
|
||||||
|
*
|
||||||
|
* @author acgist
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Schema(name = "WebRTC配置")
|
||||||
|
@ConfigurationProperties(prefix = "taoyao.webrtc")
|
||||||
|
public class WebrtcProperties {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*
|
||||||
|
* @author acgist
|
||||||
|
*/
|
||||||
|
public enum Type {
|
||||||
|
|
||||||
|
SFU,
|
||||||
|
MCU,
|
||||||
|
MESH;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@Schema(name = "类型", description = "WebRTC媒体架构")
|
||||||
|
private Type type;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
|
|
||||||
import com.acgist.taoyao.boot.utils.JSONUtils;
|
import com.acgist.taoyao.boot.utils.JSONUtils;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@@ -18,6 +19,7 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@Schema(name = "响应消息", description = "HTTP响应消息")
|
||||||
public class Message<T> implements Serializable {
|
public class Message<T> implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -25,14 +27,17 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 响应编码
|
* 响应编码
|
||||||
*/
|
*/
|
||||||
|
@Schema(name = "响应编码", description = "0000表示成功其他都是失败")
|
||||||
private String code;
|
private String code;
|
||||||
/**
|
/**
|
||||||
* 响应描述
|
* 响应描述
|
||||||
*/
|
*/
|
||||||
|
@Schema(name = "响应描述", description = "响应编码描述")
|
||||||
private String message;
|
private String message;
|
||||||
/**
|
/**
|
||||||
* 消息内容
|
* 响应内容
|
||||||
*/
|
*/
|
||||||
|
@Schema(name = "响应内容", description = "响应内容")
|
||||||
private T body;
|
private T body;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,7 +54,7 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 成功消息
|
* 成功消息
|
||||||
*
|
*
|
||||||
* @param <T> 消息类型
|
* @param <T> 消息类型
|
||||||
*
|
*
|
||||||
* @param body 消息内容
|
* @param body 消息内容
|
||||||
*
|
*
|
||||||
@@ -77,7 +82,7 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*
|
*
|
||||||
* @param <T> 消息类型
|
* @param <T> 消息类型
|
||||||
*
|
*
|
||||||
* @param message 消息内容
|
* @param message 消息内容
|
||||||
*
|
*
|
||||||
@@ -90,7 +95,7 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*
|
*
|
||||||
* @param <T> 消息类型
|
* @param <T> 消息类型
|
||||||
*
|
*
|
||||||
* @param code 错误编码
|
* @param code 错误编码
|
||||||
*
|
*
|
||||||
@@ -103,9 +108,9 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*
|
*
|
||||||
* @param <T> 消息类型
|
* @param <T> 消息类型
|
||||||
*
|
*
|
||||||
* @param code 错误编码
|
* @param code 错误编码
|
||||||
* @param message 错误描述
|
* @param message 错误描述
|
||||||
*
|
*
|
||||||
* @return 错误消息
|
* @return 错误消息
|
||||||
@@ -124,7 +129,7 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*
|
*
|
||||||
* @param <T> 消息类型
|
* @param <T> 消息类型
|
||||||
*
|
*
|
||||||
* @param code 错误编码
|
* @param code 错误编码
|
||||||
* @param body 消息内容
|
* @param body 消息内容
|
||||||
@@ -142,11 +147,11 @@ public class Message<T> implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*
|
*
|
||||||
* @param <T> 消息类型
|
* @param <T> 消息类型
|
||||||
*
|
*
|
||||||
* @param code 错误编码
|
* @param code 错误编码
|
||||||
* @param message 错误描述
|
* @param message 错误描述
|
||||||
* @param body 消息内容
|
* @param body 消息内容
|
||||||
*
|
*
|
||||||
* @return 错误消息
|
* @return 错误消息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.acgist.taoyao.meeting.controller;
|
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 房间
|
|
||||||
*
|
|
||||||
* @author acgist
|
|
||||||
*/
|
|
||||||
@Tag(name = "房间", description = "房间管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/room")
|
|
||||||
public class RoomController {
|
|
||||||
|
|
||||||
@Operation(summary = "进入房间", description = "进入房间,如果房间不存在时自动创建。")
|
|
||||||
@GetMapping("/enter")
|
|
||||||
public void enter(String roomId) {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>com.acgist.taoyao.TaoyaoApplication</mainClass>
|
<mainClass>com.acgist.taoyao.main.TaoyaoApplication</mainClass>
|
||||||
<addClasspath>true</addClasspath>
|
<addClasspath>true</addClasspath>
|
||||||
<classpathPrefix>./</classpathPrefix>
|
<classpathPrefix>./</classpathPrefix>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.acgist.taoyao.boot.config.WebrtcProperties;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置
|
||||||
|
*
|
||||||
|
* @author acgist
|
||||||
|
*/
|
||||||
|
@Tag(name = "配置", description = "配置管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/config")
|
||||||
|
public class ConfigController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WebrtcProperties webrtcProperties;
|
||||||
|
|
||||||
|
@Operation(summary = "WebRTC配置", description = "WebRTC配置")
|
||||||
|
@GetMapping("/webrtc")
|
||||||
|
public WebrtcProperties webrtc() {
|
||||||
|
return this.webrtcProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.acgist.taoyao;
|
package com.acgist.taoyao.main;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@@ -5,6 +5,12 @@ server:
|
|||||||
key-store: classpath:taoyao.jks
|
key-store: classpath:taoyao.jks
|
||||||
key-store-password: 123456
|
key-store-password: 123456
|
||||||
key-password: 123456
|
key-password: 123456
|
||||||
|
tomcat:
|
||||||
|
remoteip:
|
||||||
|
host-header: X-Forwarded-Host
|
||||||
|
port-header: X-Forwarded-Port
|
||||||
|
protocol-header: X-Forwarded-Proto
|
||||||
|
remote-ip-header: X-Forwarded-For
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
@@ -16,12 +22,33 @@ spring:
|
|||||||
multipart:
|
multipart:
|
||||||
max-file-size: 256MB
|
max-file-size: 256MB
|
||||||
max-request-size: 256MB
|
max-request-size: 256MB
|
||||||
|
task:
|
||||||
|
execution:
|
||||||
|
pool:
|
||||||
|
core-size: 8
|
||||||
|
max-size: 128
|
||||||
|
keep-alive: 60s
|
||||||
|
queue-capacity: 100000
|
||||||
|
allow-core-thread-timeout: true
|
||||||
|
shutdown:
|
||||||
|
await-termination: true
|
||||||
|
await-termination-period: 60s
|
||||||
|
thread-name-prefix: ${spring.application.name}-
|
||||||
|
scheduling:
|
||||||
|
pool:
|
||||||
|
size: 4
|
||||||
|
shutdown:
|
||||||
|
await-termination: true
|
||||||
|
await-termination-period: 60s
|
||||||
|
thread-name-prefix: ${spring.application.name}-scheduling-
|
||||||
taoyao:
|
taoyao:
|
||||||
url: https://gitee.com/acgist/taoyao
|
url: https://gitee.com/acgist/taoyao
|
||||||
name: 桃夭
|
name: 桃夭
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
description: WebRTC信令服务
|
description: WebRTC信令服务
|
||||||
|
webrtc:
|
||||||
|
type:
|
||||||
security:
|
security:
|
||||||
realm: taoyao
|
realm: taoyao
|
||||||
permit: /v3/api-docs/,/swagger-ui/,/error
|
permit: /v3/api-docs/,/swagger-ui/,/error
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.acgist.taoyao;
|
package com.acgist.taoyao.main;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
Reference in New Issue
Block a user