首页>代码>spring+spring boot+mybatis+shiro+thymeleaf实现社区党务后台管理系统>/PartyAffairs/Backstage/src/main/java/com/dai/party/config/BackstageSwagger2Configuration.java
package com.dai.party.config; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * @program: partyAffairs * @description:项目后台Swagger2配置 * @author: Dai Yuanchuan * @create: 2019-01-11 00:19 **/ @Configuration @ConditionalOnProperty(prefix = "swagger",value = {"enable"},havingValue = "true") @EnableSwagger2 public class BackstageSwagger2Configuration { /** * SWAGR2的配置文件,其中可以配置SWAGR2的一些基本元素,如扫描包等。 * @return */ @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() //这里是包路径 .apis(RequestHandlerSelectors.basePackage("com.dai.party.controller")) .paths(PathSelectors.any()) .build(); } /** * 建立API文档的详细信息功能,注意这里引用的是哪一个。 * @return */ private ApiInfo apiInfo() { return new ApiInfoBuilder() //页面标题 .title("系统后台 接口说明文档") .description("API 描述") .termsOfServiceUrl("javascript:void(0);") .contact(new Contact("Dai Yuanchuan", "", "novel-web@novelweb.cn")) .version("1.0") .build(); } }

泓鼎168 LV20
2024年6月12日
小温ggggg LV6
2023年10月24日
爱吃鱼的猫Vital LV6
2023年7月31日
suyuquan LV2
2023年7月31日
happyMrLi LV5
2023年7月31日
yunYUN123 LV1
2023年2月26日
taowufeng2 LV8
2022年12月9日
翰昌之杰2 LV6
2022年11月30日
1025490081 LV2
2022年11月9日
wylwylqq LV6
2022年11月6日

zhanghna799 LV3
3月10日
陈小灏 LV18
2月18日
沈从文 LV3
2024年12月8日
15719908287 LV9
2024年9月27日
hmf1989
2024年9月26日
暂无贡献等级
lo8lukoukoum LV4
2024年9月26日
happySuperman LV2
2024年6月4日
1941549176 LV4
2024年5月9日
shuangfu LV25
2024年5月7日
刘孟飞 LV22
2024年4月14日