使用多线程处理逻辑

@GetMapping("/order")
public Callable order(){
Callable callable = new Callable() {
@Override
public UserTest call() throws Exception {
logger.info(“副线程开始”);
Thread.sleep(1000);
UserTest usr = new UserTest();
usr.setUsername(“1”);
usr.setPassword(“123”);
usr.setAge(11);
logger.info(“副线程结束”);
return usr;
}
};
return callable;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章