找回密码
 立即注册
查看: 7|回复: 0

6,springdoc/swagger文档管理

[复制链接]

180

主题

5

精华

184

金币

技术维护QQ:515138

积分
393
发表于 昨天 16:47 | 显示全部楼层 |阅读模式
1,引入依赖:
  1.        <dependency>
  2.             <groupId>org.springdoc</groupId>
  3.             <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
  4.             <version>2.3.0</version>
  5.         </dependency>
复制代码
2,配置文件config/SwaggerConfig
  1. package com.jinbaozi.common.config;
  2. import io.swagger.v3.oas.annotations.OpenAPIDefinition;
  3. import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
  4. import io.swagger.v3.oas.annotations.info.Info;
  5. import io.swagger.v3.oas.annotations.security.SecurityRequirement;
  6. import io.swagger.v3.oas.annotations.security.SecurityScheme;
  7. import org.springframework.context.annotation.Configuration;
  8. @Configuration
  9. @OpenAPIDefinition(
  10.         info = @Info(
  11.                 title = "金黑",
  12.                 description = "基于springboot3+vue3,年轻人的第一个uniapp小程序项目!",
  13.                 version = "1.0"
  14.         ),
  15.         security = @SecurityRequirement(name = "token")
  16. )
  17. @SecurityScheme(
  18.         name = "token",
  19.         type = SecuritySchemeType.HTTP,
  20.         bearerFormat = "JWT",
  21.         scheme = "bearer"
  22. )
  23. public class SwaggerConfig {
  24. }
复制代码
访问地址:
http://localhost:9999/swagger-ui/index.html


网站建设,公众号小程序开发,系统定制,软件App开发,技术维护【联系我们】手机/微信:17817817816 QQ:515138

QQ|Archiver|自丢网 ( 粤ICP备2024252464号-1 )

GMT+8, 2026-2-4 09:05

专注于网站建设,公众号小程序制作,商城小程序,系统定制,软件App开发

【联系我们】手机/微信:17817817816 QQ:515138

快速回复 返回顶部 返回列表