swagger配置使用说明

上传人:宝路 文档编号:20951489 上传时间:2017-11-22 格式:DOCX 页数:4 大小:20.71KB
返回 下载 相关 举报
swagger配置使用说明_第1页
第1页 / 共4页
swagger配置使用说明_第2页
第2页 / 共4页
swagger配置使用说明_第3页
第3页 / 共4页
swagger配置使用说明_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《swagger配置使用说明》由会员分享,可在线阅读,更多相关《swagger配置使用说明(4页珍藏版)》请在金锄头文库上搜索。

1、 swagger 配置使用说明1、系统使用 swagger-springmvc 0.6.6 版本,后续版本系统 spring 无法支持。2、相关 pom 配置com.mangofactoryswagger-springmvc0.6.6servlet-apijavax.servletspring-webmvcorg.springframeworkspring-weborg.springframeworkorg.springframeworkspring-core3.1.0.RELEASEorg.springframeworkspring-beans3.1.0.RELEASE3、系统配置文件a、

2、, 设置系统根路径和 API 版本app_swagger.propertiesb、wf-app-swagger.xml 设置需要查看的 URI /app/./appserver/./user/txt/demo/.为通配符,支持子路径模糊匹配4、类上加 API 注解对 contorller 类添加 API 注解类的头部添加API 注解类的方法上添加ApiOperation 注解Api(value = 用户, description = 有关于用户的CURD操作 ) ControllerRequestMapping(/user)public class TestController Respons

3、eBodyRequestMapping(value = /addUser, method = RequestMethod.GET, produces = application/json; charset=utf-8)ApiOperation(value = addUser, notes = This can only be done by the logged in user. ,responseClass=String.class)public String addUser(ApiParam(required = true, name = postData, value = 用户信息jso

4、n 数据 ) RequestParam(value = postData) String postData, HttpServletRequest request)throws JSONExceptionJSONObject json = new JSONObject();json.put(postData, postData);return json.toString();. . API 表示一个开放的 API,可以通过 description 简要描述该 API 的功能。 在一个API 下,可有多个ApiOperation,表示针对该 API 的 CRUD 操作。在 ApiOperation Annotation 中可以通过 value,notes 描述该操作的作用,response 描述正常情况下该请求的返回对象类型。 ApiParam 用于描述该 API 操作接受的参数类型

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号