首页>代码>Spring MVC+swagger作为restful api的doc在线文档生成>/apidoc/src/main/java/com/spg/apidoc/common/configer/MySwaggerConfig.java
package com.spg.apidoc.common.configer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.mangofactory.swagger.configuration.SpringSwaggerConfig; import com.mangofactory.swagger.models.dto.ApiInfo; import com.mangofactory.swagger.plugin.EnableSwagger; import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin; /** * 项目名称:apidoc * * @description: * @author Wind-spg * @create_time:2015年2月10日 上午10:27:51 * @version V1.0.0 * */ @Configuration @EnableSwagger // Loads the spring beans required by the framework public class MySwaggerConfig { private SpringSwaggerConfig springSwaggerConfig; /** * Required to autowire SpringSwaggerConfig */ @Autowired public void setSpringSwaggerConfig(SpringSwaggerConfig springSwaggerConfig) { this.springSwaggerConfig = springSwaggerConfig; } /** * Every SwaggerSpringMvcPlugin bean is picked up by the swagger-mvc * framework - allowing for multiple swagger groups i.e. same code base * multiple swagger resource listings. */ @Bean public SwaggerSpringMvcPlugin customImplementation() { return new SwaggerSpringMvcPlugin(this.springSwaggerConfig).apiInfo(apiInfo()).includePatterns( ".*?"); } private ApiInfo apiInfo() { ApiInfo apiInfo = new ApiInfo( "xxx系统API接口管理", "各个controller下对应相应业务接口", "My Apps API terms of service", "任何问题可联系xxx", null, null); return apiInfo; } }
最近下载更多
开心灬愉悦 LV9
2021年5月2日
heqian LV16
2020年12月10日
912299793 LV21
2020年8月29日
青春的尾巴 LV3
2020年8月2日
153393366@ LV9
2019年7月16日
Damionchow LV4
2019年6月4日
1247879478 LV8
2019年1月17日
hanjinyu LV11
2018年10月15日
yeling123 LV5
2018年7月9日
longyang1 LV10
2018年7月1日
最近浏览更多
akittyboy LV9
2月25日
RrrReNax LV3
2023年7月18日
lipanlong LV10
2023年7月6日
IT达人 LV22
2023年2月16日
503382513 LV10
2022年12月5日
1358849392 LV21
2022年11月11日
neuwxr2015 LV8
2022年9月20日
crosa_Don LV18
2022年6月14日
xueying049 LV5
2022年5月9日
whfuai LV14
2022年5月9日