SpringBoot 之集成 Spring AOP

前些天發現了一個巨牛的人工智能學習網站,通俗易懂,風趣幽默,忍不住分享一下給大家。點擊跳轉到教程。

在開始之前,我們先把需要的jar包添加到工程里。新增Maven依賴如下:

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-aop</artifactId>
  4. </dependency>

接下來,我們進入正題。這里的涉及的通知類型有:前置通知、后置最終通知、后置返回通知、后置異常通知、環繞通知,下面我們就具體的來看一下怎么在SpringBoot中添加這些通知。

?

?

首先我們先創建一個Aspect切面類:
 
  1. @Component
  2. @Aspect
  3. public class WebControllerAop {
  4. }
指定切點:
 
  1. //匹配com.zkn.learnspringboot.web.controller包及其子包下的所有類的所有方法
  2. @Pointcut("execution(* com.zkn.learnspringboot.web.controller..*.*(..))")
  3. public void executeService(){
  4. }

接著我們再創建一個Controller請求處理類:

?

 
  1. package com.zkn.learnspringboot.web.controller;
  2. import org.springframework.web.bind.annotation.RequestMapping;
  3. import org.springframework.web.bind.annotation.RestController;
  4. /**
  5. * Created by zkn on 2016/11/19.
  6. */
  7. @RestController
  8. @RequestMapping("/aop")
  9. public class AopTestController {
  10. }

?

前置通知

配置前置通知:
 
  1. /**
  2. * 前置通知,方法調用前被調用
  3. * @param joinPoint
  4. */
  5. @Before("executeService()")
  6. public void doBeforeAdvice(JoinPoint joinPoint){
  7. System.out.println("我是前置通知!!!");
  8. //獲取目標方法的參數信息
  9. Object[] obj = joinPoint.getArgs();
  10. //AOP代理類的信息
  11. joinPoint.getThis();
  12. //代理的目標對象
  13. joinPoint.getTarget();
  14. //用的最多 通知的簽名
  15. Signature signature = joinPoint.getSignature();
  16. //代理的是哪一個方法
  17. System.out.println(signature.getName());
  18. //AOP代理類的名字
  19. System.out.println(signature.getDeclaringTypeName());
  20. //AOP代理類的類(class)信息
  21. signature.getDeclaringType();
  22. //獲取RequestAttributes
  23. RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
  24. //從獲取RequestAttributes中獲取HttpServletRequest的信息
  25. HttpServletRequest request = (HttpServletRequest) requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST);
  26. //如果要獲取Session信息的話,可以這樣寫:
  27. //HttpSession session = (HttpSession) requestAttributes.resolveReference(RequestAttributes.REFERENCE_SESSION);
  28. Enumeration<String> enumeration = request.getParameterNames();
  29. Map<String,String> parameterMap = Maps.newHashMap();
  30. while (enumeration.hasMoreElements()){
  31. String parameter = enumeration.nextElement();
  32. parameterMap.put(parameter,request.getParameter(parameter));
  33. }
  34. String str = JSON.toJSONString(parameterMap);
  35. if(obj.length > 0) {
  36. System.out.println("請求的參數信息為:"+str);
  37. }
  38. }
注意:這里用到了JoinPoint和RequestContextHolder。通過JoinPoint可以獲得通知的簽名信息,如目標方法名、目標方法參數信息等。通過RequestContextHolder來獲取請求信息,Session信息。
接下來我們在Controller類里添加一個請求處理方法來測試一下前置通知:
 
  1. @RequestMapping("/testBeforeService.do")
  2. public String testBeforeService(String key,String value){
  3. return "key="+key+" value="+value;
  4. }
前置通知攔截結果如下所示:

后置返回通知

配置后置返回通知的代碼如下:
 
  1. /**
  2. * 后置返回通知
  3. * 這里需要注意的是:
  4. * 如果參數中的第一個參數為JoinPoint,則第二個參數為返回值的信息
  5. * 如果參數中的第一個參數不為JoinPoint,則第一個參數為returning中對應的參數
  6. * returning 限定了只有目標方法返回值與通知方法相應參數類型時才能執行后置返回通知,否則不執行,對于returning對應的通知方法參數為Object類型將匹配任何目標返回值
  7. * @param joinPoint
  8. * @param keys
  9. */
  10. @AfterReturning(value = "execution(* com.zkn.learnspringboot.web.controller..*.*(..))",returning = "keys")
  11. public void doAfterReturningAdvice1(JoinPoint joinPoint,Object keys){
  12. System.out.println("第一個后置返回通知的返回值:"+keys);
  13. }
  14. @AfterReturning(value = "execution(* com.zkn.learnspringboot.web.controller..*.*(..))",returning = "keys",argNames = "keys")
  15. public void doAfterReturningAdvice2(String keys){
  16. System.out.println("第二個后置返回通知的返回值:"+keys);
  17. }
Controller里添加響應的請求處理信息來測試后置返回通知:
 
  1. @RequestMapping("/testAfterReturning.do")
  2. public String testAfterReturning(String key){
  3. return "key=: "+key;
  4. }
  5. @RequestMapping("/testAfterReturning01.do")
  6. public Integer testAfterReturning01(Integer key){
  7. return key;
  8. }
當發送請求為:http://localhost:8001/aop/testAfterReturning.do?key=testsss&value=855sss時,處理結果如圖所示:
當發送請求為:http://localhost:8001/aop/testAfterReturning01.do?key=55553&value=855sss時,處理結果如圖所示:

后置異常通知

后置異常通知的配置方式如下:
 
  1. /**
  2. * 后置異常通知
  3. * 定義一個名字,該名字用于匹配通知實現方法的一個參數名,當目標方法拋出異常返回后,將把目標方法拋出的異常傳給通知方法;
  4. * throwing 限定了只有目標方法拋出的異常與通知方法相應參數異常類型時才能執行后置異常通知,否則不執行,
  5. * 對于throwing對應的通知方法參數為Throwable類型將匹配任何異常。
  6. * @param joinPoint
  7. * @param exception
  8. */
  9. @AfterThrowing(value = "executeService()",throwing = "exception")
  10. public void doAfterThrowingAdvice(JoinPoint joinPoint,Throwable exception){
  11. //目標方法名:
  12. System.out.println(joinPoint.getSignature().getName());
  13. if(exception instanceof NullPointerException){
  14. System.out.println("發生了空指針異常!!!!!");
  15. }
  16. }
Controller里配置響應的請求處理類:
 
  1. @RequestMapping("/testAfterThrowing.do")
  2. public String testAfterThrowing(String key){
  3. throw new NullPointerException();
  4. }
后置異常通知方法的處理結果如下所示:

后置最終通知

后置最終通知的配置方式如下:
 
  1. /**
  2. * 后置最終通知(目標方法只要執行完了就會執行后置通知方法)
  3. * @param joinPoint
  4. */
  5. @After("executeService()")
  6. public void doAfterAdvice(JoinPoint joinPoint){
  7. System.out.println("后置通知執行了!!!!");
  8. }
Controller類配置相應的請求處理類:
 
  1. @RequestMapping("/testAfter.do")
  2. public String testAfter(String key){
  3. throw new NullPointerException();
  4. }
  5. @RequestMapping("/testAfter02.do")
  6. public String testAfter02(String key){
  7. return key;
  8. }
當發送請求為:http://localhost:8001/aop/testAfter.do?key=55553&value=855sss

當發送請求為:http://localhost:8001/aop/testAfter02.do?key=55553&value=855sss

?

環繞通知

環繞通知的配置方式如下:
 
  1. /**
  2. * 環繞通知:
  3. * 環繞通知非常強大,可以決定目標方法是否執行,什么時候執行,執行時是否需要替換方法參數,執行完畢是否需要替換返回值。
  4. * 環繞通知第一個參數必須是org.aspectj.lang.ProceedingJoinPoint類型
  5. */
  6. @Around("execution(* com.zkn.learnspringboot.web.controller..*.testAround*(..))")
  7. public Object doAroundAdvice(ProceedingJoinPoint proceedingJoinPoint){
  8. System.out.println("環繞通知的目標方法名:"+proceedingJoinPoint.getSignature().getName());
  9. try {
  10. Object obj = proceedingJoinPoint.proceed();
  11. return obj;
  12. } catch (Throwable throwable) {
  13. throwable.printStackTrace();
  14. }
  15. return null;
  16. }
Controller對應的請求處理類如下:
 
  1. @RequestMapping("/testAroundService.do")
  2. public String testAroundService(String key){
  3. return "環繞通知:"+key;
  4. }
當發送請求為:http://localhost:8001/aop/testAroundService.do?key=55553
當發送請求為:http://localhost:8001/aop/testAfter02.do?key=55553&value=855sss時,不符合環繞通知的切入規則,所以環繞通知不會 執行。
完整的AOP配置代碼如下:
 
  1. package com.zkn.learnspringboot.aop;
  2. import com.alibaba.fastjson.JSON;
  3. import com.google.common.collect.Maps;
  4. import org.aspectj.lang.JoinPoint;
  5. import org.aspectj.lang.ProceedingJoinPoint;
  6. import org.aspectj.lang.Signature;
  7. import org.aspectj.lang.annotation.*;
  8. import org.springframework.stereotype.Component;
  9. import org.springframework.web.context.request.RequestAttributes;
  10. import org.springframework.web.context.request.RequestContextHolder;
  11. import javax.servlet.http.HttpServletRequest;
  12. import javax.servlet.http.HttpSession;
  13. import java.util.Enumeration;
  14. import java.util.Map;
  15. /**
  16. * Created by zkn on 2016/11/18.
  17. */
  18. @Component
  19. @Aspect
  20. public class WebControllerAop {
  21. //匹配com.zkn.learnspringboot.web.controller包及其子包下的所有類的所有方法
  22. @Pointcut("execution(* com.zkn.learnspringboot.web.controller..*.*(..))")
  23. public void executeService(){
  24. }
  25. /**
  26. * 前置通知,方法調用前被調用
  27. * @param joinPoint
  28. */
  29. @Before("executeService()")
  30. public void doBeforeAdvice(JoinPoint joinPoint){
  31. System.out.println("我是前置通知!!!");
  32. //獲取目標方法的參數信息
  33. Object[] obj = joinPoint.getArgs();
  34. //AOP代理類的信息
  35. joinPoint.getThis();
  36. //代理的目標對象
  37. joinPoint.getTarget();
  38. //用的最多 通知的簽名
  39. Signature signature = joinPoint.getSignature();
  40. //代理的是哪一個方法
  41. System.out.println(signature.getName());
  42. //AOP代理類的名字
  43. System.out.println(signature.getDeclaringTypeName());
  44. //AOP代理類的類(class)信息
  45. signature.getDeclaringType();
  46. //獲取RequestAttributes
  47. RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
  48. //從獲取RequestAttributes中獲取HttpServletRequest的信息
  49. HttpServletRequest request = (HttpServletRequest) requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST);
  50. //如果要獲取Session信息的話,可以這樣寫:
  51. //HttpSession session = (HttpSession) requestAttributes.resolveReference(RequestAttributes.REFERENCE_SESSION);
  52. Enumeration<String> enumeration = request.getParameterNames();
  53. Map<String,String> parameterMap = Maps.newHashMap();
  54. while (enumeration.hasMoreElements()){
  55. String parameter = enumeration.nextElement();
  56. parameterMap.put(parameter,request.getParameter(parameter));
  57. }
  58. String str = JSON.toJSONString(parameterMap);
  59. if(obj.length > 0) {
  60. System.out.println("請求的參數信息為:"+str);
  61. }
  62. }
  63. /**
  64. * 后置返回通知
  65. * 這里需要注意的是:
  66. * 如果參數中的第一個參數為JoinPoint,則第二個參數為返回值的信息
  67. * 如果參數中的第一個參數不為JoinPoint,則第一個參數為returning中對應的參數
  68. * returning 限定了只有目標方法返回值與通知方法相應參數類型時才能執行后置返回通知,否則不執行,對于returning對應的通知方法參數為Object類型將匹配任何目標返回值
  69. * @param joinPoint
  70. * @param keys
  71. */
  72. @AfterReturning(value = "execution(* com.zkn.learnspringboot.web.controller..*.*(..))",returning = "keys")
  73. public void doAfterReturningAdvice1(JoinPoint joinPoint,Object keys){
  74. System.out.println("第一個后置返回通知的返回值:"+keys);
  75. }
  76. @AfterReturning(value = "execution(* com.zkn.learnspringboot.web.controller..*.*(..))",returning = "keys",argNames = "keys")
  77. public void doAfterReturningAdvice2(String keys){
  78. System.out.println("第二個后置返回通知的返回值:"+keys);
  79. }
  80. /**
  81. * 后置異常通知
  82. * 定義一個名字,該名字用于匹配通知實現方法的一個參數名,當目標方法拋出異常返回后,將把目標方法拋出的異常傳給通知方法;
  83. * throwing 限定了只有目標方法拋出的異常與通知方法相應參數異常類型時才能執行后置異常通知,否則不執行,
  84. * 對于throwing對應的通知方法參數為Throwable類型將匹配任何異常。
  85. * @param joinPoint
  86. * @param exception
  87. */
  88. @AfterThrowing(value = "executeService()",throwing = "exception")
  89. public void doAfterThrowingAdvice(JoinPoint joinPoint,Throwable exception){
  90. //目標方法名:
  91. System.out.println(joinPoint.getSignature().getName());
  92. if(exception instanceof NullPointerException){
  93. System.out.println("發生了空指針異常!!!!!");
  94. }
  95. }
  96. /**
  97. * 后置最終通知(目標方法只要執行完了就會執行后置通知方法)
  98. * @param joinPoint
  99. */
  100. @After("executeService()")
  101. public void doAfterAdvice(JoinPoint joinPoint){
  102. System.out.println("后置通知執行了!!!!");
  103. }
  104. /**
  105. * 環繞通知:
  106. * 環繞通知非常強大,可以決定目標方法是否執行,什么時候執行,執行時是否需要替換方法參數,執行完畢是否需要替換返回值。
  107. * 環繞通知第一個參數必須是org.aspectj.lang.ProceedingJoinPoint類型
  108. */
  109. @Around("execution(* com.zkn.learnspringboot.web.controller..*.testAround*(..))")
  110. public Object doAroundAdvice(ProceedingJoinPoint proceedingJoinPoint){
  111. System.out.println("環繞通知的目標方法名:"+proceedingJoinPoint.getSignature().getName());
  112. try {//obj之前可以寫目標方法執行前的邏輯
  113. Object obj = proceedingJoinPoint.proceed();//調用執行目標方法
  114. return obj;
  115. } catch (Throwable throwable) {
  116. throwable.printStackTrace();
  117. }
  118. return null;
  119. }
  120. }
完整的Controller類代碼如下:
 
  1. package com.zkn.learnspringboot.web.controller;
  2. import org.springframework.web.bind.annotation.RequestMapping;
  3. import org.springframework.web.bind.annotation.RestController;
  4. /**
  5. * Created by zkn on 2016/11/19.
  6. */
  7. @RestController
  8. @RequestMapping("/aop")
  9. public class AopTestController {
  10. @RequestMapping("/testBeforeService.do")
  11. public String testBeforeService(String key,String value){
  12. return "key="+key+" value="+value;
  13. }
  14. @RequestMapping("/testAfterReturning.do")
  15. public String testAfterReturning(String key){
  16. return "key=: "+key;
  17. }
  18. @RequestMapping("/testAfterReturning01.do")
  19. public Integer testAfterReturning01(Integer key){
  20. return key;
  21. }
  22. @RequestMapping("/testAfterThrowing.do")
  23. public String testAfterThrowing(String key){
  24. throw new NullPointerException();
  25. }
  26. @RequestMapping("/testAfter.do")
  27. public String testAfter(String key){
  28. throw new NullPointerException();
  29. }
  30. @RequestMapping("/testAfter02.do")
  31. public String testAfter02(String key){
  32. return key;
  33. }
  34. @RequestMapping("/testAroundService.do")
  35. public String testAroundService(String key){
  36. return "環繞通知:"+key;
  37. }
  38. }

代碼地址:?https://github.com/zhangconan/LearnSpringBoot/tree/master/src/main/java/com/zkn/learnspringboot/aop?

轉自:https://blog.csdn.net/zknxx/article/details/53240959

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/448988.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/448988.shtml
英文地址,請注明出處:http://en.pswp.cn/news/448988.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

9件事把你從消極情緒中解救出來

也許你很難相信&#xff0c;但是情緒可以通過重復形成習慣。消極情緒甚至可以變成某種嵌入你每日生活的東西。 如何將它們趕跑? 你發現你不斷地埋怨世界和自己?你可以輕易地生氣并且對人變得刻薄?那憤怒又是否成為你對事情本能的回應了?如果你對所述問題中的一個回答了“是…

數據庫主鍵自增插入顯示值

版權聲明&#xff1a;本文為博主原創文章&#xff0c;未經博主同意不得轉載。 https://blog.csdn.net/nwsuaf2009012882/article/details/32703597 SQL Server 2008 數據庫主鍵自增插入顯示值 前幾天在工作的時候遇到在刪除數據庫中表的數據的時候。刪除之后&#xff0c;又一次…

解決: This application has no explicit mapping for /error, so you are seeing this as a fallback.

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 報錯如題&#xff0c;出現這個異常說明了跳轉頁面的url無對應的值. 原因1: Application啟動類的位置不對.要將Application類放在最外側…

Selenium自動化獲取WebSocket信息

性能日志 ChromeDriver支持性能日志記錄&#xff0c;您可以從中獲取域“時間軸”&#xff0c;“網絡”和“頁面”的事件&#xff0c;以及指定跟蹤類別的跟蹤數據。啟用性能日志 默認情況下不啟用性能日志記錄。因此&#xff0c;在創建新會話時&#xff0c;您必須啟用它。 Desir…

零負債之人的10個習慣

無論你是已下定決心要于今年實現零負債&#xff0c;還是距離這個目標的實現有很長的路要走&#xff0c;能受到啟發總是好事。 看看你認識的已經過上“無債一身輕”生活的人──朋友、家人、同事或是你認為可能與其他無負債之人具有類似品質的人。 下文為無負債之人的10個共同…

《App后臺開發運維與架構實踐》第3章 App后臺核心技術

2019獨角獸企業重金招聘Python工程師標準>>> 3.1 用戶驗證方案 3.1.1 使用HTTPS協議 HTTPS協議是“HTTP協議”和“SSL/TLS”的組合。SSL&#xff08;Secure Sockets Layer&#xff09;&#xff0c;即安全套接層&#xff0c;是為了解決因HTTP協議是明文而導致傳輸內容…

IntelliJ IDEA 配置 JDK

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 提前安裝jdk&#xff0c;配置環境變量 一、配置jdk 1、依次點開File -->Project Structure&#xff0c;點擊左側標簽頁&#xff0c…

xml編輯無提示?這么破!

在學習testng這個單元測試框架時&#xff0c;如果咱們碰到了編輯測試套件xml&#xff0c;不提示的情況&#xff08;有提示方便咱們學習&#xff0c;并且testng的測試套件定義必須按照他的dtd文件約束來&#xff09;&#xff0c;咱們可以按照下面的步驟去解決這個問題。 1.檢查t…

“云棲直播”升級為“公開課”

直播平臺是面向廣大開發者的視頻學習平臺&#xff0c;幫助廣大開發者學習最新技術&#xff0c;了解最新阿里云產品以及最新技術發展趨勢&#xff0c;幫助開發者們不斷學習與成長。截止到2019年3月&#xff0c;直播共進行800余場&#xff0c;觀看人次100萬。  社區將對“云棲直…

遭銀行賬號詐騙最快最有效自救法

銀行卡或賬戶詐騙案件層出不窮&#xff0c;當匯錯款時該怎么做&#xff0c;切記以下方法&#xff1a; 一、當匯錯款或被騙匯款后&#xff0c;最快最有效的緊急自救法&#xff1a;當你把自己的錢不小心匯到了不該匯的人卡上&#xff0c;或者被騙子忽悠而把錢匯給了騙子&#xf…

SQL 判斷非空 NULL :IFNUL( ) 、COALESCE( ) 、ISNULL( ) 、NVL( )

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 1. mysql 支持&#xff1a; IFNULL&#xff08;&#xff09;、COALESCE&#xff08;&#xff09; 如 IFNULL(UnitsOnOrder, 0) 或者 CO…

navigator.geolocation的應用 - 將定位信息顯示在百度地圖上

在學習navigator.geolocation的時候&#xff0c;有一個實例是獲取坐標后顯示在谷歌地圖上。眾所周知&#xff0c;谷歌地圖國內并不能直接訪問&#xff0c;得用特殊手段&#xff0c;那我要測試的時候還要開著梯子挺麻煩的&#xff0c;想給別人用也得那個人能訪問谷歌地圖先。 地…

centos7 mysql數據庫安裝和配置

2019獨角獸企業重金招聘Python工程師標準>>> 一、系統環境 yum update升級以后的系統版本為 [rootyl-web yl]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) 二、mysql安裝 一般網上給出的資料都是 #yum install mysql #yum install mysql-serve…

5種聰明工作法

1、每天最多做三件事 請拿出你落落長的待辦清單&#xff0c;圈出最重要的一~三件事&#xff0c;然后給自己一天的時間&#xff0c;卯足全力解決它! 你不需要因為還有很多事要做而焦慮&#xff0c;只需要專注今天、當下、以及最重要的問題。 《與成功有約》作者史蒂芬.柯維(Step…

【Quartz】Quartz概述及入門實例

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 Quartz 在開源任務調度框架中的翹首&#xff0c;它提供了強大任務調度機制&#xff0c;難能可貴的是它同時保持了使用的簡單性。Quartz 允…

python中del語句

有一種方式可以從列表按照給定的索引而不是值來移除一個元素: 那就是 del 語句。 它不同于會返回一個值的 pop() 方法。 del 語句也可以用來從列表中移除切片或者清空整個python列表&#xff08;我們之前用過的方式是將一個空列表賦值給指定的切片&#xff09;。 例如: >>…

偷時間的孩子

從事臨床心理工作已有十三、四年(至一九九五年)&#xff0c;真的有很多話想跟父母們敞開心扉的談談。 忙碌的現代社會&#xff0c;讓我窺探到了許許多多的杰出角色&#xff0c;他們偷取家庭時間去換取自己的功成名就&#xff0c;他們的心隨著公司的企劃案四處流浪&#xff0c;孩…

關于openstack 專業博主地址.后續更新

首先官方文檔要放的https://docs.openstack.org/ 關于導入鏡像方面說的很詳細的.https://www.cnblogs.com/liawne/p/9322221.html 每天5分鐘系列,有docker openstack等,而且還出書了.https://www.cnblogs.com/CloudMan6/p/5384923.html 轉載于:https://www.cnblogs.com/lovesKe…

Java第一章java語言的概述

一、java語言的概述&#xff1a; 1.1dos命令 常用的dos命令&#xff1a; dir&#xff1a;列出當前目錄下的文件以及文件夾 md&#xff1a;創建目錄 rd&#xff1a;刪除目錄 cd&#xff1a;進入指定目錄 cd..&#xff1a;退回到上一級目錄 cd\&#xff1a;退回到根目錄 del&…

【Quartz】深入Job、JobDetail、JobDataMap、Trigger

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 Quartz API核心接口有&#xff1a; Scheduler – 與scheduler交互的主要API&#xff1b;Job – 你通過scheduler執行任務&#xff0c;你…