Compare commits
3 Commits
0bedcf366e
...
dev/spring
Author | SHA1 | Date | |
---|---|---|---|
94b1ac4822 | |||
3fe08e92a8 | |||
a0126582bd |
17
pom.xml
17
pom.xml
@@ -4,20 +4,20 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>net.tccn</groupId>
|
<groupId>dev.zhub</groupId>
|
||||||
<artifactId>zhub-client-spring</artifactId>
|
<artifactId>zhub-client-spring</artifactId>
|
||||||
<version>17.0.0409.dev</version>
|
<version>8.0.0424.dev</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.1.10</version>
|
<version>2.5.4</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</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>
|
||||||
@@ -59,5 +59,12 @@
|
|||||||
<url>https://nexus.1216.top/repository/maven-releases/</url>
|
<url>https://nexus.1216.top/repository/maven-releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
<!--<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>mvn-recloud</id>
|
||||||
|
<name>mvn-release</name>
|
||||||
|
<url>http://nexus.recloud.cn/repository/maven-releases/</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>-->
|
||||||
|
|
||||||
</project>
|
</project>
|
@@ -1,10 +1,9 @@
|
|||||||
package tccn;
|
package dev.zhub;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import tccn.zhub.Rpc;
|
import dev.zhub.client.Rpc;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn;
|
package dev.zhub;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布订阅 事件
|
* 发布订阅 事件
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn;
|
package dev.zhub;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn;
|
package dev.zhub;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn;
|
package dev.zhub;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
27
src/main/java/dev/zhub/IType.java
Normal file
27
src/main/java/dev/zhub/IType.java
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package dev.zhub;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface IType {
|
||||||
|
|
||||||
|
TypeToken<String> STRING = new TypeToken<String>() {
|
||||||
|
};
|
||||||
|
|
||||||
|
TypeToken<Short> SHORT = new TypeToken<Short>() {
|
||||||
|
};
|
||||||
|
TypeToken<Integer> INT = new TypeToken<Integer>() {
|
||||||
|
};
|
||||||
|
TypeToken<Long> LONG = new TypeToken<Long>() {
|
||||||
|
};
|
||||||
|
TypeToken<Double> DOUBLE = new TypeToken<Double>() {
|
||||||
|
};
|
||||||
|
|
||||||
|
TypeToken<Map<String, String>> MAP = new TypeToken<Map<String, String>>() {
|
||||||
|
};
|
||||||
|
|
||||||
|
TypeToken<List<Map<String, String>>> LMAP = new TypeToken<List<Map<String, String>>>() {
|
||||||
|
};
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.zhub;
|
package dev.zhub.client;
|
||||||
|
|
||||||
// ================================================== lock ==================================================
|
// ================================================== lock ==================================================
|
||||||
public class Lock {
|
public class Lock {
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.zhub;
|
package dev.zhub.client;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.zhub;
|
package dev.zhub.client;
|
||||||
|
|
||||||
public class RpcResult<R> {
|
public class RpcResult<R> {
|
||||||
private String ruk;
|
private String ruk;
|
||||||
@@ -34,7 +34,7 @@ public class RpcResult<R> {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResult(Object result) {
|
public void setResult(R result) {
|
||||||
this.result = (R) result;
|
this.result = result;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,13 +1,13 @@
|
|||||||
package tccn.zhub;
|
package dev.zhub.client;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import jakarta.annotation.PostConstruct;
|
import dev.zhub.*;
|
||||||
|
import dev.zhub.timer.Timers;
|
||||||
import lombok.Setter;
|
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.*;
|
|
||||||
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;
|
||||||
@@ -638,7 +638,7 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
|
|||||||
TypeToken typeToken = rpc.getTypeToken();
|
TypeToken typeToken = rpc.getTypeToken();
|
||||||
if (typeToken.getType() != ((RpcResult<?>) value).getResult().getClass()) {
|
if (typeToken.getType() != ((RpcResult<?>) value).getResult().getClass()) {
|
||||||
Object result = gson.fromJson(toStr(((RpcResult<?>) value).getResult()), typeToken.getType());
|
Object result = gson.fromJson(toStr(((RpcResult<?>) value).getResult()), typeToken.getType());
|
||||||
((RpcResult<?>) value).setResult(result);
|
((RpcResult<Object>) value).setResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc.setRpcResult((RpcResult) value);
|
rpc.setRpcResult((RpcResult) value);
|
@@ -1,7 +1,7 @@
|
|||||||
package tccn.timer;
|
package dev.zhub.timer;
|
||||||
|
|
||||||
import tccn.timer.queue.TimerQueue;
|
import dev.zhub.timer.queue.TimerQueue;
|
||||||
import tccn.timer.task.Task;
|
import dev.zhub.timer.task.Task;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
@@ -1,8 +1,8 @@
|
|||||||
package tccn.timer;
|
package dev.zhub.timer;
|
||||||
|
|
||||||
import tccn.timer.scheduled.Scheduled;
|
import dev.zhub.timer.scheduled.Scheduled;
|
||||||
import tccn.timer.task.Job;
|
import dev.zhub.timer.task.Job;
|
||||||
import tccn.timer.task.Task;
|
import dev.zhub.timer.task.Task;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
@@ -1,6 +1,6 @@
|
|||||||
package tccn.timer;
|
package dev.zhub.timer;
|
||||||
|
|
||||||
import tccn.timer.scheduled.ScheduledCycle;
|
import dev.zhub.timer.scheduled.ScheduledCycle;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
@@ -1,6 +1,6 @@
|
|||||||
package tccn.timer.queue;
|
package dev.zhub.timer.queue;
|
||||||
|
|
||||||
import tccn.timer.task.Task;
|
import dev.zhub.timer.task.Task;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.timer.scheduled;
|
package dev.zhub.timer.scheduled;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.timer.scheduled;
|
package dev.zhub.timer.scheduled;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.timer.scheduled;
|
package dev.zhub.timer.scheduled;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
@@ -1,4 +1,4 @@
|
|||||||
package tccn.timer.task;
|
package dev.zhub.timer.task;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: liangxianyou at 2018/12/8 17:24.
|
* @author: liangxianyou at 2018/12/8 17:24.
|
@@ -1,7 +1,7 @@
|
|||||||
package tccn.timer.task;
|
package dev.zhub.timer.task;
|
||||||
|
|
||||||
import tccn.timer.TimerExecutor;
|
import dev.zhub.timer.TimerExecutor;
|
||||||
import tccn.timer.scheduled.Scheduled;
|
import dev.zhub.timer.scheduled.Scheduled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: liangxianyou at 2018/8/5 19:32.
|
* @author: liangxianyou at 2018/8/5 19:32.
|
@@ -1,27 +0,0 @@
|
|||||||
package tccn;
|
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface IType {
|
|
||||||
|
|
||||||
TypeToken<String> STRING = new TypeToken<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
TypeToken<Short> SHORT = new TypeToken<>() {
|
|
||||||
};
|
|
||||||
TypeToken<Integer> INT = new TypeToken<>() {
|
|
||||||
};
|
|
||||||
TypeToken<Long> LONG = new TypeToken<>() {
|
|
||||||
};
|
|
||||||
TypeToken<Double> DOUBLE = new TypeToken<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
TypeToken<Map<String, String>> MAP = new TypeToken<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
TypeToken<List<Map<String, String>>> LMAP = new TypeToken<List<Map<String, String>>>() {
|
|
||||||
};
|
|
||||||
}
|
|
@@ -1,8 +1,8 @@
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import tccn.IType;
|
import net.tccn.IType;
|
||||||
import tccn.zhub.Lock;
|
import net.tccn.zhub.Lock;
|
||||||
import tccn.zhub.ZHubClient;
|
import net.tccn.zhub.ZHubClient;
|
||||||
|
|
||||||
// @RestService(automapping = true)
|
// @RestService(automapping = true)
|
||||||
public class HelloService {
|
public class HelloService {
|
||||||
|
Reference in New Issue
Block a user