fix:用户登录的同步信息到商旅平台改为异步执行

This commit is contained in:
lulz1 2024-05-27 08:32:21 +08:00
parent a8516640ec
commit fdb5e390a9
2 changed files with 7 additions and 6 deletions

View File

@ -22,8 +22,8 @@ import com.chint.infrastructure.util.BaseContext;
import com.chint.infrastructure.util.Digest;
import com.chint.infrastructure.util.Result;
import com.chint.interfaces.rest.ctrip.CTripUserSaveRequest;
import com.chint.interfaces.rest.ly.LYUserRequest;
import com.chint.interfaces.rest.data_center.user.UserHttpRequest;
import com.chint.interfaces.rest.ly.LYUserRequest;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.concurrent.CompletableFuture;
@Slf4j
@RestController
@ -159,8 +160,10 @@ public class LoginController {
private void loginEventBoarder(User user) {
Command.of(UserLoginCommand.class).user(user).sendToQueue();
user.setSyncTime(LocalDateTime.now());
userRepository.save(user);
CompletableFuture.runAsync(() -> {
Command.of(UserLoginCommand.class).user(user).sendToQueue();
user.setSyncTime(LocalDateTime.now());
userRepository.save(user);
});
}
}

View File

@ -33,8 +33,6 @@ public class RouteRequest implements Serializable, EventManageable {
private Long routeId;
private Long routeOrderKey;
private String routeRequestNo;
private String supplier;