测试
This commit is contained in:
parent
8e986ffeee
commit
1cf28de85c
10
pom.xml
10
pom.xml
@ -21,14 +21,18 @@
|
||||
<module>api</module>
|
||||
<module>gb28181-service</module>
|
||||
<module>orm</module>
|
||||
<module>zlmediakit-service</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<java.version>17</java.version>
|
||||
<springboot.version>3.1.2</springboot.version>
|
||||
|
||||
<!--Java Bean-->
|
||||
@ -46,7 +50,7 @@
|
||||
<hutool.version>5.8.11</hutool.version>
|
||||
|
||||
<!--SpringDoc-->
|
||||
<springdoc.version>2.0.2</springdoc.version>
|
||||
<springdoc.version>2.2.0</springdoc.version>
|
||||
</properties>
|
||||
|
||||
|
||||
|
52
zlmediakit-service/pom.xml
Normal file
52
zlmediakit-service/pom.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<?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>cn.skcks.docking</groupId>
|
||||
<artifactId>gb28181</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>zlmediakit-service</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!-- For reactive support -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,10 @@
|
||||
package cn.skcks.docking.gb28181.media;
|
||||
|
||||
import org.springframework.web.service.annotation.GetExchange;
|
||||
import org.springframework.web.service.annotation.HttpExchange;
|
||||
|
||||
@HttpExchange()
|
||||
public interface ZLMediaHttpService {
|
||||
@GetExchange("/")
|
||||
void test();
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.skcks.docking.gb28181.media.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "media")
|
||||
public class MediaConfig {
|
||||
private String url;
|
||||
}
|
2
zlmediakit-service/src/main/resources/application.yml
Normal file
2
zlmediakit-service/src/main/resources/application.yml
Normal file
@ -0,0 +1,2 @@
|
||||
media:
|
||||
url: 'http://10.10.10.200:5080'
|
@ -0,0 +1,12 @@
|
||||
package cn.skcks.docking.gb28181;
|
||||
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class MediaTestApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MediaTestApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.skcks.docking.gb28181.test;
|
||||
|
||||
import cn.skcks.docking.gb28181.media.config.MediaConfig;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
@ExtendWith(SpringExtension.class)
|
||||
public class MediaServiceTest {
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
@Bean
|
||||
WebClient webClient(ObjectMapper objectMapper) {
|
||||
return WebClient.builder()
|
||||
.baseUrl(mediaConfig.getUrl())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
void context(WebClient webClient){
|
||||
// log.info("mediaConfig {}", mediaConfig);
|
||||
// HttpServiceProxyFactory httpServiceProxyFactory =
|
||||
// HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient))
|
||||
// .build();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user