├── LICENSE ├── README.md ├── pom.xml └── src └── main ├── java └── com │ └── mousycoder │ └── server │ ├── constants │ └── ErrorType.java │ ├── controller │ └── CommodityController.java │ ├── dto │ ├── BaseDTO.java │ ├── IBaseDTO.java │ ├── ResultDTO.java │ └── commodity │ │ ├── CommoditiesDTO.java │ │ └── CommodityDTO.java │ ├── param │ ├── BaseParam.java │ └── commodity │ │ └── AddCommodityParam.java │ ├── service │ └── CommodityService.java │ ├── status │ ├── CommodityStatus.java │ └── ResultStatus.java │ ├── swagger │ └── CustomJavaPluginConfig.java │ └── url │ ├── CommodityUrl.java │ └── RestUrl.java ├── resources ├── log4j.properties ├── spring-config.xml └── spring-mvc.xml └── webapp ├── WEB-INF └── web.xml ├── css ├── reset.css └── screen.css ├── images ├── explorer_icons.png ├── logo_small.png ├── pet_store_api.png ├── throbber.gif └── wordnik_api.png ├── index.html ├── lib ├── backbone-min.js ├── handlebars-1.0.0.js ├── highlight.7.3.pack.js ├── jquery-1.8.0.min.js ├── jquery.ba-bbq.min.js ├── jquery.slideto.min.js ├── jquery.wiggle.min.js ├── shred.bundle.js ├── shred │ └── content.js ├── swagger-client.js ├── swagger-oauth.js ├── swagger.js └── underscore-min.js ├── swagger-ui.js └── swagger-ui.min.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 mousycoder 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简介 2 | 3 | **`server-api`** 是一个GUI的WEB接口管理工具,基于 [swagger-ui](https://github.com/swagger-api/swagger-ui) 的后台API开源项目,采用SpringMvc+Maven3+Jdk1.7+Tomcat7,该项目的初衷是为了更好的去发展Swagger-ui与SpringMvc的结合,希望能够更加灵活,轻量化的根据后台不同的数据源展示出不同接口文档,满足日益增长的接口文档需求,这里包括(接口文档的格式,权限,视图,Mock数据,Api监控,自动化测试,接口文档分享,版本管理等),**`server-api`** 可以帮助后台开发人员解放双手,直接用注解生成文档,省去与前端、测试的沟通,以及项目上线后问题的监控和排查。 4 | 5 | # 特色 6 | 7 | - 完美融合Spring3.2.9+,采用注解编写文档 8 | - 最简项目架构,方便快速上手,排除其他干扰 9 | - 免费的技术支持 10 | 11 | # 部署 12 | ## 准备工作 13 | - Eclipse/MyEclipse/IDEA 14 | - JDK1.7+ 15 | - Tomcat7.*+ 16 | - Git 17 | - Maven3插件 18 | 19 | ## 构建项目 20 | ### 获取源代码 21 | 22 | #### 如果你只是使用 23 | 24 | ``` 25 | git clone git@github.com:mousycoder/server-api.git 26 | 27 | git checkout master 28 | ``` 29 | 30 | #### 如果你也想和我一起开发 31 | - 先Fork 32 | - PR一下我的最新代码(develop分支) 33 | - 贡献代码 34 | - PR你的代码到我的仓库 35 | 36 | 若是好的建议和方案,你将会在作者的仓库看到你贡献的代码,这将是多么让人兴奋的事情。 37 | 38 | 39 | ### 导入到IDE 40 | 以Eclipse为例,在File->Import->Existing Maven Projects,将server-api项目导入进来。 41 | 42 | 43 | ### 启动项目 44 | 45 | - `maven clean install` 46 | - 右键Run As-> Run on server (前提配置好tomcat) 47 | 48 | ### 日志 49 | - 改变日志级别 src/main/resources->log4j.properties->`log4j.rootLogger=DEBUG, Console`改成ERROR级别 默认是debug调试级别 50 | 51 | 52 | # 技术支持 53 | 54 | 55 | - Issues(推荐):[提交您的Issue](https://github.com/mousycoder/server-api/issues) 56 | - QQ技术支持群: Java 交流群 70812183 57 | - 注解API:[官方文档](http://docs.swagger.io/swagger-core/apidocs/index.html) 58 | - 个人博客:[@mousycoder](http://mousycoder.com) 59 | 60 | # 让我们一起为后台接口文档,做出一份努力吧,让我们后端程序猿更加专注技术研究吧!!! 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.mousycoder 5 | server-api 6 | 1.0 7 | war 8 | This is server api project! 9 | 10 | 11 | 1.7 12 | 3.2.9.RELEASE 13 | UTF-8 14 | UTF-8 15 | 16 | 17 | 18 | 19 | com.mangofactory 20 | swagger-springmvc 21 | 1.0.2 22 | 23 | 24 | com.fasterxml.jackson.core 25 | jackson-databind 26 | 2.4.2 27 | 28 | 29 | 30 | 31 | 32 | org.slf4j 33 | slf4j-log4j12 34 | 1.7.7 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.apache.maven.plugins 44 | maven-compiler-plugin 45 | 3.1 46 | 47 | 1.7 48 | 1.7 49 | UTF8 50 | 51 | 52 | 53 | maven-war-plugin 54 | 2.4 55 | 56 | src/main/webapp 57 | 58 | 59 | 60 | org.eclipse.jetty 61 | jetty-maven-plugin 62 | 9.3.0.M1 63 | 64 | 3 65 | 66 | /${project.artifactId} 67 | 68 | 69 | 70 | 71 | 8080 72 | 73 | 74 | 75 | 76 | 77 | ${project.artifactId} 78 | 79 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/constants/ErrorType.java: -------------------------------------------------------------------------------- 1 | 2 | package com.mousycoder.server.constants; 3 | /** 4 | * function: 错误类型 5 | * 6 | * @author mousycoder 7 | * @createDate 2015年3月25日 下午6:39:32 8 | */ 9 | public interface ErrorType { 10 | 11 | String error500 = "error500"; 12 | 13 | String errorCheckHashKey = "errorCheckHashKey"; 14 | 15 | String errorAccountExists = "errorAccountExists"; 16 | 17 | String errorCheckToken = "errorCheckToken"; 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/controller/CommodityController.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.MediaType; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | 11 | import com.mousycoder.server.constants.ErrorType; 12 | import com.mousycoder.server.dto.ResultDTO; 13 | import com.mousycoder.server.dto.commodity.CommoditiesDTO; 14 | import com.mousycoder.server.param.BaseParam; 15 | import com.mousycoder.server.service.CommodityService; 16 | import com.mousycoder.server.url.RestUrl; 17 | import com.wordnik.swagger.annotations.Api; 18 | import com.wordnik.swagger.annotations.ApiOperation; 19 | import com.wordnik.swagger.annotations.ApiParam; 20 | import com.wordnik.swagger.annotations.ApiResponse; 21 | import com.wordnik.swagger.annotations.ApiResponses; 22 | 23 | /** 24 | * function: 商品管理模块 25 | * 26 | * @author mousycoder 27 | * @createDate 2015年3月26日 上午9:21:36 28 | */ 29 | @Api(value = "commodity", description = "商品管理",produces=MediaType.APPLICATION_JSON_VALUE) 30 | @Controller 31 | public class CommodityController { 32 | 33 | @Autowired 34 | private CommodityService commodityService; 35 | 36 | 37 | @ApiOperation( value = "获得商品信息", notes = "获取商品信息(用于数据同步)",httpMethod = "POST",produces=MediaType.APPLICATION_JSON_VALUE) 38 | @ApiResponses(value={@ApiResponse(code=200,message="商品信息"), 39 | @ApiResponse(code=201,message=ErrorType.errorCheckToken + "(token验证失败)",response=String.class), 40 | @ApiResponse(code=202,message=ErrorType.error500+"(系统错误)",response=String.class)}) 41 | @RequestMapping(value = RestUrl.getCommodity, method = RequestMethod.POST) 42 | @ResponseBody 43 | public ResultDTO getCommodity(@ApiParam(value="Json参数",required=true)@RequestBody BaseParam param) throws Exception { 44 | return commodityService.getCommodity(param); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/dto/BaseDTO.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.dto; 2 | 3 | import com.wordnik.swagger.annotations.ApiModelProperty; 4 | 5 | 6 | 7 | /** 8 | * function: 父类DTO 9 | * 10 | * @author mousycoder 11 | * @createDate 2015年3月26日 下午1:44:32 12 | */ 13 | public class BaseDTO implements IBaseDTO { 14 | 15 | 16 | @ApiModelProperty(value="id") 17 | private long id; 18 | 19 | public long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(long id) { 24 | this.id = id; 25 | } 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/dto/IBaseDTO.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.dto; 2 | 3 | 4 | 5 | /** 6 | * function: 所有DTO的父接口(过滤掉为null的序列化) 7 | * 8 | * @author mousycoder 9 | * @createDate 2015年3月26日 下午1:44:51 10 | */ 11 | public interface IBaseDTO{ 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/dto/ResultDTO.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.dto; 2 | 3 | import com.wordnik.swagger.annotations.ApiModelProperty; 4 | 5 | 6 | /** 7 | * function: 結果DTO 8 | * 9 | * @author mousycoder 10 | * @createDate 2015年3月26日 下午1:44:51 11 | */ 12 | public class ResultDTO { 13 | 14 | @ApiModelProperty(value="状态 (0:失败 1:成功)",required=true) 15 | private int status; 16 | 17 | @ApiModelProperty(value="错误消息",required=true) 18 | private String message; 19 | 20 | @ApiModelProperty(value="返回数据",required=true) 21 | private T data; 22 | 23 | public int getStatus() { 24 | return status; 25 | } 26 | 27 | public void setStatus(int status) { 28 | this.status = status; 29 | } 30 | 31 | public String getMessage() { 32 | return message; 33 | } 34 | 35 | public void setMessage(String message) { 36 | this.message = message; 37 | } 38 | 39 | public T getData() { 40 | return data; 41 | } 42 | 43 | public void setData(T data) { 44 | this.data = data; 45 | } 46 | 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/dto/commodity/CommoditiesDTO.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.dto.commodity; 2 | 3 | import java.util.List; 4 | 5 | import com.wordnik.swagger.annotations.ApiModelProperty; 6 | 7 | 8 | /** 9 | * function: 商品信息DTO 10 | * 11 | * @author mousycoder 12 | * @createDate 2015年3月26日 下午1:44:14 13 | */ 14 | public class CommoditiesDTO { 15 | 16 | @ApiModelProperty(value="商品信息",required=true) 17 | private List commodityDTO; 18 | 19 | @ApiModelProperty(value="总数",required=true) 20 | private int count; 21 | 22 | public List getCommodityDTO() { 23 | return commodityDTO; 24 | } 25 | 26 | public int getCount() { 27 | return count; 28 | } 29 | 30 | public void setCount(int count) { 31 | this.count = count; 32 | } 33 | 34 | public void setCommodityDTO(List commodityDTO) { 35 | this.commodityDTO = commodityDTO; 36 | } 37 | 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/dto/commodity/CommodityDTO.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.dto.commodity; 2 | 3 | import com.wordnik.swagger.annotations.ApiModelProperty; 4 | 5 | 6 | /** 7 | * function: 商品信息DTO 8 | * 9 | * @author mousycoder 10 | * @createDate 2015年3月26日 下午1:44:14 11 | */ 12 | public class CommodityDTO { 13 | 14 | @ApiModelProperty(value = "商店Id", required = true) 15 | private long id; 16 | 17 | @ApiModelProperty(value = "分类Id", required = true) 18 | private long categoryId; 19 | 20 | @ApiModelProperty(value = "条形码", required = true) 21 | private String barcode; 22 | 23 | @ApiModelProperty(value = "商品名称", required = true) 24 | private String name; 25 | 26 | @ApiModelProperty(value = "商品价格", required = true) 27 | private double price; 28 | 29 | @ApiModelProperty(value = "商品库存", required = true) 30 | private int stock; 31 | 32 | @ApiModelProperty(value = "图片路径", required = true) 33 | private String picPath; 34 | 35 | @ApiModelProperty(value = "状态 (0:删除 1:上架 2:下架 ) ref CommodityStatus", required = true) 36 | private int status; 37 | 38 | @ApiModelProperty(value = "分类名称", required = true) 39 | private String categoryName; 40 | 41 | @ApiModelProperty(value = "父分类名称", required = true) 42 | private String parentCategoryName; 43 | 44 | public CommodityDTO() { 45 | } 46 | 47 | public long getId() { 48 | return id; 49 | } 50 | 51 | public void setId(long id) { 52 | this.id = id; 53 | } 54 | 55 | public String getBarcode() { 56 | return barcode; 57 | } 58 | 59 | public void setBarcode(String barcode) { 60 | this.barcode = barcode; 61 | } 62 | 63 | public String getName() { 64 | return name; 65 | } 66 | 67 | public void setName(String name) { 68 | this.name = name; 69 | } 70 | 71 | public double getPrice() { 72 | return price; 73 | } 74 | 75 | public void setPrice(double price) { 76 | this.price = price; 77 | } 78 | 79 | public int getStock() { 80 | return stock; 81 | } 82 | 83 | public void setStock(int stock) { 84 | this.stock = stock; 85 | } 86 | 87 | public String getPicPath() { 88 | return picPath; 89 | } 90 | 91 | public void setPicPath(String picPath) { 92 | this.picPath = picPath; 93 | } 94 | 95 | public int getStatus() { 96 | return status; 97 | } 98 | 99 | public void setStatus(int status) { 100 | this.status = status; 101 | } 102 | 103 | public long getCategoryId() { 104 | return categoryId; 105 | } 106 | 107 | public void setCategoryId(long categoryId) { 108 | this.categoryId = categoryId; 109 | } 110 | 111 | public String getCategoryName() { 112 | return categoryName; 113 | } 114 | 115 | public void setCategoryName(String categoryName) { 116 | this.categoryName = categoryName; 117 | } 118 | 119 | public String getParentCategoryName() { 120 | return parentCategoryName; 121 | } 122 | 123 | public void setParentCategoryName(String parentCategoryName) { 124 | this.parentCategoryName = parentCategoryName; 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/param/BaseParam.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.param; 2 | 3 | import com.mousycoder.server.dto.IBaseDTO; 4 | import com.wordnik.swagger.annotations.ApiModelProperty; 5 | 6 | /** 7 | * function: rest 服务基本参数 8 | * 9 | * @author mousycoder 10 | * @createDate 2015年3月31日 下午3:58:32 11 | */ 12 | public class BaseParam implements IBaseDTO { 13 | 14 | @ApiModelProperty(value="商店Id",required=true) 15 | private long shopId; 16 | 17 | public long getShopId() { 18 | return shopId; 19 | } 20 | 21 | public void setShopId(long shopId) { 22 | this.shopId = shopId; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/param/commodity/AddCommodityParam.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.param.commodity; 2 | 3 | import com.mousycoder.server.param.BaseParam; 4 | import com.wordnik.swagger.annotations.ApiModelProperty; 5 | 6 | 7 | /** 8 | * function: 增加商品参数 9 | * 10 | * @author mousycoder 11 | * @createDate 2015年3月31日 下午4:00:53 12 | */ 13 | public class AddCommodityParam extends BaseParam { 14 | 15 | @ApiModelProperty(value = "分类Id", required = true) 16 | private long categoryId; 17 | 18 | @ApiModelProperty(value = "条形码", required = true) 19 | private String barcode; 20 | 21 | @ApiModelProperty(value = "商品名称", required = true) 22 | private String name; 23 | 24 | @ApiModelProperty(value = "价格", required = true) 25 | private double price; 26 | 27 | @ApiModelProperty(value = "库存", required = true) 28 | private int stock; 29 | 30 | @ApiModelProperty(value = "商品图片id", required = true) 31 | private long picId; 32 | 33 | @ApiModelProperty(value = "商品图片地址", required = true) 34 | private String picPath; 35 | 36 | public String getBarcode() { 37 | return barcode; 38 | } 39 | 40 | public void setBarcode(String barcode) { 41 | this.barcode = barcode; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public int getStock() { 53 | return stock; 54 | } 55 | 56 | public void setStock(int stock) { 57 | this.stock = stock; 58 | } 59 | 60 | public double getPrice() { 61 | return price; 62 | } 63 | 64 | public void setPrice(double price) { 65 | this.price = price; 66 | } 67 | 68 | public String getPicPath() { 69 | return picPath; 70 | } 71 | 72 | public void setPicPath(String picPath) { 73 | this.picPath = picPath; 74 | } 75 | 76 | public long getPicId() { 77 | return picId; 78 | } 79 | 80 | public void setPicId(long picId) { 81 | this.picId = picId; 82 | } 83 | 84 | public long getCategoryId() { 85 | return categoryId; 86 | } 87 | 88 | public void setCategoryId(long categoryId) { 89 | this.categoryId = categoryId; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/service/CommodityService.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.mousycoder.server.dto.ResultDTO; 9 | import com.mousycoder.server.dto.commodity.CommoditiesDTO; 10 | import com.mousycoder.server.dto.commodity.CommodityDTO; 11 | import com.mousycoder.server.param.BaseParam; 12 | import com.mousycoder.server.status.CommodityStatus; 13 | import com.mousycoder.server.status.ResultStatus; 14 | 15 | /** 16 | * function: 商品管理模块逻辑层 17 | * 18 | * @author mousycoder 19 | * @createDate 2015年3月26日 下午1:52:06 20 | */ 21 | @Service 22 | public class CommodityService { 23 | 24 | public ResultDTO getCommodity(BaseParam param) { 25 | 26 | CommodityDTO comDto = new CommodityDTO(); 27 | comDto.setBarcode("12345678"); 28 | comDto.setCategoryId(1L); 29 | comDto.setCategoryName("奶制品"); 30 | comDto.setId(1L); 31 | comDto.setName("娃哈哈AD钙奶"); 32 | comDto.setParentCategoryName("饮品"); 33 | comDto.setPicPath("http://img-storage.qiniudn.com/15-7-2/78380693.jpg"); 34 | comDto.setPrice(2.00); 35 | comDto.setStatus(CommodityStatus.ON_SALE); 36 | comDto.setStock(20); 37 | 38 | List list = new ArrayList(); 39 | list.add(comDto); 40 | 41 | CommoditiesDTO data = new CommoditiesDTO(); 42 | data.setCommodityDTO(list); 43 | data.setCount(list.size()); 44 | 45 | ResultDTO dto = new ResultDTO(); 46 | dto.setStatus(ResultStatus.SUCCESS); 47 | dto.setData(data); 48 | return dto; 49 | } 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/status/CommodityStatus.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.status; 2 | 3 | import com.wordnik.swagger.annotations.ApiModelProperty; 4 | 5 | 6 | /** 7 | * function: 商品状态 8 | * 9 | * @author mousycoder 10 | * @createDate 2015年3月31日 下午7:01:48 11 | */ 12 | public interface CommodityStatus { 13 | 14 | @ApiModelProperty(value="删除",required=true) 15 | int DELETED = 0 ; 16 | 17 | @ApiModelProperty(value="上架",required=true) 18 | int ON_SALE = 1; 19 | 20 | @ApiModelProperty(value="下架",required=true) 21 | int OFF_SALE = 2; 22 | 23 | 24 | 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/status/ResultStatus.java: -------------------------------------------------------------------------------- 1 | 2 | package com.mousycoder.server.status; 3 | /** 4 | * function: 返回状态 5 | * 6 | * @author mousycoder 7 | * @createDate 2015年4月3日 下午2:45:14 8 | */ 9 | public interface ResultStatus { 10 | 11 | int FAIL = 0; 12 | 13 | int SUCCESS = 1; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/swagger/CustomJavaPluginConfig.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.swagger; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; 7 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 9 | 10 | import com.mangofactory.swagger.configuration.SpringSwaggerConfig; 11 | import com.mangofactory.swagger.models.dto.ApiInfo; 12 | import com.mangofactory.swagger.paths.SwaggerPathProvider; 13 | import com.mangofactory.swagger.plugin.EnableSwagger; 14 | import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin; 15 | 16 | @Configuration 17 | @EnableWebMvc 18 | @EnableSwagger 19 | public class CustomJavaPluginConfig extends WebMvcConfigurerAdapter { 20 | 21 | private SpringSwaggerConfig springSwaggerConfig; 22 | 23 | @Autowired 24 | public void setSpringSwaggerConfig(SpringSwaggerConfig springSwaggerConfig) { 25 | this.springSwaggerConfig = springSwaggerConfig; 26 | } 27 | 28 | /** 29 | * 链式编程 来定制API样式 后续会加上分组信息 30 | * 31 | * @return 32 | */ 33 | @Bean 34 | public SwaggerSpringMvcPlugin customImplementation() { 35 | return new SwaggerSpringMvcPlugin(this.springSwaggerConfig) 36 | .apiInfo(apiInfo()).includePatterns(".*") 37 | .useDefaultResponseMessages(false) 38 | // .pathProvider(new GtPaths()) 39 | .apiVersion("0.1").swaggerGroup("user"); 40 | 41 | } 42 | 43 | private ApiInfo apiInfo() { 44 | ApiInfo apiInfo = new ApiInfo("后台API接口平台", 45 | "提供详细的后台所有restful接口", "http://huhao520.com", 46 | "mousycoder@foxmail.com", "mousycoder博客", "http://huhao520.com"); 47 | return apiInfo; 48 | } 49 | 50 | @Override 51 | public void configureDefaultServletHandling( 52 | DefaultServletHandlerConfigurer configurer) { 53 | configurer.enable(); 54 | } 55 | 56 | class GtPaths extends SwaggerPathProvider { 57 | 58 | @Override 59 | protected String applicationPath() { 60 | return "/restapi"; 61 | } 62 | 63 | @Override 64 | protected String getDocumentationPath() { 65 | return "/restapi"; 66 | } 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/url/CommodityUrl.java: -------------------------------------------------------------------------------- 1 | package com.mousycoder.server.url; 2 | 3 | 4 | /** 5 | * function: 商品模块 6 | * 7 | * @author mousycoder 8 | * @createDate 2015年3月26日 下午1:46:22 9 | */ 10 | public interface CommodityUrl { 11 | 12 | /** 13 | * 获取私有商品信息 14 | */ 15 | String getCommodity = "/sc/commodity/getCommodity"; 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/mousycoder/server/url/RestUrl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.mousycoder.server.url; 3 | 4 | 5 | /** 6 | * function: 公共rest请求地址 7 | * 8 | * @author mousycoder 9 | * @createDate 2015年3月26日 上午9:29:03 10 | */ 11 | public interface RestUrl extends CommodityUrl{ 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.properties\uFF0C 2 | log4j.rootLogger=DEBUG, Console 3 | #Console 4 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 5 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 7 | log4j.logger.java.sql.ResultSet=INFO 8 | log4j.logger.org.apache=INFO 9 | log4j.logger.java.sql.Connection=DEBUG 10 | log4j.logger.java.sql.Statement=DEBUG 11 | log4j.logger.java.sql.PreparedStatement=DEBUG 12 | -------------------------------------------------------------------------------- /src/main/resources/spring-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | mousycoder 10 | 11 | 12 | 13 | contextConfigLocation 14 | 15 | classpath:spring-config.xml 16 | 17 | 18 | 19 | org.springframework.web.context.ContextLoaderListener 20 | 21 | 22 | 23 | 24 | mousycoder 25 | org.springframework.web.servlet.DispatcherServlet 26 | 27 | contextConfigLocation 28 | classpath:spring-mvc.xml 29 | 30 | 1 31 | true 32 | 33 | 34 | mousycoder 35 | / 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/webapp/css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ 2 | html, 3 | body, 4 | div, 5 | span, 6 | applet, 7 | object, 8 | iframe, 9 | h1, 10 | h2, 11 | h3, 12 | h4, 13 | h5, 14 | h6, 15 | p, 16 | blockquote, 17 | pre, 18 | a, 19 | abbr, 20 | acronym, 21 | address, 22 | big, 23 | cite, 24 | code, 25 | del, 26 | dfn, 27 | em, 28 | img, 29 | ins, 30 | kbd, 31 | q, 32 | s, 33 | samp, 34 | small, 35 | strike, 36 | strong, 37 | sub, 38 | sup, 39 | tt, 40 | var, 41 | b, 42 | u, 43 | i, 44 | center, 45 | dl, 46 | dt, 47 | dd, 48 | ol, 49 | ul, 50 | li, 51 | fieldset, 52 | form, 53 | label, 54 | legend, 55 | table, 56 | caption, 57 | tbody, 58 | tfoot, 59 | thead, 60 | tr, 61 | th, 62 | td, 63 | article, 64 | aside, 65 | canvas, 66 | details, 67 | embed, 68 | figure, 69 | figcaption, 70 | footer, 71 | header, 72 | hgroup, 73 | menu, 74 | nav, 75 | output, 76 | ruby, 77 | section, 78 | summary, 79 | time, 80 | mark, 81 | audio, 82 | video { 83 | margin: 0; 84 | padding: 0; 85 | border: 0; 86 | font-size: 100%; 87 | font: inherit; 88 | vertical-align: baseline; 89 | } 90 | /* HTML5 display-role reset for older browsers */ 91 | article, 92 | aside, 93 | details, 94 | figcaption, 95 | figure, 96 | footer, 97 | header, 98 | hgroup, 99 | menu, 100 | nav, 101 | section { 102 | display: block; 103 | } 104 | body { 105 | line-height: 1; 106 | } 107 | ol, 108 | ul { 109 | list-style: none; 110 | } 111 | blockquote, 112 | q { 113 | quotes: none; 114 | } 115 | blockquote:before, 116 | blockquote:after, 117 | q:before, 118 | q:after { 119 | content: ''; 120 | content: none; 121 | } 122 | table { 123 | border-collapse: collapse; 124 | border-spacing: 0; 125 | } 126 | -------------------------------------------------------------------------------- /src/main/webapp/css/screen.css: -------------------------------------------------------------------------------- 1 | /* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ 2 | .swagger-section pre code { 3 | display: block; 4 | padding: 0.5em; 5 | background: #F0F0F0; 6 | } 7 | .swagger-section pre code, 8 | .swagger-section pre .subst, 9 | .swagger-section pre .tag .title, 10 | .swagger-section pre .lisp .title, 11 | .swagger-section pre .clojure .built_in, 12 | .swagger-section pre .nginx .title { 13 | color: black; 14 | } 15 | .swagger-section pre .string, 16 | .swagger-section pre .title, 17 | .swagger-section pre .constant, 18 | .swagger-section pre .parent, 19 | .swagger-section pre .tag .value, 20 | .swagger-section pre .rules .value, 21 | .swagger-section pre .rules .value .number, 22 | .swagger-section pre .preprocessor, 23 | .swagger-section pre .ruby .symbol, 24 | .swagger-section pre .ruby .symbol .string, 25 | .swagger-section pre .aggregate, 26 | .swagger-section pre .template_tag, 27 | .swagger-section pre .django .variable, 28 | .swagger-section pre .smalltalk .class, 29 | .swagger-section pre .addition, 30 | .swagger-section pre .flow, 31 | .swagger-section pre .stream, 32 | .swagger-section pre .bash .variable, 33 | .swagger-section pre .apache .tag, 34 | .swagger-section pre .apache .cbracket, 35 | .swagger-section pre .tex .command, 36 | .swagger-section pre .tex .special, 37 | .swagger-section pre .erlang_repl .function_or_atom, 38 | .swagger-section pre .markdown .header { 39 | color: #800; 40 | } 41 | .swagger-section pre .comment, 42 | .swagger-section pre .annotation, 43 | .swagger-section pre .template_comment, 44 | .swagger-section pre .diff .header, 45 | .swagger-section pre .chunk, 46 | .swagger-section pre .markdown .blockquote { 47 | color: #888; 48 | } 49 | .swagger-section pre .number, 50 | .swagger-section pre .date, 51 | .swagger-section pre .regexp, 52 | .swagger-section pre .literal, 53 | .swagger-section pre .smalltalk .symbol, 54 | .swagger-section pre .smalltalk .char, 55 | .swagger-section pre .go .constant, 56 | .swagger-section pre .change, 57 | .swagger-section pre .markdown .bullet, 58 | .swagger-section pre .markdown .link_url { 59 | color: #080; 60 | } 61 | .swagger-section pre .label, 62 | .swagger-section pre .javadoc, 63 | .swagger-section pre .ruby .string, 64 | .swagger-section pre .decorator, 65 | .swagger-section pre .filter .argument, 66 | .swagger-section pre .localvars, 67 | .swagger-section pre .array, 68 | .swagger-section pre .attr_selector, 69 | .swagger-section pre .important, 70 | .swagger-section pre .pseudo, 71 | .swagger-section pre .pi, 72 | .swagger-section pre .doctype, 73 | .swagger-section pre .deletion, 74 | .swagger-section pre .envvar, 75 | .swagger-section pre .shebang, 76 | .swagger-section pre .apache .sqbracket, 77 | .swagger-section pre .nginx .built_in, 78 | .swagger-section pre .tex .formula, 79 | .swagger-section pre .erlang_repl .reserved, 80 | .swagger-section pre .prompt, 81 | .swagger-section pre .markdown .link_label, 82 | .swagger-section pre .vhdl .attribute, 83 | .swagger-section pre .clojure .attribute, 84 | .swagger-section pre .coffeescript .property { 85 | color: #8888ff; 86 | } 87 | .swagger-section pre .keyword, 88 | .swagger-section pre .id, 89 | .swagger-section pre .phpdoc, 90 | .swagger-section pre .title, 91 | .swagger-section pre .built_in, 92 | .swagger-section pre .aggregate, 93 | .swagger-section pre .css .tag, 94 | .swagger-section pre .javadoctag, 95 | .swagger-section pre .phpdoc, 96 | .swagger-section pre .yardoctag, 97 | .swagger-section pre .smalltalk .class, 98 | .swagger-section pre .winutils, 99 | .swagger-section pre .bash .variable, 100 | .swagger-section pre .apache .tag, 101 | .swagger-section pre .go .typename, 102 | .swagger-section pre .tex .command, 103 | .swagger-section pre .markdown .strong, 104 | .swagger-section pre .request, 105 | .swagger-section pre .status { 106 | font-weight: bold; 107 | } 108 | .swagger-section pre .markdown .emphasis { 109 | font-style: italic; 110 | } 111 | .swagger-section pre .nginx .built_in { 112 | font-weight: normal; 113 | } 114 | .swagger-section pre .coffeescript .javascript, 115 | .swagger-section pre .javascript .xml, 116 | .swagger-section pre .tex .formula, 117 | .swagger-section pre .xml .javascript, 118 | .swagger-section pre .xml .vbscript, 119 | .swagger-section pre .xml .css, 120 | .swagger-section pre .xml .cdata { 121 | opacity: 0.5; 122 | } 123 | .swagger-section .swagger-ui-wrap { 124 | line-height: 1; 125 | font-family: "Droid Sans", sans-serif; 126 | max-width: 960px; 127 | margin-left: auto; 128 | margin-right: auto; 129 | } 130 | .swagger-section .swagger-ui-wrap b, 131 | .swagger-section .swagger-ui-wrap strong { 132 | font-family: "Droid Sans", sans-serif; 133 | font-weight: bold; 134 | } 135 | .swagger-section .swagger-ui-wrap q, 136 | .swagger-section .swagger-ui-wrap blockquote { 137 | quotes: none; 138 | } 139 | .swagger-section .swagger-ui-wrap p { 140 | line-height: 1.4em; 141 | padding: 0 0 10px; 142 | color: #333333; 143 | } 144 | .swagger-section .swagger-ui-wrap q:before, 145 | .swagger-section .swagger-ui-wrap q:after, 146 | .swagger-section .swagger-ui-wrap blockquote:before, 147 | .swagger-section .swagger-ui-wrap blockquote:after { 148 | content: none; 149 | } 150 | .swagger-section .swagger-ui-wrap .heading_with_menu h1, 151 | .swagger-section .swagger-ui-wrap .heading_with_menu h2, 152 | .swagger-section .swagger-ui-wrap .heading_with_menu h3, 153 | .swagger-section .swagger-ui-wrap .heading_with_menu h4, 154 | .swagger-section .swagger-ui-wrap .heading_with_menu h5, 155 | .swagger-section .swagger-ui-wrap .heading_with_menu h6 { 156 | display: block; 157 | clear: none; 158 | float: left; 159 | -moz-box-sizing: border-box; 160 | -webkit-box-sizing: border-box; 161 | -ms-box-sizing: border-box; 162 | box-sizing: border-box; 163 | width: 60%; 164 | } 165 | .swagger-section .swagger-ui-wrap table { 166 | border-collapse: collapse; 167 | border-spacing: 0; 168 | } 169 | .swagger-section .swagger-ui-wrap table thead tr th { 170 | padding: 5px; 171 | font-size: 0.9em; 172 | color: #666666; 173 | border-bottom: 1px solid #999999; 174 | } 175 | .swagger-section .swagger-ui-wrap table tbody tr:last-child td { 176 | border-bottom: none; 177 | } 178 | .swagger-section .swagger-ui-wrap table tbody tr.offset { 179 | background-color: #f0f0f0; 180 | } 181 | .swagger-section .swagger-ui-wrap table tbody tr td { 182 | padding: 6px; 183 | font-size: 0.9em; 184 | border-bottom: 1px solid #cccccc; 185 | vertical-align: top; 186 | line-height: 1.3em; 187 | } 188 | .swagger-section .swagger-ui-wrap ol { 189 | margin: 0px 0 10px; 190 | padding: 0 0 0 18px; 191 | list-style-type: decimal; 192 | } 193 | .swagger-section .swagger-ui-wrap ol li { 194 | padding: 5px 0px; 195 | font-size: 0.9em; 196 | color: #333333; 197 | } 198 | .swagger-section .swagger-ui-wrap ol, 199 | .swagger-section .swagger-ui-wrap ul { 200 | list-style: none; 201 | } 202 | .swagger-section .swagger-ui-wrap h1 a, 203 | .swagger-section .swagger-ui-wrap h2 a, 204 | .swagger-section .swagger-ui-wrap h3 a, 205 | .swagger-section .swagger-ui-wrap h4 a, 206 | .swagger-section .swagger-ui-wrap h5 a, 207 | .swagger-section .swagger-ui-wrap h6 a { 208 | text-decoration: none; 209 | } 210 | .swagger-section .swagger-ui-wrap h1 a:hover, 211 | .swagger-section .swagger-ui-wrap h2 a:hover, 212 | .swagger-section .swagger-ui-wrap h3 a:hover, 213 | .swagger-section .swagger-ui-wrap h4 a:hover, 214 | .swagger-section .swagger-ui-wrap h5 a:hover, 215 | .swagger-section .swagger-ui-wrap h6 a:hover { 216 | text-decoration: underline; 217 | } 218 | .swagger-section .swagger-ui-wrap h1 span.divider, 219 | .swagger-section .swagger-ui-wrap h2 span.divider, 220 | .swagger-section .swagger-ui-wrap h3 span.divider, 221 | .swagger-section .swagger-ui-wrap h4 span.divider, 222 | .swagger-section .swagger-ui-wrap h5 span.divider, 223 | .swagger-section .swagger-ui-wrap h6 span.divider { 224 | color: #aaaaaa; 225 | } 226 | .swagger-section .swagger-ui-wrap a { 227 | color: #547f00; 228 | } 229 | .swagger-section .swagger-ui-wrap a img { 230 | border: none; 231 | } 232 | .swagger-section .swagger-ui-wrap article, 233 | .swagger-section .swagger-ui-wrap aside, 234 | .swagger-section .swagger-ui-wrap details, 235 | .swagger-section .swagger-ui-wrap figcaption, 236 | .swagger-section .swagger-ui-wrap figure, 237 | .swagger-section .swagger-ui-wrap footer, 238 | .swagger-section .swagger-ui-wrap header, 239 | .swagger-section .swagger-ui-wrap hgroup, 240 | .swagger-section .swagger-ui-wrap menu, 241 | .swagger-section .swagger-ui-wrap nav, 242 | .swagger-section .swagger-ui-wrap section, 243 | .swagger-section .swagger-ui-wrap summary { 244 | display: block; 245 | } 246 | .swagger-section .swagger-ui-wrap pre { 247 | font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; 248 | background-color: #fcf6db; 249 | border: 1px solid #e5e0c6; 250 | padding: 10px; 251 | } 252 | .swagger-section .swagger-ui-wrap pre code { 253 | line-height: 1.6em; 254 | background: none; 255 | } 256 | .swagger-section .swagger-ui-wrap .content > .content-type > div > label { 257 | clear: both; 258 | display: block; 259 | color: #0F6AB4; 260 | font-size: 1.1em; 261 | margin: 0; 262 | padding: 15px 0 5px; 263 | } 264 | .swagger-section .swagger-ui-wrap .content pre { 265 | font-size: 12px; 266 | margin-top: 5px; 267 | padding: 5px; 268 | } 269 | .swagger-section .swagger-ui-wrap .icon-btn { 270 | cursor: pointer; 271 | } 272 | .swagger-section .swagger-ui-wrap .info_title { 273 | padding-bottom: 10px; 274 | font-weight: bold; 275 | font-size: 25px; 276 | } 277 | .swagger-section .swagger-ui-wrap p.big, 278 | .swagger-section .swagger-ui-wrap div.big p { 279 | font-size: 1em; 280 | margin-bottom: 10px; 281 | } 282 | .swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, 283 | .swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, 284 | .swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, 285 | .swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { 286 | width: 500px !important; 287 | } 288 | .swagger-section .swagger-ui-wrap .info_license { 289 | padding-bottom: 5px; 290 | } 291 | .swagger-section .swagger-ui-wrap .info_tos { 292 | padding-bottom: 5px; 293 | } 294 | .swagger-section .swagger-ui-wrap .message-fail { 295 | color: #cc0000; 296 | } 297 | .swagger-section .swagger-ui-wrap .info_contact { 298 | padding-bottom: 5px; 299 | } 300 | .swagger-section .swagger-ui-wrap .info_description { 301 | padding-bottom: 10px; 302 | font-size: 15px; 303 | } 304 | .swagger-section .swagger-ui-wrap .markdown ol li, 305 | .swagger-section .swagger-ui-wrap .markdown ul li { 306 | padding: 3px 0px; 307 | line-height: 1.4em; 308 | color: #333333; 309 | } 310 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, 311 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, 312 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { 313 | display: block; 314 | padding: 4px; 315 | width: auto; 316 | clear: both; 317 | } 318 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, 319 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, 320 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { 321 | font-size: 1.3em; 322 | } 323 | .swagger-section .swagger-ui-wrap table.fullwidth { 324 | width: 100%; 325 | } 326 | .swagger-section .swagger-ui-wrap .model-signature { 327 | font-family: "Droid Sans", sans-serif; 328 | font-size: 1em; 329 | line-height: 1.5em; 330 | } 331 | .swagger-section .swagger-ui-wrap .model-signature .signature-nav a { 332 | text-decoration: none; 333 | color: #AAA; 334 | } 335 | .swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { 336 | text-decoration: underline; 337 | color: black; 338 | } 339 | .swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { 340 | color: black; 341 | text-decoration: none; 342 | } 343 | .swagger-section .swagger-ui-wrap .model-signature .propType { 344 | color: #5555aa; 345 | } 346 | .swagger-section .swagger-ui-wrap .model-signature pre:hover { 347 | background-color: #ffffdd; 348 | } 349 | .swagger-section .swagger-ui-wrap .model-signature pre { 350 | font-size: .85em; 351 | line-height: 1.2em; 352 | overflow: auto; 353 | max-height: 200px; 354 | cursor: pointer; 355 | } 356 | .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { 357 | display: block; 358 | margin: 0; 359 | padding: 0; 360 | } 361 | .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { 362 | padding-right: 0; 363 | border-right: none; 364 | } 365 | .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { 366 | float: left; 367 | margin: 0 5px 5px 0; 368 | padding: 2px 5px 2px 0; 369 | border-right: 1px solid #ddd; 370 | } 371 | .swagger-section .swagger-ui-wrap .model-signature .propOpt { 372 | color: #555; 373 | } 374 | .swagger-section .swagger-ui-wrap .model-signature .snippet small { 375 | font-size: 0.75em; 376 | } 377 | .swagger-section .swagger-ui-wrap .model-signature .propOptKey { 378 | font-style: italic; 379 | } 380 | .swagger-section .swagger-ui-wrap .model-signature .description .strong { 381 | font-weight: bold; 382 | color: #000; 383 | font-size: .9em; 384 | } 385 | .swagger-section .swagger-ui-wrap .model-signature .description div { 386 | font-size: 0.9em; 387 | line-height: 1.5em; 388 | margin-left: 1em; 389 | } 390 | .swagger-section .swagger-ui-wrap .model-signature .description .stronger { 391 | font-weight: bold; 392 | color: #000; 393 | } 394 | .swagger-section .swagger-ui-wrap .model-signature .propName { 395 | font-weight: bold; 396 | } 397 | .swagger-section .swagger-ui-wrap .model-signature .signature-container { 398 | clear: both; 399 | } 400 | .swagger-section .swagger-ui-wrap .body-textarea { 401 | width: 300px; 402 | height: 100px; 403 | border: 1px solid #aaa; 404 | } 405 | .swagger-section .swagger-ui-wrap .markdown p code, 406 | .swagger-section .swagger-ui-wrap .markdown li code { 407 | font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; 408 | background-color: #f0f0f0; 409 | color: black; 410 | padding: 1px 3px; 411 | } 412 | .swagger-section .swagger-ui-wrap .required { 413 | font-weight: bold; 414 | } 415 | .swagger-section .swagger-ui-wrap input.parameter { 416 | width: 300px; 417 | border: 1px solid #aaa; 418 | } 419 | .swagger-section .swagger-ui-wrap h1 { 420 | color: black; 421 | font-size: 1.5em; 422 | line-height: 1.3em; 423 | padding: 10px 0 10px 0; 424 | font-family: "Droid Sans", sans-serif; 425 | font-weight: bold; 426 | } 427 | .swagger-section .swagger-ui-wrap .heading_with_menu { 428 | float: none; 429 | clear: both; 430 | overflow: hidden; 431 | display: block; 432 | } 433 | .swagger-section .swagger-ui-wrap .heading_with_menu ul { 434 | display: block; 435 | clear: none; 436 | float: right; 437 | -moz-box-sizing: border-box; 438 | -webkit-box-sizing: border-box; 439 | -ms-box-sizing: border-box; 440 | box-sizing: border-box; 441 | margin-top: 10px; 442 | } 443 | .swagger-section .swagger-ui-wrap h2 { 444 | color: black; 445 | font-size: 1.3em; 446 | padding: 10px 0 10px 0; 447 | } 448 | .swagger-section .swagger-ui-wrap h2 a { 449 | color: black; 450 | } 451 | .swagger-section .swagger-ui-wrap h2 span.sub { 452 | font-size: 0.7em; 453 | color: #999999; 454 | font-style: italic; 455 | } 456 | .swagger-section .swagger-ui-wrap h2 span.sub a { 457 | color: #777777; 458 | } 459 | .swagger-section .swagger-ui-wrap span.weak { 460 | color: #666666; 461 | } 462 | .swagger-section .swagger-ui-wrap .message-success { 463 | color: #89BF04; 464 | } 465 | .swagger-section .swagger-ui-wrap caption, 466 | .swagger-section .swagger-ui-wrap th, 467 | .swagger-section .swagger-ui-wrap td { 468 | text-align: left; 469 | font-weight: normal; 470 | vertical-align: middle; 471 | } 472 | .swagger-section .swagger-ui-wrap .code { 473 | font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; 474 | } 475 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { 476 | font-family: "Droid Sans", sans-serif; 477 | height: 250px; 478 | padding: 4px; 479 | display: block; 480 | clear: both; 481 | } 482 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { 483 | display: block; 484 | clear: both; 485 | } 486 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { 487 | float: none; 488 | clear: both; 489 | overflow: hidden; 490 | display: block; 491 | } 492 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { 493 | display: block; 494 | float: left; 495 | clear: none; 496 | margin: 0; 497 | padding: 0; 498 | } 499 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { 500 | display: block; 501 | float: left; 502 | clear: none; 503 | margin: 0 5px 0 0; 504 | } 505 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { 506 | color: black; 507 | } 508 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { 509 | display: block; 510 | clear: both; 511 | width: auto; 512 | padding: 0 0 3px; 513 | color: #666666; 514 | } 515 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { 516 | padding-left: 3px; 517 | color: #888888; 518 | } 519 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { 520 | margin-left: 0; 521 | font-style: italic; 522 | font-size: 0.9em; 523 | margin: 0; 524 | } 525 | .swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { 526 | margin: 0; 527 | padding: 0; 528 | } 529 | .swagger-section .swagger-ui-wrap span.blank, 530 | .swagger-section .swagger-ui-wrap span.empty { 531 | color: #888888; 532 | font-style: italic; 533 | } 534 | .swagger-section .swagger-ui-wrap .markdown h3 { 535 | color: #547f00; 536 | } 537 | .swagger-section .swagger-ui-wrap .markdown h4 { 538 | color: #666666; 539 | } 540 | .swagger-section .swagger-ui-wrap .markdown pre { 541 | font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; 542 | background-color: #fcf6db; 543 | border: 1px solid #e5e0c6; 544 | padding: 10px; 545 | margin: 0 0 10px 0; 546 | } 547 | .swagger-section .swagger-ui-wrap .markdown pre code { 548 | line-height: 1.6em; 549 | } 550 | .swagger-section .swagger-ui-wrap div.gist { 551 | margin: 20px 0 25px 0 !important; 552 | } 553 | .swagger-section .swagger-ui-wrap ul#resources { 554 | font-family: "Droid Sans", sans-serif; 555 | font-size: 0.9em; 556 | } 557 | .swagger-section .swagger-ui-wrap ul#resources li.resource { 558 | border-bottom: 1px solid #dddddd; 559 | } 560 | .swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, 561 | .swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { 562 | color: black; 563 | } 564 | .swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, 565 | .swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { 566 | color: #555555; 567 | } 568 | .swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { 569 | border-bottom: none; 570 | } 571 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { 572 | border: 1px solid transparent; 573 | float: none; 574 | clear: both; 575 | overflow: hidden; 576 | display: block; 577 | } 578 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { 579 | overflow: hidden; 580 | padding: 0; 581 | display: block; 582 | clear: none; 583 | float: right; 584 | margin: 14px 10px 0 0; 585 | } 586 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { 587 | float: left; 588 | clear: none; 589 | margin: 0; 590 | padding: 2px 10px; 591 | border-right: 1px solid #dddddd; 592 | color: #666666; 593 | font-size: 0.9em; 594 | } 595 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { 596 | color: #aaaaaa; 597 | text-decoration: none; 598 | } 599 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { 600 | text-decoration: underline; 601 | color: black; 602 | } 603 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, 604 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, 605 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { 606 | text-decoration: underline; 607 | } 608 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, 609 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { 610 | padding-left: 0; 611 | } 612 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, 613 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { 614 | padding-right: 0; 615 | border-right: none; 616 | } 617 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, 618 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { 619 | padding-left: 0; 620 | } 621 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { 622 | color: #999999; 623 | padding-left: 0; 624 | display: block; 625 | clear: none; 626 | float: left; 627 | font-family: "Droid Sans", sans-serif; 628 | font-weight: bold; 629 | } 630 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { 631 | color: #999999; 632 | } 633 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { 634 | color: black; 635 | } 636 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { 637 | float: none; 638 | clear: both; 639 | overflow: hidden; 640 | display: block; 641 | margin: 0 0 10px; 642 | padding: 0; 643 | } 644 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { 645 | float: none; 646 | clear: both; 647 | overflow: hidden; 648 | display: block; 649 | margin: 0; 650 | padding: 0; 651 | } 652 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { 653 | display: block; 654 | clear: none; 655 | float: left; 656 | width: auto; 657 | margin: 0; 658 | padding: 0; 659 | line-height: 1.1em; 660 | color: black; 661 | } 662 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { 663 | padding-left: 10px; 664 | } 665 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { 666 | color: black; 667 | text-decoration: none; 668 | } 669 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { 670 | text-decoration: underline; 671 | } 672 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { 673 | text-transform: uppercase; 674 | text-decoration: none; 675 | color: white; 676 | display: inline-block; 677 | width: 50px; 678 | font-size: 0.7em; 679 | text-align: center; 680 | padding: 7px 0 4px; 681 | -moz-border-radius: 2px; 682 | -webkit-border-radius: 2px; 683 | -o-border-radius: 2px; 684 | -ms-border-radius: 2px; 685 | -khtml-border-radius: 2px; 686 | border-radius: 2px; 687 | } 688 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { 689 | margin: 0; 690 | padding: 0; 691 | } 692 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { 693 | overflow: hidden; 694 | padding: 0; 695 | display: block; 696 | clear: none; 697 | float: right; 698 | margin: 6px 10px 0 0; 699 | } 700 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { 701 | float: left; 702 | clear: none; 703 | margin: 0; 704 | padding: 2px 10px; 705 | font-size: 0.9em; 706 | } 707 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { 708 | text-decoration: none; 709 | } 710 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { 711 | color: black; 712 | } 713 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { 714 | border-top: none; 715 | padding: 10px; 716 | -moz-border-radius-bottomleft: 6px; 717 | -webkit-border-bottom-left-radius: 6px; 718 | -o-border-bottom-left-radius: 6px; 719 | -ms-border-bottom-left-radius: 6px; 720 | -khtml-border-bottom-left-radius: 6px; 721 | border-bottom-left-radius: 6px; 722 | -moz-border-radius-bottomright: 6px; 723 | -webkit-border-bottom-right-radius: 6px; 724 | -o-border-bottom-right-radius: 6px; 725 | -ms-border-bottom-right-radius: 6px; 726 | -khtml-border-bottom-right-radius: 6px; 727 | border-bottom-right-radius: 6px; 728 | margin: 0 0 20px; 729 | } 730 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { 731 | font-size: 1.1em; 732 | margin: 0; 733 | padding: 15px 0 5px; 734 | } 735 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { 736 | float: none; 737 | clear: both; 738 | overflow: hidden; 739 | display: block; 740 | } 741 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { 742 | padding: 4px 0 0 10px; 743 | display: inline-block; 744 | font-size: 0.9em; 745 | } 746 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { 747 | display: block; 748 | clear: none; 749 | float: left; 750 | padding: 6px 8px; 751 | } 752 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { 753 | background-image: url('../images/throbber.gif'); 754 | width: 128px; 755 | height: 16px; 756 | display: block; 757 | clear: none; 758 | float: right; 759 | } 760 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { 761 | outline: 2px solid black; 762 | outline-color: #cc0000; 763 | } 764 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { 765 | font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; 766 | padding: 10px; 767 | font-size: 0.9em; 768 | max-height: 400px; 769 | overflow-y: auto; 770 | } 771 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { 772 | background-color: #f9f2e9; 773 | border: 1px solid #f0e0ca; 774 | } 775 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { 776 | background-color: #c5862b; 777 | } 778 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { 779 | border-right: 1px solid #dddddd; 780 | border-right-color: #f0e0ca; 781 | color: #c5862b; 782 | } 783 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { 784 | color: #c5862b; 785 | } 786 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { 787 | background-color: #faf5ee; 788 | border: 1px solid #f0e0ca; 789 | } 790 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { 791 | color: #c5862b; 792 | } 793 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { 794 | color: #dcb67f; 795 | } 796 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { 797 | background-color: #fcffcd; 798 | border: 1px solid black; 799 | border-color: #ffd20f; 800 | } 801 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { 802 | text-transform: uppercase; 803 | background-color: #ffd20f; 804 | } 805 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { 806 | border-right: 1px solid #dddddd; 807 | border-right-color: #ffd20f; 808 | color: #ffd20f; 809 | } 810 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { 811 | color: #ffd20f; 812 | } 813 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { 814 | background-color: #fcffcd; 815 | border: 1px solid black; 816 | border-color: #ffd20f; 817 | } 818 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { 819 | color: #ffd20f; 820 | } 821 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { 822 | color: #6fc992; 823 | } 824 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { 825 | background-color: #f5e8e8; 826 | border: 1px solid #e8c6c7; 827 | } 828 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { 829 | text-transform: uppercase; 830 | background-color: #a41e22; 831 | } 832 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { 833 | border-right: 1px solid #dddddd; 834 | border-right-color: #e8c6c7; 835 | color: #a41e22; 836 | } 837 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { 838 | color: #a41e22; 839 | } 840 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { 841 | background-color: #f7eded; 842 | border: 1px solid #e8c6c7; 843 | } 844 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { 845 | color: #a41e22; 846 | } 847 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { 848 | color: #c8787a; 849 | } 850 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { 851 | background-color: #e7f6ec; 852 | border: 1px solid #c3e8d1; 853 | } 854 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { 855 | background-color: #10a54a; 856 | } 857 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { 858 | border-right: 1px solid #dddddd; 859 | border-right-color: #c3e8d1; 860 | color: #10a54a; 861 | } 862 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { 863 | color: #10a54a; 864 | } 865 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { 866 | background-color: #ebf7f0; 867 | border: 1px solid #c3e8d1; 868 | } 869 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { 870 | color: #10a54a; 871 | } 872 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { 873 | color: #6fc992; 874 | } 875 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { 876 | background-color: #FCE9E3; 877 | border: 1px solid #F5D5C3; 878 | } 879 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { 880 | background-color: #D38042; 881 | } 882 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { 883 | border-right: 1px solid #dddddd; 884 | border-right-color: #f0cecb; 885 | color: #D38042; 886 | } 887 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { 888 | color: #D38042; 889 | } 890 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { 891 | background-color: #faf0ef; 892 | border: 1px solid #f0cecb; 893 | } 894 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { 895 | color: #D38042; 896 | } 897 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { 898 | color: #dcb67f; 899 | } 900 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { 901 | background-color: #e7f0f7; 902 | border: 1px solid #c3d9ec; 903 | } 904 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { 905 | background-color: #0f6ab4; 906 | } 907 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { 908 | border-right: 1px solid #dddddd; 909 | border-right-color: #c3d9ec; 910 | color: #0f6ab4; 911 | } 912 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { 913 | color: #0f6ab4; 914 | } 915 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { 916 | background-color: #ebf3f9; 917 | border: 1px solid #c3d9ec; 918 | } 919 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { 920 | color: #0f6ab4; 921 | } 922 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { 923 | color: #6fa5d2; 924 | } 925 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { 926 | background-color: #e7f0f7; 927 | border: 1px solid #c3d9ec; 928 | } 929 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { 930 | background-color: #0f6ab4; 931 | } 932 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { 933 | border-right: 1px solid #dddddd; 934 | border-right-color: #c3d9ec; 935 | color: #0f6ab4; 936 | } 937 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { 938 | color: #0f6ab4; 939 | } 940 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { 941 | background-color: #ebf3f9; 942 | border: 1px solid #c3d9ec; 943 | } 944 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { 945 | color: #0f6ab4; 946 | } 947 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { 948 | color: #6fa5d2; 949 | } 950 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, 951 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, 952 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, 953 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, 954 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, 955 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { 956 | border-top: none; 957 | } 958 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, 959 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, 960 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, 961 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, 962 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, 963 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, 964 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, 965 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, 966 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, 967 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, 968 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, 969 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { 970 | padding-right: 0; 971 | border-right: none; 972 | } 973 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, 974 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, 975 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { 976 | text-decoration: underline; 977 | } 978 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, 979 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { 980 | padding-left: 0; 981 | } 982 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, 983 | .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { 984 | padding-left: 0; 985 | } 986 | .swagger-section .swagger-ui-wrap p#colophon { 987 | margin: 0 15px 40px 15px; 988 | padding: 10px 0; 989 | font-size: 0.8em; 990 | border-top: 1px solid #dddddd; 991 | font-family: "Droid Sans", sans-serif; 992 | color: #999999; 993 | font-style: italic; 994 | } 995 | .swagger-section .swagger-ui-wrap p#colophon a { 996 | text-decoration: none; 997 | color: #547f00; 998 | } 999 | .swagger-section .swagger-ui-wrap h3 { 1000 | color: black; 1001 | font-size: 1.1em; 1002 | padding: 10px 0 10px 0; 1003 | } 1004 | .swagger-section .swagger-ui-wrap .markdown ol, 1005 | .swagger-section .swagger-ui-wrap .markdown ul { 1006 | font-family: "Droid Sans", sans-serif; 1007 | margin: 5px 0 10px; 1008 | padding: 0 0 0 18px; 1009 | list-style-type: disc; 1010 | } 1011 | .swagger-section .swagger-ui-wrap form.form_box { 1012 | background-color: #ebf3f9; 1013 | border: 1px solid #c3d9ec; 1014 | padding: 10px; 1015 | } 1016 | .swagger-section .swagger-ui-wrap form.form_box label { 1017 | color: #0f6ab4 !important; 1018 | } 1019 | .swagger-section .swagger-ui-wrap form.form_box input[type=submit] { 1020 | display: block; 1021 | padding: 10px; 1022 | } 1023 | .swagger-section .swagger-ui-wrap form.form_box p.weak { 1024 | font-size: 0.8em; 1025 | } 1026 | .swagger-section .swagger-ui-wrap form.form_box p { 1027 | font-size: 0.9em; 1028 | padding: 0 0 15px; 1029 | color: #7e7b6d; 1030 | } 1031 | .swagger-section .swagger-ui-wrap form.form_box p a { 1032 | color: #646257; 1033 | } 1034 | .swagger-section .swagger-ui-wrap form.form_box p strong { 1035 | color: black; 1036 | } 1037 | .swagger-section .title { 1038 | font-style: bold; 1039 | } 1040 | .swagger-section .secondary_form { 1041 | display: none; 1042 | } 1043 | .swagger-section .main_image { 1044 | display: block; 1045 | margin-left: auto; 1046 | margin-right: auto; 1047 | } 1048 | .swagger-section .oauth_body { 1049 | margin-left: 100px; 1050 | margin-right: 100px; 1051 | } 1052 | .swagger-section .oauth_submit { 1053 | text-align: center; 1054 | } 1055 | .swagger-section .api-popup-dialog { 1056 | z-index: 10000; 1057 | position: absolute; 1058 | width: 500px; 1059 | background: #FFF; 1060 | padding: 20px; 1061 | border: 1px solid #ccc; 1062 | border-radius: 5px; 1063 | display: none; 1064 | font-size: 13px; 1065 | color: #777; 1066 | } 1067 | .swagger-section .api-popup-dialog .api-popup-title { 1068 | font-size: 24px; 1069 | padding: 10px 0; 1070 | } 1071 | .swagger-section .api-popup-dialog .api-popup-title { 1072 | font-size: 24px; 1073 | padding: 10px 0; 1074 | } 1075 | .swagger-section .api-popup-dialog p.error-msg { 1076 | padding-left: 5px; 1077 | padding-bottom: 5px; 1078 | } 1079 | .swagger-section .api-popup-dialog button.api-popup-authbtn { 1080 | height: 30px; 1081 | } 1082 | .swagger-section .api-popup-dialog button.api-popup-cancel { 1083 | height: 30px; 1084 | } 1085 | .swagger-section .api-popup-scopes { 1086 | padding: 10px 20px; 1087 | } 1088 | .swagger-section .api-popup-scopes li { 1089 | padding: 5px 0; 1090 | line-height: 20px; 1091 | } 1092 | .swagger-section .api-popup-scopes .api-scope-desc { 1093 | padding-left: 20px; 1094 | font-style: italic; 1095 | } 1096 | .swagger-section .api-popup-scopes li input { 1097 | position: relative; 1098 | top: 2px; 1099 | } 1100 | .swagger-section .api-popup-actions { 1101 | padding-top: 10px; 1102 | } 1103 | .swagger-section .access { 1104 | float: right; 1105 | } 1106 | .swagger-section .auth { 1107 | float: right; 1108 | } 1109 | .swagger-section #api_information_panel { 1110 | position: absolute; 1111 | background: #FFF; 1112 | border: 1px solid #ccc; 1113 | border-radius: 5px; 1114 | display: none; 1115 | font-size: 13px; 1116 | max-width: 300px; 1117 | line-height: 30px; 1118 | color: black; 1119 | padding: 5px; 1120 | } 1121 | .swagger-section #api_information_panel p .api-msg-enabled { 1122 | color: green; 1123 | } 1124 | .swagger-section #api_information_panel p .api-msg-disabled { 1125 | color: red; 1126 | } 1127 | .swagger-section .api-ic { 1128 | height: 18px; 1129 | vertical-align: middle; 1130 | display: inline-block; 1131 | background: url(../images/explorer_icons.png) no-repeat; 1132 | } 1133 | .swagger-section .ic-info { 1134 | background-position: 0 0; 1135 | width: 18px; 1136 | margin-top: -7px; 1137 | margin-left: 4px; 1138 | } 1139 | .swagger-section .ic-warning { 1140 | background-position: -60px 0; 1141 | width: 18px; 1142 | margin-top: -7px; 1143 | margin-left: 4px; 1144 | } 1145 | .swagger-section .ic-error { 1146 | background-position: -30px 0; 1147 | width: 18px; 1148 | margin-top: -7px; 1149 | margin-left: 4px; 1150 | } 1151 | .swagger-section .ic-off { 1152 | background-position: -90px 0; 1153 | width: 58px; 1154 | margin-top: -4px; 1155 | cursor: pointer; 1156 | } 1157 | .swagger-section .ic-on { 1158 | background-position: -160px 0; 1159 | width: 58px; 1160 | margin-top: -4px; 1161 | cursor: pointer; 1162 | } 1163 | .swagger-section #header { 1164 | background-color: #89bf04; 1165 | padding: 14px; 1166 | } 1167 | .swagger-section #header a#logo { 1168 | font-size: 1.5em; 1169 | font-weight: bold; 1170 | text-decoration: none; 1171 | background: transparent url(../images/logo_small.png) no-repeat left center; 1172 | padding: 20px 0 20px 40px; 1173 | color: white; 1174 | } 1175 | .swagger-section #header form#api_selector { 1176 | display: block; 1177 | clear: none; 1178 | float: right; 1179 | } 1180 | .swagger-section #header form#api_selector .input { 1181 | display: block; 1182 | clear: none; 1183 | float: left; 1184 | margin: 0 10px 0 0; 1185 | } 1186 | .swagger-section #header form#api_selector .input input#input_apiKey { 1187 | width: 200px; 1188 | } 1189 | .swagger-section #header form#api_selector .input input#input_baseUrl { 1190 | width: 400px; 1191 | } 1192 | .swagger-section #header form#api_selector .input a#explore { 1193 | display: block; 1194 | text-decoration: none; 1195 | font-weight: bold; 1196 | padding: 6px 8px; 1197 | font-size: 0.9em; 1198 | color: white; 1199 | background-color: #547f00; 1200 | -moz-border-radius: 4px; 1201 | -webkit-border-radius: 4px; 1202 | -o-border-radius: 4px; 1203 | -ms-border-radius: 4px; 1204 | -khtml-border-radius: 4px; 1205 | border-radius: 4px; 1206 | } 1207 | .swagger-section #header form#api_selector .input a#explore:hover { 1208 | background-color: #547f00; 1209 | } 1210 | .swagger-section #header form#api_selector .input input { 1211 | font-size: 0.9em; 1212 | padding: 3px; 1213 | margin: 0; 1214 | } 1215 | .swagger-section #content_message { 1216 | margin: 10px 15px; 1217 | font-style: italic; 1218 | color: #999999; 1219 | } 1220 | .swagger-section #message-bar { 1221 | min-height: 30px; 1222 | text-align: center; 1223 | padding-top: 10px; 1224 | } 1225 | -------------------------------------------------------------------------------- /src/main/webapp/images/explorer_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mousycoder/server-api/2950d2a17119b02da004a3bfb19c76707b2d7938/src/main/webapp/images/explorer_icons.png -------------------------------------------------------------------------------- /src/main/webapp/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mousycoder/server-api/2950d2a17119b02da004a3bfb19c76707b2d7938/src/main/webapp/images/logo_small.png -------------------------------------------------------------------------------- /src/main/webapp/images/pet_store_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mousycoder/server-api/2950d2a17119b02da004a3bfb19c76707b2d7938/src/main/webapp/images/pet_store_api.png -------------------------------------------------------------------------------- /src/main/webapp/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mousycoder/server-api/2950d2a17119b02da004a3bfb19c76707b2d7938/src/main/webapp/images/throbber.gif -------------------------------------------------------------------------------- /src/main/webapp/images/wordnik_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mousycoder/server-api/2950d2a17119b02da004a3bfb19c76707b2d7938/src/main/webapp/images/wordnik_api.png -------------------------------------------------------------------------------- /src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 云后台API接口平台 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 83 | 84 | 85 | 86 | 96 | 97 |
 
98 |
99 | 100 | 101 | -------------------------------------------------------------------------------- /src/main/webapp/lib/backbone-min.js: -------------------------------------------------------------------------------- 1 | // Backbone.js 0.9.2 2 | 3 | // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. 4 | // Backbone may be freely distributed under the MIT license. 5 | // For all details and documentation: 6 | // http://backbonejs.org 7 | (function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks= 8 | {});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g= 9 | z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent= 10 | {};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null== 11 | b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent: 12 | b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)}; 13 | a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error, 14 | h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t(); 15 | return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending= 16 | {};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length|| 17 | !this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator); 18 | this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c=b))this.iframe=i('