|  |  |  | 
|---|
|  |  |  | package com.ruoyi.utils.forest; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dtflys.forest.annotation.Get; | 
|---|
|  |  |  | import com.dtflys.forest.annotation.JSONBody; | 
|---|
|  |  |  | import com.dtflys.forest.annotation.Post; | 
|---|
|  |  |  | import com.dtflys.forest.annotation.Var; | 
|---|
|  |  |  | import com.dtflys.forest.annotation.*; | 
|---|
|  |  |  | import com.ruoyi.media.domain.Conf; | 
|---|
|  |  |  | import com.ruoyi.media.domain.Items; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @Description: mediamtx流媒体客户端 | 
|---|
|  |  |  | 
|---|
|  |  |  | * @Date: 2023年07月06日9:51 | 
|---|
|  |  |  | * @Version: 1.0 | 
|---|
|  |  |  | **/ | 
|---|
|  |  |  | @BaseRequest(baseURL = "http://#{mediamtx.host}:9997/v2") | 
|---|
|  |  |  | public interface MediaClient { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 增加路径 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Post("/config/paths/add/{name}") | 
|---|
|  |  |  | String addPath( @Var("name") String name, @JSONBody Conf body); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Post("{apiUrl}/config/paths/add/{name}") | 
|---|
|  |  |  | String add(@Var("apiUrl") String apiUrl,@Var("name") String name, @JSONBody Conf body); | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 移除路径 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Post("/config/paths/remove/{name}") | 
|---|
|  |  |  | String removePath(@Var("name") String name); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Post("{apiUrl}/config/paths/remove/{name}") | 
|---|
|  |  |  | String remove(@Var("apiUrl") String apiUrl,@Var("name") String name); | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取路径详情 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Get("/paths/get/{name}") | 
|---|
|  |  |  | Items getPathInfo(@Var("name") String name); | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询所有路径 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Get("/paths/list") | 
|---|
|  |  |  | String paths(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Get("{apiUrl}/paths/list") | 
|---|
|  |  |  | String list(@Var("apiUrl") String apiUrl); | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询所有rtsp会话 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Get("/rtspsessions/list") | 
|---|
|  |  |  | String rtspsessions(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询所有rtsp连接 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Get("/rtspconns/list") | 
|---|
|  |  |  | String rtspconns(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 按sessionId查询rtsp会话 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Get("/rtspsessions/get/{sessionId}") | 
|---|
|  |  |  | String getRtspsessionById(@Var("sessionId") String sessionId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 按sessionId删除rtsp会话 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Post("/rtspsessions/kick/{sessionId}") | 
|---|
|  |  |  | String kick(@Var("sessionId") String sessionId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|