Compare commits
2 Commits
dev/spring
...
dev/zhub-c
Author | SHA1 | Date | |
---|---|---|---|
1e23fc383b | |||
94b1ac4822 |
26
pom.xml
26
pom.xml
@@ -5,42 +5,32 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>dev.zhub</groupId>
|
<groupId>dev.zhub</groupId>
|
||||||
<artifactId>zhub-client-spring</artifactId>
|
<artifactId>zhub-client</artifactId>
|
||||||
<version>17.0.0423.dev</version>
|
<version>0.1.0424.dev</version>
|
||||||
|
|
||||||
<parent>
|
<description>ZHub-Java 通用客户端</description>
|
||||||
<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>17</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.10.1</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>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<!--<version>1.18.30</version>-->
|
<version>1.18.30</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@@ -7,19 +7,19 @@ import java.util.Map;
|
|||||||
|
|
||||||
public interface IType {
|
public interface IType {
|
||||||
|
|
||||||
TypeToken<String> STRING = new TypeToken<>() {
|
TypeToken<String> STRING = new TypeToken<String>() {
|
||||||
};
|
};
|
||||||
|
|
||||||
TypeToken<Short> SHORT = new TypeToken<>() {
|
TypeToken<Short> SHORT = new TypeToken<Short>() {
|
||||||
};
|
};
|
||||||
TypeToken<Integer> INT = new TypeToken<>() {
|
TypeToken<Integer> INT = new TypeToken<Integer>() {
|
||||||
};
|
};
|
||||||
TypeToken<Long> LONG = new TypeToken<>() {
|
TypeToken<Long> LONG = new TypeToken<Long>() {
|
||||||
};
|
};
|
||||||
TypeToken<Double> DOUBLE = new TypeToken<>() {
|
TypeToken<Double> DOUBLE = new TypeToken<Double>() {
|
||||||
};
|
};
|
||||||
|
|
||||||
TypeToken<Map<String, String>> MAP = new TypeToken<>() {
|
TypeToken<Map<String, String>> MAP = new TypeToken<Map<String, String>>() {
|
||||||
};
|
};
|
||||||
|
|
||||||
TypeToken<List<Map<String, String>>> LMAP = new TypeToken<List<Map<String, String>>>() {
|
TypeToken<List<Map<String, String>>> LMAP = new TypeToken<List<Map<String, String>>>() {
|
||||||
|
@@ -1,40 +1,13 @@
|
|||||||
package dev.zhub.client;
|
package dev.zhub.client;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
public class RpcResult<R> {
|
public class RpcResult<R> {
|
||||||
private String ruk;
|
private String ruk;
|
||||||
private int retcode;
|
private int retcode;
|
||||||
private String retinfo;
|
private String retinfo;
|
||||||
private R result;
|
private R result;
|
||||||
|
|
||||||
public String getRuk() {
|
|
||||||
return ruk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRuk(String ruk) {
|
|
||||||
this.ruk = ruk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRetcode() {
|
|
||||||
return retcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRetcode(int retcode) {
|
|
||||||
this.retcode = retcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRetinfo() {
|
|
||||||
return retinfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRetinfo(String retinfo) {
|
|
||||||
this.retinfo = retinfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public R getResult() {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResult(R result) {
|
|
||||||
this.result = result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -2,11 +2,8 @@ package dev.zhub.client;
|
|||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import dev.zhub.*;
|
import dev.zhub.*;
|
||||||
import jakarta.annotation.PostConstruct;
|
|
||||||
import lombok.Setter;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import dev.zhub.timer.Timers;
|
import dev.zhub.timer.Timers;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -22,24 +19,18 @@ import java.util.function.Function;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@Component
|
|
||||||
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
|
@Setter
|
||||||
@Value("${zhub.addr}")
|
|
||||||
private String addr = "127.0.0.1:1216";
|
private String addr = "127.0.0.1:1216";
|
||||||
@Setter
|
@Setter
|
||||||
@Value("${zhub.groupid}")
|
|
||||||
private String groupid = "";
|
private String groupid = "";
|
||||||
@Setter
|
@Setter
|
||||||
@Value("${zhub.auth}")
|
|
||||||
private String auth = "";
|
private String auth = "";
|
||||||
@Setter
|
@Setter
|
||||||
@Value("${zhub.appid}")
|
|
||||||
protected String appid = "";
|
protected String appid = "";
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
public void init() {
|
||||||
init(null);
|
init(null);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user