This commit is contained in:
2025-10-01 21:37:43 +08:00
parent 818e614e37
commit 979403df06
22 changed files with 63 additions and 39 deletions

View File

@@ -33,9 +33,14 @@ import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.continew.admin.common.context.UserContext;
import top.continew.admin.common.context.UserContextHolder;
import top.continew.starter.core.autoconfigure.application.ApplicationProperties;
import top.continew.starter.core.util.SpringUtils;
import top.continew.starter.extension.crud.annotation.EnableCrudApi;
import top.continew.starter.web.annotation.EnableGlobalResponse;
import top.continew.starter.web.model.R;
@@ -59,6 +64,7 @@ public class ContiNewAdminApplication implements ApplicationRunner {
private final ApplicationProperties applicationProperties;
private final ServerProperties serverProperties;
private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
public static void main(String[] args) {
SpringApplication.run(ContiNewAdminApplication.class, args);
@@ -93,5 +99,15 @@ public class ContiNewAdminApplication implements ApplicationRunner {
log.info("更新日志: https://continew.top/docs/admin/changelog/");
log.info("ContiNew Admin: 持续迭代优化的,高质量多租户中后台管理系统框架");
log.info("--------------------------------------------------------");
UserContext userContext = new UserContext();
userContext.setId(222L);
UserContextHolder.setContext(userContext);
log.info("userId: {}", UserContextHolder.getUserId());
SpringUtils.getProxy(this).async();
}
@Async
public void async() {
log.info("async: {}", UserContextHolder.getUserId());
}
}