微服务之Swagger

微服务中整合Swagger2接口框架 在SpringCloud+SpringBoot微服务架构开发模式中,我们通常使用前后端分离的方式进行开发。前后端分离的方式使得接口数据成为前端开发人员与后端开发人员的沟通一种必要方式。Swagger ui 是一个API在线文档生成和测试的利器,在某种程度上可以媲美postman。作为后端开发人员来说可能会更倾向于使用postman来调试接口,但是作为前端人员了解后台接口数据,Swa... 阅读详情

Swagger使用

1. Swagger UI

按以下步骤配置,项目启动后访问:
http://localhost:8080/swagger-ui.html

1.1 添加依赖

    <dependency>
        <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.2.2</version> </dependency>

1.2 配置类

@Configuration  
@EnableSwagger2  
public class Swagger2 { public static final String SWAGGER_SCAN_BASE_PACKAGE = "abc.boot.examples.web"; public static final String VERSION = "1.0.0"; @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE))//api接口包扫描路径 .paths(PathSelectors.any())//可以根据url路径设置哪些请求加入文档,忽略哪些请求 .build(); } private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger2 接口文档示例")//设置文档的标题 .description("更多内容请关注:http://www.abc.com")//设置文档的描述->1.Overview .version(VERSION)//设置文档的版本信息-> 1.1 Version information .contact(new Contact("ABC Boot", "http://www.abc.comt", ""))//设置文档的联系方式->1.2 Contact information .termsOfServiceUrl("www.abc.com")//设置文档的License信息->1.3 License information .build(); } }

1.3 注解使用

@ApiOperation

@ApiOperation(value="获取用户列表", notes="获取所有用户列表",produces = "application/json")  
@RequestMapping(value="/users", method= RequestMethod.GET) public List<User> getUserList() { List<User> r = new ArrayList<User>(users.values()); return r; }

@ApiResponses

@ApiOperation(value="获取用户详细信息", notes="根据url的id来获取用户详细信息",produces = "application/json")
// ApiResponses 增加返回结果的描述 @ApiResponses(value = {@ApiResponse(code = 405,message = "Invalid input",response = Integer.class)}) (1) @ApiImplicitParam(name = "id",value = "用户ID",dataType = "int",paramType = "path") (2) @RequestMapping(value="/users/{id}", method= RequestMethod.GET) public User getUser(@PathVariable Integer id) { return users.get(id); }

(1) 在默认Response的基础上增加新的Response说明
(2) 使用ApiImplicitParam描述接口参数

@ApiImplicitParams

@ApiOperation(value="更新用户名称", notes="更新指定用户的名称")
@RequestMapping(value="/users/{id}", method= RequestMethod.POST) @ApiImplicitParams({ (1) @ApiImplicitParam(name = "id",value = "用户ID",paramType = "path",dataType = "int"), (2) @ApiImplicitParam(name = "userName",value = "用户名称",paramType = "form",dataType = "string") }) public void updateUserName(@PathVariable Integer id,@RequestParam String userName){ User u = users.get(id); u.setName(userName); }

(1) 使用ApiImplicitParams描述多个参数
(2) 使用ApiImplicitParam时,需要指定paramType,这样也便于swagger ui 生成参数的输入格式。

paramType 有五个可选值 : path, query, body, header, form

@ApiParam

@ApiOperation(value="创建用户-传递简单对象", notes="传递简单对象",produces = "application/json")
@RequestMapping(value="/users-1", method= RequestMethod.POST) //可以不加ApiParam注解,需要给参数添加描述时可以使用这个注解,或者使用ApiImplicitParams注解 (1) public Map postUser(@RequestParam String userName,@ApiParam("地址") @RequestParam(required = false) String address) { User user = new User(); user.setId(Math.round(10)); user.setName(userName); user.setAddress(address); users.put(user.getId(), user); return ImmutableMap.of("user",user); }

(1) 使用ApiParam描述接口参数

ApiImplicitParam 与 ApiParam 的区别
ApiImplicitParam: This is the only way to define parameters when using Servlets or other non-JAX-RS environments.

  • 对Servlets或者非 JAX-RS的环境,只能使用 ApiImplicitParam。
  • 在使用上,ApiImplicitParam比ApiParam具有更少的代码侵入性,只要写在方法上就可以了,但是需要提供具体的属性才能配合swagger ui解析使用。
  • ApiParam只需要较少的属性,与swagger ui配合更好。

传递复杂对象 By ModelAttribute

@ApiOperation(value="创建用户-传递复杂对象", notes="传递复杂对象DTO, url参数拼接",produces = "application/json")
@RequestMapping(value="/users-2", method= RequestMethod.POST) //传递对象推荐使用ModelAttribute注解 public Map postUser2(@ModelAttribute User user) { (1) users.put(user.getId(),user); return ImmutableMap.of("user",user); }

(1) ModelAttribute 是Spring mvc的注解,这里Swagger可以解析这个注解,获得User的属性描述

@ApiModel

@ApiModel(value = "User", description = "用户对象")
public class User { @ApiModelProperty(value = "ID") private Integer id; @ApiModelProperty(value = "姓名") private String name; @ApiModelProperty(value = "地址") private String address; @ApiModelProperty(value = "年龄",access = "hidden") private int age; @ApiModelProperty(value = "性别") private int sex; ....... }

传递复杂对象 By RequestBody

@ApiOperation(value="创建用户-传递复杂对象", notes="传递复杂对象DTO,json格式传递数据",produces = "application/json")
@RequestMapping(value="/users-3", method= RequestMethod.POST) //json格式传递对象使用RequestBody注解 public User postUser3(@RequestBody User user) { users.put(user.getId(),user); return user; }

PathVariable

@ApiOperation(value="删除用户- PathVariable", notes="根据url的id来指定删除对象")
@RequestMapping(value="/users/{id}", method = RequestMethod.DELETE) public void deleteUser(@PathVariable Integer id) { (1) users.remove(id); }

(1) PathVariable是Spring 的注解,对于这种简单的参数,就可以不用写ApiParam来描述接口参数。

数组的描述

@ApiOperation(value="删除用户-传递数组", notes="删除对象,传递数组")
@RequestMapping(value="/users/deleteByIds", method = RequestMethod.DELETE) public void deleteUser(@ApiParam("用户ID数组") @RequestParam Integer[] ids) { (1) for (int id:ids){ users.remove(id); } }

(1) 这里用ApiParam为数组参数添加描述

1.4 可选配置

在application.properties中加入以下配置,用于设置测试请求的host,默认在swagger ui上做请求测试时都是以/users/1为路径发送请求。
如果需要改变请求的根路径,就需要配置这个参数:
springfox.documentation.swagger.v2.host = yourapp.abc.com

配置获取api docs json数据的请求路径 ,默认为/v2/api-docs:
springfox.documentation.swagger.v2.path = /api

2. springfox-staticdocs 生成静态文档


springfox

2.1 Maven 配置

<dependency>
    <groupId>io.springfox</groupId> <artifactId>springfox-staticdocs</artifactId> <version>2.2.2</version> <scope>test</scope> </dependency>

2.2 生成json文件

编写Junit测试,这样在测试环节就可以将api-docs的json数据写入文档,便于下一步生成asciidoc文件。

@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = DemoBootApplication.class)
public class Swagger2MarkupTest { @Autowired private WebApplicationContext context; private MockMvc mockMvc; @Before public void setUp() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context).build(); } @Test public void createSpringfoxSwaggerJson() throws Exception { String outputDir = "src/docs/json"; //将api-docs的json数据写入文件 MvcResult mvcResult = this.mockMvc.perform(get("/v2/api-docs") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andReturn(); MockHttpServletResponse response = mvcResult.getResponse(); String swaggerJson = response.getContentAsString(); Files.createDirectories(Paths.get(outputDir)); try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(outputDir, "swagger.json"), StandardCharsets.UTF_8)) { writer.write(swaggerJson); } } }

2.3 配置Maven Plugin

配置以下两个插件:
swagger2markup-maven-plugin,该插件将json文件转为asciidoc
asciidoctor-maven-plugin, 该插件将asciidoc转为html/pdf

执行Maven命令 : mvn swagger2markup:convertSwagger2markup process-resources

生成的html文档存储在src\main\resources\META-INF\resources\docs目录下。
启动DemoBootApplication,直接访问http://localhost:8080/docs/index.html。

<pluginRepositories>
    <pluginRepository> <id>jcenter-snapshots</id> <name>jcenter</name> <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url> </pluginRepository> <pluginRepository> <snapshots> <enabled>false</enabled> </snapshots> <id>jcenter-releases</id> <name>jcenter</name> <url>http://jcenter.bintray.com</url> </pluginRepository> </pluginRepositories> <build> <plugins> <!-- First, use the swagger2markup plugin to generate asciidoc --> <plugin> <groupId>io.github.swagger2markup</groupId> <artifactId>swagger2markup-maven-plugin</artifactId> <version>${swagger2markup.plugin.version}</version> <dependencies> <dependency> <groupId>io.github.swagger2markup</groupId> <artifactId>swagger2markup-import-files-ext</artifactId> <version>${swagger2markup.extension.version}</version> </dependency> <dependency> <groupId>io.github.swagger2markup</groupId> <artifactId>swagger2markup</artifactId> <version>${swagger2markup.version}</version> </dependency> </dependencies> <configuration> <!--The URL or file path to the Swagger specification--> <swaggerInput>${swagger.input}</swaggerInput> <outputDir>${generated.asciidoc.directory}</outputDir> <config> <!--设置输出文件的语言:ASCIIDOC, MARKDOWN, CONFLUENCE_MARKUP--> <swagger2markup.markupLanguage>ASCIIDOC</swagger2markup.markupLanguage> <!--设置目录的展现方式--> <swagger2markup.pathsGroupedBy>TAGS</swagger2markup.pathsGroupedBy> <!--扩展Overview的内容,可以增加一些自定义的内容--> <!--<swagger2markup.extensions.dynamicOverview.contentPath>${project.basedir}/src/docs/asciidoc/extensions/overview</swagger2markup.extensions.dynamicOverview.contentPath> <swagger2markup.extensions.dynamicDefinitions.contentPath>${project.basedir}/src/docs/asciidoc/extensions/definitions</swagger2markup.extensions.dynamicDefinitions.contentPath> <swagger2markup.extensions.dynamicPaths.contentPath>${project.basedir}/src/docs/asciidoc/extensions/paths</swagger2markup.extensions.dynamicPaths.contentPath> <swagger2markup.extensions.dynamicSecurity.contentPath>${project.basedir}src/docs/asciidoc/extensions/security</swagger2markup.extensions.dynamicSecurity.contentPath>--> </config> </configuration> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>convertSwagger2markup</goal> </goals> </execution> </executions> </plugin> <!-- Run the generated asciidoc through Asciidoctor to generate other documentation types, such as PDFs or HTML5 --> <plugin> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-maven-plugin</artifactId> <version>1.5.3</version> <!-- Include Asciidoctor PDF for pdf generation --> <dependencies> <dependency> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctorj-pdf</artifactId> <version>1.5.0-alpha.11</version> </dependency> <!-- Comment this section to use the default jruby artifact provided by the plugin --> <dependency> <groupId>org.jruby</groupId> <artifactId>jruby-complete</artifactId> <version>${jruby.version}</version> </dependency> <!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin --> <dependency> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctorj</artifactId> <version>${asciidoctorj.version}</version> </dependency> </dependencies> <!-- Configure generic document generation settings --> <configuration> <!--默认指向 ${basedir}

3. 其他说明

3.1 如何修改/v2/api-docs路径?

swagger-ui是通过获取接口的json数据渲染页面的,即通过swagger的注解将生成接口的描述服务,默认地址为/v2/api-docs,如果需要改变这个请求地址,可以在properties中配置springfox.documentation.swagger.v2.path。

3.2 如何设置所有请求的统一前缀?

默认请求都是以 / 根路径开始,如果我们的应用不是部署在根路径,比如以/platform部署,则可以通过一下方式设置请求的统一前缀。

@Bean
public Docket createV1RestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE)) .paths(PathSelectors.any()) .build() .pathMapping("/platform"); // 在这里可以设置请求的统一前缀 }

3.3 接口文档中1.4和1.5的信息生成

接口文档中的 1.4和 1.5 则通过以下方式生成:
1.4 URI scheme
// 可以通过在properties中设置 springfox.documentation.swagger.v2.host属性
Host : localhost

// 待确认
BasePath : /

该Host也是swagger-ui发送测试请求的Host, 通常我们会将将接口文档部署在测试服务器,这样就需要设置Host,
否则请求都是通过localhost发送,请求不到测试服务器的接口。

1.5 Tags
@Api(value = "/v1/users",tags = "Users",description = "用户接口V1")
tags由Api注解的tags标签设置,如果不设置,则以类名作为tag

3.4 设置响应对象的Example

通过ApiModelProperty注解的example属性设置响应对象的示例:

@ApiModelProperty(value = "ID",example = "1")
private Integer id;
@ApiModelProperty(value = "姓名",example = "Admin") private String name; @ApiModelProperty(value = "地址",example = "171") private String address; @ApiModelProperty(value = "年龄",access = "hidden",example = "20") private int age; @ApiModelProperty(value = "性别",example = "1") private int sex; @ApiModelProperty(value = "生日",example = "2000-10-22")

链接

springfox文档

http://www.jianshu.com/p/b730b969b6a2

微服务之整合Swagger接口文档 微服务之整合Swagger接口文档Maven依赖配置网关配置Swagger网关依赖依赖配置swagger配置文件 -- configSwagger过滤器 -- filterSwagger控制层 -- handler配置文件yaml子系统对接网关接口文档配置文件 -- yaml接口使用Swagger注解Swagger配置说明配置启动类 Maven依赖配置 <dependency> ... 阅读详情

相关推荐

knife4j,微服务聚合Swagger文档

api文档聚合

feng908802144的专栏 2225

Eureka客户端注册多网卡下IP选择问题

  在使用Spring Cloud多人协作开发时有一个场景:我本机启动了Eureka注册中心,其他人机器需要将服务注册到我本机的Eureka。(服务端和客户端在不同机器上)   这时出现了一个问题:服务成功注册到Eureka,但是该服务接口无法访问。   查看日志:gateway下的日志显示服务找不到。   查找问题:尝试telnet该服务的IP地址,发现网络不通。为了确认IP地址无误,...

weixin_34327761的博客 601

微服务网关管理swagger

1:yml配置网关(约定大于配置的方式,一般不用这样的配置),例如访问http://localhost:8087/product-service/product/9 ,中的product-service为服务的名字。3-1:方法一:使用application.properties/application.yml配置(推荐)2:访问网关的swagger,这是路径,这时候就需要做每一个服务配置路径,让其可以访问到。4:如果使用的是jeecgboot项目的网关,可以配置启动和关闭swagger。

qq_19891197的博客 582

swagger 找不到 json 文件的 解决办法

如果在iis网站下,建立了api子应用,打开swagger时,会出现not fund json的错误,需要修改默认配置 app.UseSwagger(c => { c.RouteTemplate = "swagger/{documentname}/swagger.json"; }); app.UseSwaggerUI(c => { c...

zlfbill的专栏 3672

微服务使用Gateway网关整合Swagger2文档

微服务使用Gateway网关整合Swagger2文档

Mrxianseng的博客 3584

SpringBoot微服务整合Swagger

单体项目的Swagger整合比较好整合,直接导入依赖即可,但是分布式或者微服务的项目整合就要稍微麻烦一点! 1.抽离出公共模块Common 提供给其他的模块使用,因为考虑到分布式和微服务有多个服务器,所以这里就同一抽离出来,让其他业务服务器都能使用到! 这个common创建一个Maven就行了 2.pom导入Swagger2的依赖 <!--swagger--> <dependency> <groupId>io.sp

程序员劝退师的博客 1003

swagger codegen 使用心得,以及开源插件改造,以及实时生成接口文档

因工作中重新构建系统,根据老板的委托组织一套框架功开发使用。 都是老代码了,所以在整个开发周期的痛点又很多,我这里集中解决了两个! 一个是前后台开发过程中的沟通,以及借口文档的在整个生命周期的统一,所以选择了swagger codegen 作为框架的基础配合改造过的swagger codegen 插件实现代码自动生成,配合改造后的借口文档生成插件实现借口文档动态生成。 使用心得: 1,引用工程基础包中的实体进入yaml文件中。插件改造之后的pom配置文件 通过对importMappin...

weixin_40669549的博客 1894

swagger-codegen-maven-plugin:一个Maven插件来支持swagger代码生成项目

swagger-codegen-maven-plugin [![Maven版本] [maven-img]] [maven-url] 一个Maven插件来支持代码生成项目 用法 添加到您的build->plugins部分(默认阶段是generate-sources阶段) < plugin> < groupId>com.garethevans.plugin</ groupId> < artifactId>swagger-codegen-maven-plugin</ artifactId> < version>${project.version}</ version> < executions> < execution> < goals> < goal>genera

微服务网关(Zuul)聚合Swagger以及Swagger注解的使用

微服务网关聚合Swagger 本文目录微服务网关聚合Swagger1、Zuul网关中的配置1、导入依赖2、application.yml添加配置3、配置扫描微服务swagger文档4、配置Swagger2、微服务中的配置1、导入依赖2、配置Swagger3、SpringSecurity环境放行Swagger4、Oauth2环境放行Swagger5、效果展示3、Swagger实战场景1、自定义注解实现接口跳过Swagger扫描2、Swagger注解的使用 1、Zuul网关中的配置 1、导入依赖 <!--

小爽帅到拖网速的博客 1298

HFSS实战:手把手教你设计3.3-10.6GHz超宽带微带天线(附S11优化技巧)

本文提供了一份基于Ansys HFSS的超宽带微带天线实战设计指南,详细讲解了从3.3GHz到10.6GHz天线的建模、仿真与优化全流程。文章重点剖析了阻抗匹配的核心挑战,并分享了通过接地板开槽、参数化扫描及目标驱动优化等系统性技巧来优化S11曲线的实用方法,帮助射频工程师快速掌握超宽带天线设计的关键技能。

2y3u4i5o6p的博客 1084

Dify实战:智能邮件工作流配置全解析

本文详细解析了如何利用Dify平台配置智能邮件工作流,实现邮件处理的自动化与智能化。内容涵盖从获取邮箱授权、安装插件、安全配置环境变量,到构建邮件发送工作流、创建调用该工作流的智能体(Agent)的完整步骤,并分享了连接知识库实现智能客服、定时发送日报等进阶自动化场景,旨在帮助用户显著提升邮件处理效率。

t8u9v0w1x的博客 797

微服务下统一管理配置swagger

最近武汉瘟疫挺严重的,学校被封了.....在家完全没什么状态,感觉整个人都废了...昨天开始动工,记录一下微服务如何配置swagger和遇到的问题。 1.在工程下创建一个模块,用来统一管理swagger的api 没有启动类,在其他服务的pom中要依赖api这个模块。 swagger的maven依赖 <dependency> <groupId...

TextInfo的博客 4104

深入解析SAP F4帮助函数F4IF_INT_TABLE_VALUE_REQUEST的回调机制

本文深入解析了SAP ABAP开发中F4IF_INT_TABLE_VALUE_REQUEST函数的回调机制。通过剖析其工作原理与核心参数,详细阐述了如何利用回调函数实现F4帮助的多值返回、动态数据过滤及选择后校验等高级定制功能,并提供了实用的代码示例与调试技巧,帮助开发者高效应对复杂的屏幕交互需求。

weixin_29213827的博客 204

swagger 微服务_笔记本微服务和Swagger

swagger 微服务In previous postswe learned how to create a microservice in a notebook using the Jupyter kernel gateway. This will be the foundation for today’s post where we will be creating a notebook m...

cumei1658的博客 485

MacBook 本地化部署 Dify 指南

dify 怎么安装部署 有哪些坑 !

weixin_44542598的博客 1536

微信小程序|基于小程序实现定位打卡功能

此文主要在小程序内实现打卡功能,可根据用户位置与公司设定的打卡范围实时判断打卡是否合法,并在后台对打卡记录进行管理。

商务合作 / 项目定制 / 学习交流。个人vx:lovely_wml 1万+

微服务如何集成swagger3

微服务中集成swagger3教程,详细展示

卓越之识论道,平常之识论事,狭隘之识论人 1316

如何用matlab扫频法测考虑频率耦合的并网逆变器的序阻抗,如何实现?

🏆本文收录于 《全栈Bug调优(实战版)》 专栏,该专栏专注于分享我在真实项目开发中遇到的各类疑难Bug及其深层成因,并系统提供高效、可复现的解决思路和实操方案。无论你是刚入行的新手开发者,还是拥有多年项目经验的资深工程师,本专栏都将为你提供一条系统化、高质量的问题排查与优化路径,助力你加速成长,攻克技术壁垒,迈向技术价值最大化与职业发展的更高峰🚀!

**My Coding Family** 1199

在微服务里集成swagger

一般在有controller层的模块集成swagger;废话不多说,直接看步骤。 1.导包 <!--引入swagger支持--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2<...

一步一脚印的博客 1540

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

swagger2 配置访问路径_微服务下统一管理配置swagger

最近武汉瘟疫挺严重的,学校被封了.....在家完全没什么状态,感觉整个人都废了...昨天开始动工,记录一下微服务如何配置swagger和遇到的问题。1.在工程下创建一个模块,用来统一管理swagger的api 没有启动类,在其他服务的pom中要依赖api这个模块。swagger的maven依赖io.springfoxspringfox-swagger22.8.0io.springfoxspring...

weixin_34354231的博客 2000

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

微服务项目swagger配置

如需转载分享,请标明出处,且不用于盈利为目的,谢谢合作! 微服务项目swagger配置 1.pom.xml依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> ...

এ某年某月某日এ的博客 603

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

微服务工程整合swagger

Swagger生成在线api文档 一、 介绍 前后端分离开发模式中,api文档是最好的沟通方式。 Swagger 是一个规范和完整的框架,用于生成、描述、调用和可视化 RESTful 风格的 Web 服务。 及时性 (接口变更后,能够及时准确地通知相关前后端开发人员) 规范性(并且保证接口的规范性,如接口的地址,请求方式,参数及响应格式和错误信息) 一致性(接口信息一致,不会出现因开发人员拿到的文档版本不一致,而出现分歧) 可测性 (直接在接口文档上进行测试,以方便理解业务) 二、配置Swagger2

weixin_42040369的博客 1158

微服务整合swagger

gateway整合swagger并不意味着,这个项目中的其他服务就不用整合swagger了,其他服务也要像system系统一样整合swagger,而gateway整合swagger是为了方便管理,在网关端口号的swagger中对其他服务进行统一的管理。方法上增加 :@ApiOperation(value = “方法名”,notes = “备注”,response = JSONResult.class)controller增加 : @Api(value = “接口名”,description = “描述”)

weixin_47720577的博客 341
上一篇: springfox-swagger原理解析与使用过程中遇到的坑
下一篇: springfox Swagger 2
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址