修改:支持jdk17,@PostConstruct 高版本与低版本不兼容
This commit is contained in:
parent
f4771aadf2
commit
7ce9b4012a
38
pom.xml
38
pom.xml
@ -5,49 +5,59 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>net.tccn</groupId>
|
<groupId>net.tccn</groupId>
|
||||||
<artifactId>zhub-cli</artifactId>
|
<artifactId>zhub-client-spring</artifactId>
|
||||||
<version>1.0</version>
|
<version>0.1.3.dev</version>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>3.1.10</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<version>2.5.4</version>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.8.8</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.13.1</version>
|
<!--<version>4.13.1</version>-->
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<!--<version>1.18.30</version>-->
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<!--<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>maven-nexus</id>
|
<id>maven-release</id>
|
||||||
<name>maven-nexus</name>
|
<name>maven-nexus</name>
|
||||||
<url>http://47.106.237.198:8081/repository/maven-public/</url>
|
<url>https://nexus.1216.top/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>mvn-release</id>
|
<id>mvn-release</id>
|
||||||
<name>mvn-release</name>
|
<name>mvn-release</name>
|
||||||
<url>http://47.106.237.198:8081/repository/maven-releases/</url>
|
<url>https://nexus.1216.top/repository/maven-releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>-->
|
</distributionManagement>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -1,6 +1,8 @@
|
|||||||
package tccn.zhub;
|
package tccn.zhub;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import lombok.Setter;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import tccn.AbstractConsumer;
|
import tccn.AbstractConsumer;
|
||||||
@ -9,7 +11,6 @@ import tccn.IConsumer;
|
|||||||
import tccn.IProducer;
|
import tccn.IProducer;
|
||||||
import tccn.timer.Timers;
|
import tccn.timer.Timers;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@ -34,15 +35,16 @@ import java.util.logging.Logger;
|
|||||||
public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer {
|
public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer {
|
||||||
|
|
||||||
public Logger logger = Logger.getLogger(ZHubClient.class.getSimpleName());
|
public Logger logger = Logger.getLogger(ZHubClient.class.getSimpleName());
|
||||||
|
@Setter
|
||||||
@Value("${zhub.addr}")
|
@Value("${zhub.addr}")
|
||||||
private String addr = "127.0.0.1:1216";
|
private String addr = "127.0.0.1:1216";
|
||||||
|
@Setter
|
||||||
@Value("${zhub.groupid}")
|
@Value("${zhub.groupid}")
|
||||||
private String groupid = "";
|
private String groupid = "";
|
||||||
|
@Setter
|
||||||
@Value("${zhub.auth}")
|
@Value("${zhub.auth}")
|
||||||
private String auth = "";
|
private String auth = "";
|
||||||
|
@Setter
|
||||||
@Value("${zhub.appid}")
|
@Value("${zhub.appid}")
|
||||||
protected String appid = "";
|
protected String appid = "";
|
||||||
|
|
||||||
@ -70,6 +72,9 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
|
|||||||
private boolean isMain = false;*/
|
private boolean isMain = false;*/
|
||||||
private static final Map<String, ZHubClient> mainHub = new HashMap<>(); // 127.0.0.1:1216 - ZHubClient
|
private static final Map<String, ZHubClient> mainHub = new HashMap<>(); // 127.0.0.1:1216 - ZHubClient
|
||||||
|
|
||||||
|
public ZHubClient() {
|
||||||
|
}
|
||||||
|
|
||||||
public ZHubClient(String addr, String groupid, String appid, String auth) {
|
public ZHubClient(String addr, String groupid, String appid, String auth) {
|
||||||
this.addr = addr;
|
this.addr = addr;
|
||||||
this.groupid = groupid;
|
this.groupid = groupid;
|
||||||
|
Loading…
Reference in New Issue
Block a user