02 2023 档案
摘要:使用场景:需要执行某个方法但不需等待该方法的执行结果或者需要执行多个方法但这些方法不需要先后执行,可以通过声明并调用异步方法实现.因为每执行一个异步方法都需要从线程池中申请并占用一个线程,为避免线程资源过度损耗,需要自行维护线程池。 1 启动类上加 @EnableAsync 表示开启异步注解 2 c
阅读全文
摘要:登陆controller: package login; import batch.User; import com.alibaba.fastjson.JSONObject; import org.springframework.beans.factory.annotation.Autowired;
阅读全文
摘要:contriller: package batch; import com.alibaba.fastjson.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springfra
阅读全文