From 7ce9b4012afde2138d3ec9a7cd00a0cdc5004112 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com>
Date: Mon, 8 Apr 2024 01:10:25 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=94=AF=E6=8C=81jd?=
=?UTF-8?q?k17=EF=BC=8C@PostConstruct=20=E9=AB=98=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E4=B8=8E=E4=BD=8E=E7=89=88=E6=9C=AC=E4=B8=8D=E5=85=BC=E5=AE=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 38 ++++++++++++++++---------
src/main/java/tccn/zhub/ZHubClient.java | 13 ++++++---
2 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/pom.xml b/pom.xml
index 053b226..afacfcd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,49 +5,59 @@
4.0.0
net.tccn
- zhub-cli
- 1.0
+ zhub-client-spring
+ 0.1.3.dev
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.1.10
+
+
- 1.8
- 1.8
+ 17
+ 17
org.springframework.boot
spring-boot-starter-web
- 2.5.4
+ provided
com.google.code.gson
gson
- 2.8.8
junit
junit
- 4.13.1
+
test
+
+ org.projectlombok
+ lombok
+
+ provided
+
-
+
\ No newline at end of file
diff --git a/src/main/java/tccn/zhub/ZHubClient.java b/src/main/java/tccn/zhub/ZHubClient.java
index 6238987..eb630f1 100644
--- a/src/main/java/tccn/zhub/ZHubClient.java
+++ b/src/main/java/tccn/zhub/ZHubClient.java
@@ -1,6 +1,8 @@
package tccn.zhub;
import com.google.gson.reflect.TypeToken;
+import jakarta.annotation.PostConstruct;
+import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import tccn.AbstractConsumer;
@@ -9,7 +11,6 @@ import tccn.IConsumer;
import tccn.IProducer;
import tccn.timer.Timers;
-import javax.annotation.PostConstruct;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -34,15 +35,16 @@ import java.util.logging.Logger;
public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer {
public Logger logger = Logger.getLogger(ZHubClient.class.getSimpleName());
+ @Setter
@Value("${zhub.addr}")
private String addr = "127.0.0.1:1216";
-
+ @Setter
@Value("${zhub.groupid}")
private String groupid = "";
-
+ @Setter
@Value("${zhub.auth}")
private String auth = "";
-
+ @Setter
@Value("${zhub.appid}")
protected String appid = "";
@@ -70,6 +72,9 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
private boolean isMain = false;*/
private static final Map mainHub = new HashMap<>(); // 127.0.0.1:1216 - ZHubClient
+ public ZHubClient() {
+ }
+
public ZHubClient(String addr, String groupid, String appid, String auth) {
this.addr = addr;
this.groupid = groupid;