feat: swagger
This commit is contained in:
@@ -77,5 +77,11 @@
|
||||
<version>1.37.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -42,6 +42,9 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
//拦截所有接口
|
||||
.addPathPatterns("/**")
|
||||
//不拦截/user/doLogin登录接口
|
||||
.excludePathPatterns("/swagger-ui/**")
|
||||
.excludePathPatterns("/swagger-ui.html")
|
||||
.excludePathPatterns("/swagger-resources/**","/swagger-ui/**", "/v3/**", "/error")
|
||||
.excludePathPatterns("/student/login");
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package com.landaiqing.auth.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
/**
|
||||
* @Classname SwaggerConfig
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.auth.common.config
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-05 19:36
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableOpenApi
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket docket(){
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
.enable(true)//关闭Swagger
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.landaiqing.controller"))
|
||||
.build();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user