From d01b1133d36725225f48fa078aadc2027c2ec58c Mon Sep 17 00:00:00 2001 From: zhichuang Date: Tue, 31 Oct 2023 10:30:28 +0800 Subject: [PATCH] fix: reflection configuration --- .../platform/MyReflectionConfiguration.java | 29 ++++++++++ .../support/platform/PlatformClient.java | 24 ++++++-- .../model/ObtainBoxRegKeyResponse.java | 33 ----------- .../model/RegisterClientResponse.java | 46 --------------- .../platform/model/RegisterUserResponse.java | 56 ------------------- 5 files changed, 47 insertions(+), 141 deletions(-) create mode 100644 src/main/java/space/ao/services/support/platform/MyReflectionConfiguration.java delete mode 100644 src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java delete mode 100644 src/main/java/space/ao/services/support/platform/model/RegisterClientResponse.java delete mode 100644 src/main/java/space/ao/services/support/platform/model/RegisterUserResponse.java diff --git a/src/main/java/space/ao/services/support/platform/MyReflectionConfiguration.java b/src/main/java/space/ao/services/support/platform/MyReflectionConfiguration.java new file mode 100644 index 0000000..fe83541 --- /dev/null +++ b/src/main/java/space/ao/services/support/platform/MyReflectionConfiguration.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 Institute of Software Chinese Academy of Sciences (ISCAS) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package space.ao.services.support.platform; + +import io.github.ren2003u.authentication.model.ObtainBoxRegKeyRequest; +import io.github.ren2003u.authentication.model.ObtainBoxRegKeyResponse; +import io.github.ren2003u.migration.model.*; +import io.github.ren2003u.register.model.*; +import io.quarkus.runtime.annotations.RegisterForReflection; +import space.ao.services.account.member.dto.migration.ClientMigrationInfo; + +@RegisterForReflection(targets = {RegisterClientRequest.class, RegisterClientResponse.class, RegisterDeviceRequest.class, RegisterDeviceResponse.class, RegisterUserRequest.class, RegisterUserResponse.class, +ClientMigrationInfo.class, SpacePlatformMigrationOutRequest.class, SpacePlatformMigrationOutResponse.class, SpacePlatformMigrationRequest.class, SpacePlatformMigrationResponse.class, UserDomainRouteInfo.class, UserMigrationInfo.class, +ObtainBoxRegKeyRequest.class, ObtainBoxRegKeyResponse.class}) +public class MyReflectionConfiguration { +} 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 3661a48..9a65319 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,25 @@ +/* + * Copyright (c) 2022 Institute of Software Chinese Academy of Sciences (ISCAS) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ 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,9 +32,6 @@ 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 deleted file mode 100644 index d039bee..0000000 --- a/src/main/java/space/ao/services/support/platform/model/ObtainBoxRegKeyResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -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); - } - } -} 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 deleted file mode 100644 index 9b876b4..0000000 --- a/src/main/java/space/ao/services/support/platform/model/RegisterClientResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index 29b2ac9..0000000 --- a/src/main/java/space/ao/services/support/platform/model/RegisterUserResponse.java +++ /dev/null @@ -1,56 +0,0 @@ -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