diff --git a/README.en.md b/README.en.md index 96915bb9..2a7a5663 100644 --- a/README.en.md +++ b/README.en.md @@ -131,7 +131,7 @@ mvn spring-boot:run ``` - Once started, visit (apidoc) or (Swagger UI). If the API docs open, the backend is running properly. + Once started, visit (apishow) or (Swagger UI). If the API docs open, the backend is running properly. 5. Start the frontend (optional): For a visual admin UI, start the companion frontend [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin), visit , and log in with `admin` / `123456`. diff --git a/README.md b/README.md index 13d30f83..5a6a7b27 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ mvn spring-boot:run ``` - 启动后访问 (apidoc)或 (Swagger UI),能打开接口文档即说明后端已正常运行。 + 启动后访问 (apishow)或 (Swagger UI),能打开接口文档即说明后端已正常运行。 5. 启动前端(可选): 如需可视化操作界面,启动配套前端 [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin),访问 ,使用 `admin` / `123456` 登录。 diff --git a/pom.xml b/pom.xml index ede1e4e7..80946bb0 100644 --- a/pom.xml +++ b/pom.xml @@ -76,8 +76,8 @@ 2.2.55 - - 0.3.3 + + 0.4.0 @@ -260,11 +260,11 @@ ${springdoc.version} - + tech.youlai - apidoc-spring-boot-starter - ${apidoc.version} + apishow-spring-boot-starter + ${apishow.version} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 3cb0c97a..a2f32461 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -100,9 +100,9 @@ springdoc: default-flat-param-object: true # 接口文档 UI -apidoc: +apishow: enabled: true # 启用文档页面与静态资源 - path: /doc.html # 文档入口路径,页面资源固定在 /apidoc/ + path: /doc.html # 文档入口路径,页面资源固定在 /apishow/ --- diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 5352b0a1..3dce6280 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -98,7 +98,7 @@ springdoc: - com.youlai.boot.module.workflow.controller default-flat-param-object: true # 将对象参数扁平化显示在文档中 -apidoc: +apishow: enabled: false # 不注册文档入口与静态资源 --- diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1cbc9060..c271f44f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -63,8 +63,8 @@ security: - ${springdoc.swagger-ui.path:/swagger-ui.html} # Swagger UI 路径 - /swagger-ui/** - /v3/api-docs/** - - ${apidoc.path:/doc.html} # apidoc 文档入口 - - /apidoc/** # apidoc 静态资源 + - ${apishow.path:/doc.html} # apishow 文档入口 + - /apishow/** # apishow 静态资源 - /webjars/** - /favicon.ico - /error diff --git a/src/test/java/com/youlai/boot/config/ConfigurationDefaultsTest.java b/src/test/java/com/youlai/boot/config/ConfigurationDefaultsTest.java index d97fb996..bec1c97b 100644 --- a/src/test/java/com/youlai/boot/config/ConfigurationDefaultsTest.java +++ b/src/test/java/com/youlai/boot/config/ConfigurationDefaultsTest.java @@ -124,14 +124,14 @@ class ConfigurationDefaultsTest { void documentUiIsEnabledOutsideProduction(String profile) { contextRunner(profile).run(context -> { assertThat(context).hasNotFailed(); - assertThat(context.getEnvironment().getProperty("apidoc.enabled", Boolean.class, true)) + assertThat(context.getEnvironment().getProperty("apishow.enabled", Boolean.class, true)) .as("文档 UI 应在生产环境关闭") .isEqualTo(!profile.equals("prod")); var permitAllUrls = Binder.get(context.getEnvironment()) .bindOrCreate("security", SecurityProperties.class).getPermitAllUrls(); assertThat(permitAllUrls) - .contains("/doc.html", "/apidoc/**") + .contains("/doc.html", "/apishow/**") .allSatisfy(url -> assertThat(url).doesNotContain("${")); }); }