package com.test.wjb.www.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author Wang Junbo
* @description
* @date 2020/1/15
*/
@Configuration
@EnableSwagger2
@EnableWebMvc
@ComponentScan("com.test.wjb.www.controller")
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.build()
.apiInfo(apiInfo());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("对外开放接口API文档")
.description("HTTP对外开放接口")
.version("1.0.0")
.termsOfServiceUrl("http://xxx.xxx.com")
.license("LICENSE")
.licenseUrl("http://xxx.xxx.com")
.build();
}
}
https://github.com/lgh123ghl/myFristSSM/blob/master/myssm/src/main/java/com/lgh/swagger/SwaggerConfig.java
SSM+Swagger
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
相关阅读更多精彩内容
- 衔接上篇:JavaWeb项目整合Spring,SpringMVC,Mybatis框架 One Step! 导入Sw...
- 继续上集SSM项目-抢红包案例 一、引入Swagger 1、引入pom依赖 2、添加 Swagger Config...
- 一些技巧 IDEA 添加 mybatis mapper的xml文件的自动提示功能[https://www.jian...
- 1.导入依赖(maven) 3.在config 包下 创建SwaggerConfig类 4.在spring mvc...
- 环境配置 基本框架搭建 可参考本人博客地址 添加TOKEN验证 pom.xml文件加入以下 JWT加密解密工具类 ...