测试
This commit is contained in:
parent
c1b0cb9b7e
commit
f52771d85e
@ -55,4 +55,9 @@ public class JsonResponse<T> {
|
|||||||
public static <T> JsonResponse<T> build(T data, int status, String msg) {
|
public static <T> JsonResponse<T> build(T data, int status, String msg) {
|
||||||
return new JsonResponse<>(status, msg, data);
|
return new JsonResponse<>(status, msg, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return JsonUtils.toJson(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package cn.skcks.docking.gb28181.media.dto.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GeneralConfig {
|
||||||
|
private Integer enableVhost;
|
||||||
|
private Integer flowThreshold;
|
||||||
|
private Integer maxStreamWaitMS;
|
||||||
|
private Integer streamNoneReaderDelayMS;
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package cn.skcks.docking.gb28181.media.dto.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HlsConfig {
|
||||||
|
private Integer fileBufSize;
|
||||||
|
private String filePath;
|
||||||
|
private Integer segDur;
|
||||||
|
private Integer segNum;
|
||||||
|
}
|
@ -11,4 +11,10 @@ public class ServerConfig {
|
|||||||
|
|
||||||
@JsonUnwrapped(prefix = "ffmpeg.")
|
@JsonUnwrapped(prefix = "ffmpeg.")
|
||||||
private FFMpegConfig ffmpeg;
|
private FFMpegConfig ffmpeg;
|
||||||
|
|
||||||
|
@JsonUnwrapped(prefix = "general.")
|
||||||
|
private GeneralConfig general;
|
||||||
|
|
||||||
|
@JsonUnwrapped(prefix = "hls.")
|
||||||
|
private HlsConfig hls;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package cn.skcks.docking.gb28181.media.proxy;
|
|||||||
|
|
||||||
import cn.skcks.docking.gb28181.common.json.JsonResponse;
|
import cn.skcks.docking.gb28181.common.json.JsonResponse;
|
||||||
import cn.skcks.docking.gb28181.media.dto.config.ServerConfig;
|
import cn.skcks.docking.gb28181.media.dto.config.ServerConfig;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.service.annotation.GetExchange;
|
import org.springframework.web.service.annotation.GetExchange;
|
||||||
import org.springframework.web.service.annotation.HttpExchange;
|
import org.springframework.web.service.annotation.HttpExchange;
|
||||||
@ -13,4 +14,7 @@ public interface ZlmMediaHttpService {
|
|||||||
|
|
||||||
@GetExchange("/index/api/getServerConfig")
|
@GetExchange("/index/api/getServerConfig")
|
||||||
JsonResponse<List<ServerConfig>> getServerConfig(@RequestParam String secret);
|
JsonResponse<List<ServerConfig>> getServerConfig(@RequestParam String secret);
|
||||||
|
|
||||||
|
@GetExchange("/index/api/getServerConfig")
|
||||||
|
ResponseEntity<String> getServerConfigResponseEntity(@RequestParam String secret);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package cn.skcks.docking.gb28181.test;
|
package cn.skcks.docking.gb28181.test;
|
||||||
|
|
||||||
|
import cn.skcks.docking.gb28181.common.json.JsonResponse;
|
||||||
import cn.skcks.docking.gb28181.media.config.ZlmMediaConfig;
|
import cn.skcks.docking.gb28181.media.config.ZlmMediaConfig;
|
||||||
|
import cn.skcks.docking.gb28181.media.dto.config.ServerConfig;
|
||||||
import cn.skcks.docking.gb28181.media.proxy.ZlmMediaHttpService;
|
import cn.skcks.docking.gb28181.media.proxy.ZlmMediaHttpService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@ -9,8 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@ -25,7 +29,10 @@ public class MediaServiceTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void context(){
|
void context(){
|
||||||
var test = zlMediaHttpService.getServerConfig(config.getSecret());
|
ResponseEntity<String> entity = zlMediaHttpService.getServerConfigResponseEntity(config.getSecret());
|
||||||
log.info("{}", test);
|
log.info("{}", entity.getBody());
|
||||||
|
|
||||||
|
JsonResponse<List<ServerConfig>> test = zlMediaHttpService.getServerConfig(config.getSecret());
|
||||||
|
log.info("{}", test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user