[+] Mediasoup
This commit is contained in:
26
taoyao-signal/taoyao-live/pom.xml
Normal file
26
taoyao-signal/taoyao-live/pom.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.acgist</groupId>
|
||||
<artifactId>taoyao</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>taoyao-live</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>taoyao-live</name>
|
||||
<description>直播:直播、连麦</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.acgist</groupId>
|
||||
<artifactId>taoyao-media</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.acgist.taoyao.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 直播
|
||||
*
|
||||
* @author acgist
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(title = "直播", description = "直播")
|
||||
public class Live {
|
||||
|
||||
/**
|
||||
* 直播标识
|
||||
*/
|
||||
@Schema(title = "直播标识", description = "直播标识")
|
||||
private String id;
|
||||
/**
|
||||
* 直播名称
|
||||
*/
|
||||
@Schema(title = "直播名称", description = "直播名称")
|
||||
private String name;
|
||||
/**
|
||||
* 直播密码
|
||||
*/
|
||||
@Schema(title = "直播密码", description = "直播密码")
|
||||
private String password;
|
||||
/**
|
||||
* 终端会话标识列表
|
||||
*/
|
||||
@Schema(title = "终端会话标识列表", description = "终端会话标识列表")
|
||||
private List<String> sns;
|
||||
/**
|
||||
* 创建终端标识
|
||||
*/
|
||||
@Schema(title = "创建终端标识", description = "创建终端标识")
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 新增终端会话标识
|
||||
*
|
||||
* @param sn 终端会话标识
|
||||
*/
|
||||
public void addSn(String sn) {
|
||||
synchronized (this.sns) {
|
||||
if(this.sns.contains(sn)) {
|
||||
return;
|
||||
}
|
||||
this.sns.add(sn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.acgist.taoyao.live;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.acgist.taoyao.signal.event.ApplicationEventAdapter;
|
||||
import com.acgist.taoyao.signal.listener.ApplicationListenerAdapter;
|
||||
|
||||
/**
|
||||
* 直播事件监听适配器
|
||||
*
|
||||
* @param <E> 事件泛型
|
||||
*
|
||||
* @author acgist
|
||||
*/
|
||||
public abstract class LiveListenerAdapter<E extends ApplicationEventAdapter> extends ApplicationListenerAdapter<E> {
|
||||
|
||||
@Autowired
|
||||
protected LiveManager liveManager;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.acgist.taoyao.live;
|
||||
|
||||
import com.acgist.taoyao.boot.annotation.Manager;
|
||||
|
||||
/**
|
||||
* 直播管理
|
||||
*
|
||||
* @author acgist
|
||||
*/
|
||||
@Manager
|
||||
public class LiveManager {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.acgist.taoyao.live.controller;
|
||||
|
||||
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.live.Live;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
/**
|
||||
* 直播
|
||||
*
|
||||
* @author acgist
|
||||
*/
|
||||
@Tag(name = "直播", description = "直播管理")
|
||||
@RestController
|
||||
@RequestMapping("/live")
|
||||
public class LiveController {
|
||||
|
||||
@Operation(summary = "直播列表", description = "直播列表")
|
||||
@GetMapping("/list")
|
||||
@ApiResponse(content = @Content(schema = @Schema(implementation = Live.class)))
|
||||
public Message list() {
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "直播状态", description = "直播状态")
|
||||
@GetMapping("/status/{id}")
|
||||
public Message status(@PathVariable String id) {
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "直播终端列表", description = "直播终端列表")
|
||||
@GetMapping("/list/client")
|
||||
public Message listClient() {
|
||||
return Message.success();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user