From bb44893339c5a7acad4a86161b96427c26ba2e9d Mon Sep 17 00:00:00 2001 From: lulz1 Date: Mon, 6 May 2024 17:36:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=A6=BB=E8=81=8C=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=85=B3=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/interfaces/rest/amap/AmapUserRequest.java | 9 ++++----- .../interfaces/rest/ctrip/CTripUserSaveRequest.java | 5 ++--- .../java/com/chint/interfaces/rest/ly/LYUserRequest.java | 5 ++--- .../java/com/chint/interfaces/rest/user/UserSync.java | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java b/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java index 95b11275..8074e19e 100644 --- a/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java +++ b/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java @@ -67,7 +67,7 @@ public class AmapUserRequest implements UserSync { } - @ListenTo(command = "UserLoginCommand",order = 3) + @ListenTo(command = "UserLoginCommand", order = 3) @Override public User syncUserInfoToSupplier(UserLoginCommand command) { User user = command.getUser(); @@ -81,15 +81,14 @@ public class AmapUserRequest implements UserSync { return user; } - @ListenTo(command = "UserDisabledCommand",order = 0) + @ListenTo(command = "UserDisabledCommand", order = 0) @Override - public Boolean disableUserToSupplier(UserDisabledCommand command) { + public void disableUserToSupplier(UserDisabledCommand command) { User user = command.getUser(); String updateUserUrl = BaseUrl + USER_UPDATE_PATH; UserParam userParamByUser = createUserParamByUser(user); userParamByUser.setStatus(0); - BaseResponse post = amapRequest.post(updateUserUrl, userParamByUser, BaseResponse.class); - return post.getCode().equals(1); + CompletableFuture.runAsync(() -> amapRequest.post(updateUserUrl, userParamByUser, BaseResponse.class)); } @Data diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java b/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java index 2f38eb76..4731c704 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java @@ -131,7 +131,7 @@ public class CTripUserSaveRequest implements UserSync { @ListenTo(command = "UserDisabledCommand", order = 1) @Override - public Boolean disableUserToSupplier(UserDisabledCommand command) { + public void disableUserToSupplier(UserDisabledCommand command) { User user = command.getUser(); AuthenticationListRequest authenticationListRequest = buildUserParam(user); List authenticationInfoList = authenticationListRequest.getAuthenticationInfoList(); @@ -139,7 +139,6 @@ public class CTripUserSaveRequest implements UserSync { AuthenticationInfo authenticationInfo = authenticationInfoList.get(0); authenticationInfo.getAuthentication().setValid('I'); } - AuthenticationResponseList response = postRequest.post(userUrl, authenticationListRequest, AuthenticationResponseList.class); - return response.getResult().equals("Success"); + CompletableFuture.runAsync(() -> postRequest.post(userUrl, authenticationListRequest, AuthenticationResponseList.class)); } } diff --git a/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java b/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java index b71b8edc..6707eafa 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java @@ -117,13 +117,12 @@ public class LYUserRequest implements UserSync { @ListenTo(command = "UserDisabledCommand",order = 3) @Override - public Boolean disableUserToSupplier(UserDisabledCommand command) { + public void disableUserToSupplier(UserDisabledCommand command) { User user = command.getUser(); EmployeeEntity employeeEntity = user2LYEmployee(user); employeeEntity.setWorkingState(0); EmployeeRequest employeeData = new EmployeeRequest(); employeeData.setParam(employeeEntity); - UserResponse post = postRequest.post(userUrl, employeeData, UserResponse.class); - return post.isSuccess(); + CompletableFuture.runAsync(() -> postRequest.post(userUrl, employeeData, UserResponse.class)); } } diff --git a/src/main/java/com/chint/interfaces/rest/user/UserSync.java b/src/main/java/com/chint/interfaces/rest/user/UserSync.java index 33235351..fa78bd95 100644 --- a/src/main/java/com/chint/interfaces/rest/user/UserSync.java +++ b/src/main/java/com/chint/interfaces/rest/user/UserSync.java @@ -7,5 +7,5 @@ import com.chint.domain.aggregates.user.User; public interface UserSync { User syncUserInfoToSupplier(UserLoginCommand command); - Boolean disableUserToSupplier(UserDisabledCommand command); + void disableUserToSupplier(UserDisabledCommand command); }