From 5b8dbb6a5369bfab20c0fcb3315fae5abec43e65 Mon Sep 17 00:00:00 2001 From: jiahao ren Date: Fri, 27 Oct 2023 16:58:04 +0800 Subject: [PATCH 1/3] migrate some entities from Java sdk to space gateway and add @RegisterForReflection annotation. --- .../support/platform/PlatformClient.java | 9 ++- .../model/ObtainBoxRegKeyResponse.java | 65 +++++++++++++++++++ .../model/RegisterClientResponse.java | 46 +++++++++++++ .../platform/model/RegisterUserResponse.java | 56 ++++++++++++++++ 4 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java create mode 100644 src/main/java/space/ao/services/support/platform/model/RegisterClientResponse.java create mode 100644 src/main/java/space/ao/services/support/platform/model/RegisterUserResponse.java diff --git a/src/main/java/space/ao/services/support/platform/PlatformClient.java b/src/main/java/space/ao/services/support/platform/PlatformClient.java index 25e80dd..3661a48 100644 --- a/src/main/java/space/ao/services/support/platform/PlatformClient.java +++ b/src/main/java/space/ao/services/support/platform/PlatformClient.java @@ -1,10 +1,10 @@ package space.ao.services.support.platform; -import io.github.ren2003u.authentication.model.ObtainBoxRegKeyResponse; +//import io.github.ren2003u.authentication.model.ObtainBoxRegKeyResponse; import io.github.ren2003u.client.Client; import io.github.ren2003u.domain.errorHandle.ApiResponse; -import io.github.ren2003u.register.model.RegisterClientResponse; -import io.github.ren2003u.register.model.RegisterUserResponse; +//import io.github.ren2003u.register.model.RegisterClientResponse; +//import io.github.ren2003u.register.model.RegisterUserResponse; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -17,6 +17,9 @@ import space.ao.services.support.platform.info.registry.UserRegistryInfo; import space.ao.services.support.platform.info.registry.UserRegistryResult; import space.ao.services.support.platform.info.token.TokenVerifySignInfo; +import space.ao.services.support.platform.model.ObtainBoxRegKeyResponse; +import space.ao.services.support.platform.model.RegisterClientResponse; +import space.ao.services.support.platform.model.RegisterUserResponse; import space.ao.services.support.security.SecurityUtils; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java b/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java new file mode 100644 index 0000000..cf11993 --- /dev/null +++ b/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java @@ -0,0 +1,65 @@ +package space.ao.services.support.platform.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +@RegisterForReflection +public class ObtainBoxRegKeyResponse { + + private String boxUUID; + private List tokenResults = new ArrayList<>(); + + // Getters and setters with encapsulation + + public String getBoxUUID() { + return this.boxUUID; + } + + public void setBoxUUID(String boxUUID) { + this.boxUUID = boxUUID; + } + + public List getTokenResults() { + return new ArrayList<>(this.tokenResults); + } + + public void setTokenResults(List tokenResults) { + if (tokenResults != null) { + this.tokenResults = new ArrayList<>(tokenResults); + } + } + // Inner class for TokenResult + public static class TokenResult { + private String serviceId; + private String boxRegKey; + private OffsetDateTime expiresAt; + + // getters and setters + + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public String getBoxRegKey() { + return boxRegKey; + } + + public void setBoxRegKey(String boxRegKey) { + this.boxRegKey = boxRegKey; + } + + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + } +} diff --git a/src/main/java/space/ao/services/support/platform/model/RegisterClientResponse.java b/src/main/java/space/ao/services/support/platform/model/RegisterClientResponse.java new file mode 100644 index 0000000..9b876b4 --- /dev/null +++ b/src/main/java/space/ao/services/support/platform/model/RegisterClientResponse.java @@ -0,0 +1,46 @@ +package space.ao.services.support.platform.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class RegisterClientResponse { + + private String boxUUID; + private String userId; + private String clientUUID; + private String clientType; + + // Getters and setters with encapsulation + + public String getBoxUUID() { + return this.boxUUID; + } + + public void setBoxUUID(String boxUUID) { + this.boxUUID = boxUUID; + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getClientUUID() { + return this.clientUUID; + } + + public void setClientUUID(String clientUUID) { + this.clientUUID = clientUUID; + } + + public String getClientType() { + return this.clientType; + } + + public void setClientType(String clientType) { + this.clientType = clientType; + } +} diff --git a/src/main/java/space/ao/services/support/platform/model/RegisterUserResponse.java b/src/main/java/space/ao/services/support/platform/model/RegisterUserResponse.java new file mode 100644 index 0000000..29b2ac9 --- /dev/null +++ b/src/main/java/space/ao/services/support/platform/model/RegisterUserResponse.java @@ -0,0 +1,56 @@ +package space.ao.services.support.platform.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class RegisterUserResponse { + private String boxUUID; + private String userId; + private String userDomain; + private String userType; + private String clientUUID; + + // Getters and setters + + public String getBoxUUID() { + return boxUUID; + } + + public void setBoxUUID(String boxUUID) { + this.boxUUID = boxUUID; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserDomain() { + return userDomain; + } + + public void setUserDomain(String userDomain) { + this.userDomain = userDomain; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public String getClientUUID() { + return clientUUID; + } + + public void setClientUUID(String clientUUID) { + this.clientUUID = clientUUID; + } + + +} \ No newline at end of file From f1397281e2c5b6110ed56cd990fcffebc260f208 Mon Sep 17 00:00:00 2001 From: jiahao ren Date: Fri, 27 Oct 2023 22:45:28 +0800 Subject: [PATCH 2/3] migrate some entities from Java sdk to space gateway and add @RegisterForReflection annotation. --- .../support/platform/model/ObtainBoxRegKeyResponse.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java b/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java index cf11993..afcfd3a 100644 --- a/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java +++ b/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java @@ -9,7 +9,7 @@ public class ObtainBoxRegKeyResponse { private String boxUUID; - private List tokenResults = new ArrayList<>(); + private List tokenResults = new ArrayList<>(); // Getters and setters with encapsulation @@ -21,11 +21,11 @@ public void setBoxUUID(String boxUUID) { this.boxUUID = boxUUID; } - public List getTokenResults() { + public List getTokenResults() { return new ArrayList<>(this.tokenResults); } - public void setTokenResults(List tokenResults) { + public void setTokenResults(List tokenResults) { if (tokenResults != null) { this.tokenResults = new ArrayList<>(tokenResults); } From a3ca7aa68c2d39bcdfc19b39301d1ee9f54a0d91 Mon Sep 17 00:00:00 2001 From: jiahao ren Date: Fri, 27 Oct 2023 22:48:51 +0800 Subject: [PATCH 3/3] migrate some entities from Java sdk to space gateway and add @RegisterForReflection annotation. --- .../model/ObtainBoxRegKeyResponse.java | 32 ---------------- .../support/platform/model/TokenResult.java | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 32 deletions(-) create mode 100644 src/main/java/space/ao/services/support/platform/model/TokenResult.java diff --git a/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java b/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java index afcfd3a..d039bee 100644 --- a/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java +++ b/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java @@ -30,36 +30,4 @@ public void setTokenResults(List tokenResults) { this.tokenResults = new ArrayList<>(tokenResults); } } - // Inner class for TokenResult - public static class TokenResult { - private String serviceId; - private String boxRegKey; - private OffsetDateTime expiresAt; - - // getters and setters - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public String getBoxRegKey() { - return boxRegKey; - } - - public void setBoxRegKey(String boxRegKey) { - this.boxRegKey = boxRegKey; - } - - public OffsetDateTime getExpiresAt() { - return expiresAt; - } - - public void setExpiresAt(OffsetDateTime expiresAt) { - this.expiresAt = expiresAt; - } - } } diff --git a/src/main/java/space/ao/services/support/platform/model/TokenResult.java b/src/main/java/space/ao/services/support/platform/model/TokenResult.java new file mode 100644 index 0000000..1f423f9 --- /dev/null +++ b/src/main/java/space/ao/services/support/platform/model/TokenResult.java @@ -0,0 +1,37 @@ +package space.ao.services.support.platform.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +import java.time.OffsetDateTime; +@RegisterForReflection +public class TokenResult { + private String serviceId; + private String boxRegKey; + private OffsetDateTime expiresAt; + + // getters and setters + + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public String getBoxRegKey() { + return boxRegKey; + } + + public void setBoxRegKey(String boxRegKey) { + this.boxRegKey = boxRegKey; + } + + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } +} \ No newline at end of file