Spring Boot集成olingo快速入門demo

1.什么是olingo?

Apache Olingo 是個 Java 庫,用來實現 Open Data Protocol (OData)。 Apache Olingo 包括服務客戶端和 OData 服務器方面。

Open Data Protocol (開放數據協議,OData)

是用來查詢和更新數據的一種Web協議,其提供了把存在于應用程序中的數據暴露出來的方式。OData運用且構建于很多 Web技術之上,比如HTTP、Atom Publishing Protocol(AtomPub)和JSON,提供了從各種應用程序、服務和存儲庫中訪問信息的能力。OData被用來從各種數據源中暴露和訪問信息, 這些數據源包括但不限于:關系數據庫、文件系統、內容管理系統和傳統Web站點。

2.代碼工程

實驗目標

利用olingo實現oData協議

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>springboot-demo</artifactId><groupId>com.et</groupId><version>1.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><artifactId>olingo</artifactId><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-autoconfigure</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency><groupId>org.apache.olingo</groupId><artifactId>olingo-odata2-core</artifactId><version>2.0.11</version><exclusions><exclusion><groupId>javax.ws.rs</groupId><artifactId>javax.ws.rs-api</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.apache.olingo</groupId><artifactId>olingo-odata2-jpa-processor-core</artifactId><version>2.0.11</version></dependency><dependency><groupId>org.apache.olingo</groupId><artifactId>olingo-odata2-jpa-processor-ref</artifactId><version>2.0.11</version><exclusions><exclusion><groupId>org.eclipse.persistence</groupId><artifactId>eclipselink</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jersey</artifactId></dependency></dependencies><profiles><profile><id>local</id><activation><activeByDefault>true</activeByDefault></activation><properties><activatedProperties>local</activatedProperties></properties><dependencies><dependency><groupId>com.h2database</groupId><artifactId>h2</artifactId><scope>runtime</scope></dependency></dependencies></profile><profile><id>cloud</id><activation><activeByDefault>false</activeByDefault></activation><properties><activatedProperties>cloud</activatedProperties></properties></profile></profiles><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build>
</project>

config

package com.et.olingo.config;import com.et.olingo.service.OdataJpaServiceFactory;
import org.apache.olingo.odata2.api.ODataServiceFactory;
import org.apache.olingo.odata2.core.rest.ODataRootLocator;
import org.apache.olingo.odata2.core.rest.app.ODataApplication;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.stereotype.Component;import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.Path;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;
import java.io.IOException;@Component
@ApplicationPath("/odata")
public class JerseyConfig extends ResourceConfig {public JerseyConfig(OdataJpaServiceFactory serviceFactory, EntityManagerFactory entityManagerFactory) {ODataApplication oDataApplication = new ODataApplication();oDataApplication.getClasses().forEach( c -> {if ( !ODataRootLocator.class.isAssignableFrom(c)) {register(c);}});register(new ODataServiceRootLocator(serviceFactory));register(new EntityManagerFilter(entityManagerFactory));}@Path("/")public static class ODataServiceRootLocator extends ODataRootLocator {private OdataJpaServiceFactory serviceFactory;@Injectpublic ODataServiceRootLocator (OdataJpaServiceFactory serviceFactory) {this.serviceFactory = serviceFactory;}@Overridepublic ODataServiceFactory getServiceFactory() {return this.serviceFactory;}}@Providerpublic static class EntityManagerFilter implements ContainerRequestFilter,ContainerResponseFilter {public static final String EM_REQUEST_ATTRIBUTE =EntityManagerFilter.class.getName() + "_ENTITY_MANAGER";private final EntityManagerFactory entityManagerFactory;@Contextprivate HttpServletRequest httpRequest;public EntityManagerFilter(EntityManagerFactory entityManagerFactory) {this.entityManagerFactory = entityManagerFactory;}@Overridepublic void filter(ContainerRequestContext containerRequestContext) throws IOException {EntityManager entityManager = this.entityManagerFactory.createEntityManager();httpRequest.setAttribute(EM_REQUEST_ATTRIBUTE, entityManager);if (!"GET".equalsIgnoreCase(containerRequestContext.getMethod())) {entityManager.getTransaction().begin();}}@Overridepublic void filter(ContainerRequestContext requestContext,ContainerResponseContext responseContext) throws IOException {EntityManager entityManager = (EntityManager) httpRequest.getAttribute(EM_REQUEST_ATTRIBUTE);if (!"GET".equalsIgnoreCase(requestContext.getMethod())) {EntityTransaction entityTransaction = entityManager.getTransaction(); //we do not commit because it's just a READif (entityTransaction.isActive() && !entityTransaction.getRollbackOnly()) {entityTransaction.commit();}}entityManager.close();}}}

controller

package com.et.olingo.controller;import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.HashMap;
import java.util.Map;@RestController
public class HelloWorldController {@RequestMapping("/hello")public Map<String, Object> showHelloWorld(){Map<String, Object> map = new HashMap<>();map.put("msg", "HelloWorld");return map;}
}

entity

138327882-76404655-f383-46e6-82af-677560b5ccee

service

package com.et.olingo.service;import com.et.olingo.entity.Child;
import org.apache.olingo.odata2.api.edm.EdmException;
import org.apache.olingo.odata2.api.ep.EntityProviderException;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.exception.ODataNotFoundException;
import org.apache.olingo.odata2.api.processor.ODataResponse;
import org.apache.olingo.odata2.api.uri.info.*;
import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
import org.apache.olingo.odata2.jpa.processor.api.ODataJPADefaultProcessor;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;import java.io.InputStream;
import java.util.List;public class CustomODataJpaProcessor extends ODataJPADefaultProcessor {private Logger logger = LoggerFactory.getLogger(getClass());public CustomODataJpaProcessor(ODataJPAContext oDataJPAContext) {super(oDataJPAContext);}@Overridepublic ODataResponse readEntitySet(final GetEntitySetUriInfo uriParserResultView, final String contentType) throws ODataJPAModelException, ODataJPARuntimeException, EdmException {logger.info("READ: Entity Set {} called", uriParserResultView.getTargetEntitySet().getName());try {List<Object> jpaEntities = jpaProcessor.process(uriParserResultView);return responseBuilder.build(uriParserResultView, jpaEntities, contentType);} finally {this.close();}}@Overridepublic ODataResponse readEntity(final GetEntityUriInfo uriParserResultView, final String contentType) throws ODataJPAModelException, ODataJPARuntimeException, ODataNotFoundException, EdmException {ODataResponse response = null;if (uriParserResultView.getKeyPredicates().size() > 1) {logger.info("READ: Entity {} called with key {} and key {}", uriParserResultView.getTargetEntitySet().getName(), uriParserResultView.getKeyPredicates().get(0).getLiteral(), uriParserResultView.getKeyPredicates().get(1).getLiteral());} else {logger.info("READ: Entity {} called with key {}", uriParserResultView.getTargetEntitySet().getName(), uriParserResultView.getKeyPredicates().get(0).getLiteral());}try {Object readEntity = jpaProcessor.process(uriParserResultView);response = responseBuilder.build(uriParserResultView, readEntity, contentType);} finally {this.close();}return response;}@Overridepublic ODataResponse createEntity(final PostUriInfo uriParserResultView, final InputStream content, final String requestContentType, final String contentType) throws ODataJPAModelException, ODataJPARuntimeException, ODataNotFoundException, EdmException, EntityProviderException {logger.info("POST: Entity {} called", uriParserResultView.getTargetEntitySet().getName());ODataResponse response = null;try {Object createdEntity = jpaProcessor.process(uriParserResultView, content, requestContentType);if (createdEntity.getClass().equals(Child.class)) {response = postProcessCreateChild(createdEntity, uriParserResultView, contentType);} else {response = responseBuilder.build(uriParserResultView, createdEntity, contentType);}} finally {this.close();}return response;}@Overridepublic ODataResponse updateEntity(final PutMergePatchUriInfo uriParserResultView, final InputStream content,final String requestContentType, final boolean merge, final String contentType) throws ODataException, ODataJPAModelException, ODataJPARuntimeException, ODataNotFoundException {logger.info("PUT: Entity {} called with key {}", uriParserResultView.getTargetEntitySet().getName(), uriParserResultView.getKeyPredicates().get(0).getLiteral());ODataResponse response = null;try {Object updatedEntity = jpaProcessor.process(uriParserResultView, content, requestContentType);response = responseBuilder.build(uriParserResultView, updatedEntity);} finally {this.close();}return response;}@Overridepublic ODataResponse deleteEntity(DeleteUriInfo uriParserResultView, String contentType) throws ODataException {logger.info("DELETE: Entity {} called with key {}", uriParserResultView.getTargetEntitySet().getName(), uriParserResultView.getKeyPredicates().get(0).getLiteral());ODataResponse oDataResponse = null;try {this.oDataJPAContext.setODataContext(this.getContext());Object deletedEntity = this.jpaProcessor.process(uriParserResultView, contentType);oDataResponse = this.responseBuilder.build(uriParserResultView, deletedEntity);} finally {this.close();}return oDataResponse;}private ODataResponse postProcessCreateChild(Object createdEntity, PostUriInfo uriParserResultView, String contentType) throws ODataJPARuntimeException, ODataNotFoundException {Child child = (Child) createdEntity;if (child.getSurname() == null || child.getSurname().equalsIgnoreCase("")) {if (child.getMother().getSurname() != null && !child.getMother().getSurname().equalsIgnoreCase("")) {child.setSurname(child.getMother().getSurname());} else if (child.getMother().getSurname() != null && !child.getFather().getSurname().equalsIgnoreCase("")) {child.setSurname(child.getFather().getSurname());} else {child.setSurname("Gashi");}}return responseBuilder.build(uriParserResultView, createdEntity, contentType);}}
package com.et.olingo.service;import com.et.olingo.config.JerseyConfig;
import org.apache.olingo.odata2.api.ODataService;
import org.apache.olingo.odata2.api.ODataServiceFactory;
import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataContext;
import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAAccessFactory;
import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAFactory;import javax.persistence.EntityManager;
import javax.servlet.http.HttpServletRequest;public class CustomODataServiceFactory extends ODataServiceFactory {private ODataJPAContext oDataJPAContext;private ODataContext oDataContext;@Overridepublic final ODataService createService(final ODataContext context) throws ODataException {oDataContext = context;oDataJPAContext = initializeODataJPAContext();validatePreConditions();ODataJPAFactory factory = ODataJPAFactory.createFactory();ODataJPAAccessFactory accessFactory = factory.getODataJPAAccessFactory();if (oDataJPAContext.getODataContext() == null) {oDataJPAContext.setODataContext(context);}ODataSingleProcessor oDataSingleProcessor = new CustomODataJpaProcessor(oDataJPAContext);EdmProvider edmProvider = accessFactory.createJPAEdmProvider(oDataJPAContext);return createODataSingleProcessorService(edmProvider, oDataSingleProcessor);}private void validatePreConditions() throws ODataJPARuntimeException {if (oDataJPAContext.getEntityManager() == null) {throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ENTITY_MANAGER_NOT_INITIALIZED, null);}}public final ODataJPAContext getODataJPAContext()throws ODataJPARuntimeException {if (oDataJPAContext == null) {oDataJPAContext = ODataJPAFactory.createFactory().getODataJPAAccessFactory().createODataJPAContext();}if (oDataContext != null)oDataJPAContext.setODataContext(oDataContext);return oDataJPAContext;}protected ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {ODataJPAContext oDataJPAContext = this.getODataJPAContext();ODataContext oDataContext = oDataJPAContext.getODataContext();HttpServletRequest request = (HttpServletRequest) oDataContext.getParameter(ODataContext.HTTP_SERVLET_REQUEST_OBJECT);EntityManager entityManager = (EntityManager) request.getAttribute(JerseyConfig.EntityManagerFilter.EM_REQUEST_ATTRIBUTE);oDataJPAContext.setEntityManager(entityManager);oDataJPAContext.setPersistenceUnitName("default");oDataJPAContext.setContainerManaged(true);return oDataJPAContext;}
}
package com.et.olingo.service;import org.springframework.stereotype.Component;@Component
public class OdataJpaServiceFactory extends CustomODataServiceFactory {//need this wrapper class for the spring framework, otherwise we face issues when auto wiring directly the CustomODataServiceFactory
}

application.yaml

spring.h2.console.enabled=true
spring.h2.console.path=/console

以上只是一些關鍵代碼,所有代碼請參見下面代碼倉庫

代碼倉庫

  • GitHub - Harries/springboot-demo: a simple springboot demo with some components for example: redis,solr,rockmq and so on.

3.測試

啟動spring Boot應用

元數據查看

http://localhost:8080/odata/$metadata

138900236-f6ba4cca-c3e4-49ea-97c3-e80e5835aa7d

插入

167310946-febc1bc1-e898-4d31-aa94-efb423e69d1d

查詢

167310988-142c61c2-49ab-487d-927e-0f6edd1e6376

4.引用

  • https://github.com/ECasio/olingo-spring-example
  • Apache Olingo Library
  • Spring Boot集成olingo快速入門demo | Harries Blog?

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

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

相關文章

【吊打面試官系列-MyBatis面試題】MyBatis 實現一對多有幾種方式,怎么操作的?

大家好&#xff0c;我是鋒哥。今天分享關于 【MyBatis 實現一對多有幾種方式,怎么操作的&#xff1f;】面試題&#xff0c;希望對大家有幫助&#xff1b; MyBatis 實現一對多有幾種方式,怎么操作的&#xff1f; 有聯合查詢和嵌套查詢。聯合查詢是幾個表聯合查詢,只查詢一次,通過…

觀察矩陣(View Matrix)、投影矩陣(Projection Matrix)、視口矩陣(Window Matrix)及VPM矩陣及它們之間的關系

V表示攝像機的觀察矩陣&#xff08;View Matrix&#xff09;&#xff0c;它的作用是把對象從世界坐標系變換到攝像機坐標系。因此&#xff0c;對于世界坐標系下的坐標值worldCoord(x0, y0, z0)&#xff0c;如果希望使用觀察矩陣VM將其變換為攝像機坐標系下的坐標值localCoord(x…

【滲透入門】HTTP請求包

文章目錄 前言HTTP GET請求包HTTP POST請求包Content-Type 前言 HTTP&#xff08;HyperText Transfer Protocol&#xff09;請求包&#xff0c;是Web通信的基礎。HTTP請求包格式主要由以下幾部分組成&#xff1a; 請求行&#xff1a;包含了請求方法&#xff08;GET、POST、PUT…

32單片機,C語言與匯編聯合編譯的幾種方式

適用編譯器&#xff1a;Keil5 方式一&#xff1a; 單獨創建一個.s匯編文件&#xff0c;在匯編文件內對函數進行EXPORT聲明 r0寄存器是函數傳入的第一個參數&#xff0c;r1寄存器是函數傳入的第二個參數&#xff0c;以次類推。參數最多不確定是到r4為止&#xff0c;還是到r12…

Node.js-path 模塊

path 模塊 path 模塊提供了 操作路徑 的功能&#xff0c;如下是幾個較為常用的幾個 API&#xff1a; 代碼實例&#xff1a; const path require(path);//獲取路徑分隔符 console.log(path.sep);//拼接絕對路徑 console.log(path.resolve(__dirname, test));//解析路徑 let pa…

Robust Regression

最小二乘回歸受數據中的離群點的影響較大&#xff0c;穩健回歸通過降低離群點的影響緩解此問題。M估計法是穩健回歸的重要方法之一&#xff0c;M 估計法的目標函數為&#xff1a; m i n ∑ ρ ( ? i ) m i n ∑ ρ ( y i ? β ^ ? X i ) min\sum\rho(\epsilon_i) min\sum\…

vulhub-activemq(CVE-2016-3088)

在 Apache ActiveMQ 5.12.x~5.13.x 版本中&#xff0c;默認關閉了 fileserver 這個應用&#xff08;不過&#xff0c;可以在conf/jetty.xml 中開啟&#xff09;&#xff1b;在 5.14.0 版本后&#xff0c;徹底刪除了 fileserver 應用。【所以在滲透測試過程中要確定好 ActiveMQ …

word 使用手冊

word 文檔中如何將下行的指定文字退格到上行中 就像是這樣的 編號&#xff1a;111 密碼&#xff1a;222 編號&#xff1a;123 密碼&#xff1a;321 編號&#xff1a;124 密碼&#xff1a;331 變成 編號&#xff1a;111密碼&#xff1a;222 編號&#xff1a;123密碼&#xff1…

數據結構1:C++實現變長數組

數組作為線性表的一種&#xff0c;具有內存連續這一特點&#xff0c;可以通過下標訪問元素&#xff0c;并且下標訪問的時間復雜的是O(1)&#xff0c;在數組的末尾插入和刪除元素的時間復雜度同樣是O(1)&#xff0c;我們使用C實現一個簡單的邊長數組。 數據結構定義 class Arr…

華為OD機試 - 來自異國的客人(Java 2024 D卷 100分)

華為OD機試 2024D卷題庫瘋狂收錄中&#xff0c;刷題點這里 專欄導讀 本專欄收錄于《華為OD機試&#xff08;JAVA&#xff09;真題&#xff08;D卷C卷A卷B卷&#xff09;》。 刷的越多&#xff0c;抽中的概率越大&#xff0c;每一題都有詳細的答題思路、詳細的代碼注釋、樣例測…

新手教學系列——前后端分離API優化版

在之前的文章《Vue 前后端分離開發:懶人必備的API SDK》中,我介紹了通過Object對象自動生成API的方法。然而,之前的代碼存在一些冗余之處。今天,我將分享一個改進版本,幫助你更高效地管理API。 改進版API SDK 首先,讓我們來看一下改進后的代碼: import request from …

深入理解 KVO

在 iOS 中&#xff0c;KVO&#xff08;Key-Value Observing&#xff09;是一個強大的觀察機制&#xff0c;它的底層實現相對復雜。KVO 利用 Objective-C 的動態特性&#xff0c;為對象的屬性提供觀察能力。 KVO 的底層實現 1. 動態子類化 當一個對象的屬性被添加觀察者時&am…

6、Redis系統-數據結構-01-String

Redis 數據結構簡介 前言 Redis 是一個高性能的內存數據庫&#xff0c;其關鍵在于其數據結構的設計。Redis 數據結構是指底層實現 Redis 鍵值對中值的數據類型的方式。它包括了以下幾種主要對象&#xff1a; String&#xff08;字符串&#xff09;對象&#xff1a;最基本的數…

[C++][CMake][流程控制]詳細講解

目錄 1.條件判斷1.基本表達式2.邏輯判斷3.比較4.文件操作5.其他 2.循環1.foreach2.while 1.條件判斷 在進行條件判斷的時候&#xff0c;如果有多個條件&#xff0c;那么可以寫多個elseif&#xff0c;最后一個條件可以使用else&#xff0c;但是開始和結束是必須要成對出現的&am…

WordPress常見問題及簡要說明

1. 如何安裝WordPress? 簡要說明&#xff1a;WordPress是一個流行的內容管理系統&#xff0c;可以幫助用戶快速搭建網站。安裝WordPress需要以下幾個步驟&#xff1a;下載WordPress安裝包、上傳到服務器、創建數據庫、配置數據庫信息、完成安裝。 2. 如何創建一個新的WordPr…

掌握電量脈搏:WebKit 電池狀態(Battery Status API)支持全解析

掌握電量脈搏&#xff1a;WebKit 電池狀態&#xff08;Battery Status API&#xff09;支持全解析 隨著移動設備的廣泛使用&#xff0c;Web 應用對設備的電池狀態信息的需求日益增長。Battery Status API 提供了一種方式&#xff0c;允許 Web 應用訪問設備的電池信息&#xff…

【反悔貪心 反悔堆】1642. 可以到達的最遠建筑

本文涉及知識點 反悔貪心 反悔堆 LeetCode1642. 可以到達的最遠建筑 給你一個整數數組 heights &#xff0c;表示建筑物的高度。另有一些磚塊 bricks 和梯子 ladders 。 你從建筑物 0 開始旅程&#xff0c;不斷向后面的建筑物移動&#xff0c;期間可能會用到磚塊或梯子。 當…

Spring Boot中的全局異常處理

Spring Boot中的全局異常處理 大家好&#xff0c;我是免費搭建查券返利機器人省錢賺傭金就用微賺淘客系統3.0的小編&#xff0c;也是冬天不穿秋褲&#xff0c;天冷也要風度的程序猿&#xff01;今天我們將探討如何在Spring Boot應用中實現全局異常處理&#xff0c;這是保證應用…

VSCode, 請在windows下使用git bash終端

用vscode在windows下調測代碼&#xff0c;運行時默認打開的終端是windows的cmd&#xff0c;很不受我待見。畢竟習慣了linux&#xff0c;習慣了windows下的git bash風格。怎么辦&#xff1f; search&#xff0c;search&#xff0c;research。 先確保windows上安裝了git bash。…

MATLAB 2024b 更新了些什么?

MATLAB 2024b版本已經推出了預覽版&#xff0c;本期介紹一些MATLAB部分的主要的更新內容。 幫助瀏覽器被移除 在此前的版本&#xff0c;當我們從MATLAB中訪問幫助文檔時&#xff0c;默認會通過MATLAB的幫助瀏覽器&#xff08;Help browser&#xff09;。 2024b版本開始&…