package com.example.demo.config;
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.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
@EnableOpenApi
@Configuration
public class SwaggerConfig {
/**
* 创建API应用
* apiInfo() 增加API相关信息
* 通过select()函数返回一个ApiSelectorBuilder实例,用来控制哪些接口暴露给Swagger来展现,
* 本例采用指定扫描的包路径来定义指定要建立API的目录。
*
* @return
*/
@Bean
public Docket restApi() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("标准接口")
.apiInfo(apiInfo("Spring Boot中使用Swagger2构建RESTful APIs", "1.0"))
.useDefaultResponseMessages(true)
.forCodeGeneration(false)
.select()
//扫描哪个包
.apis(RequestHandlerSelectors.basePackage("com.example.demo.controller"))
.paths(PathSelectors.any())
.build();
}
/**
* 创建该API的基本信息(这些基本信息会展现在文档页面中)
* 访问地址://访问地址http://localhost:8084/swagger-ui/index.html
*
* @return
*/
private ApiInfo apiInfo(String title, String version) {
return new ApiInfoBuilder()
.title("用户管理")
.description("更多请关注")
.termsOfServiceUrl("")
.contact(new Contact("", "", ""))
.version(version)
.build();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
springboot+vue+element增删改查Demo
共68个文件
xml:14个
java:12个
class:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 6 下载量 18 浏览量
2022-05-24
21:04:41
上传
评论
收藏 793KB ZIP 举报
温馨提示
springboot+vue+element增删改查Demo 集成了: 1. restful接口定义 2. 增删改查定义,路径参数定义 3. 跨域处理 4. 参数校验 5. 异常拦截 6. swagger文档 7. 测试用例 8. logback日志文件配置 9. aop记录操作日志
资源推荐
资源详情
资源评论
收起资源包目录
demo.zip (68个子文件)
demo
.gitignore 395B
.mvn
wrapper
maven-wrapper.jar 57KB
maven-wrapper.properties 233B
pom.xml 2KB
mvnw 10KB
target
generated-test-sources
test-annotations
test-classes
com
example
demo
DemoApplicationTests.class 531B
generated-sources
annotations
classes
application.yml 468B
static
element.css 227KB
vue.js 334KB
fonts
element-icons.woff 28KB
element-icons.ttf 55KB
element.js 554KB
index.html 6KB
jquery.min.js 95KB
com
example
demo
controller
UserController.class 2KB
common
Constants.class 500B
Result.class 3KB
WebMvcConfig.class 2KB
config
ExceptionAdvice.class 2KB
SwaggerConfig.class 3KB
mapper
UserMapper.class 457B
doman
User.class 5KB
DemoApplication.class 893B
service
UserService.class 429B
impl
UserServiceImpl.class 2KB
mapper
UserMapper.xml 2KB
mybatis.xml 1KB
src
test
java
com
example
demo
DemoApplicationTests.java 206B
main
resources
application.yml 468B
static
element.css 227KB
vue.js 334KB
fonts
element-icons.woff 28KB
element-icons.ttf 55KB
element.js 554KB
index.html 6KB
jquery.min.js 95KB
mapper
UserMapper.xml 2KB
mybatis.xml 1KB
java
com
example
demo
controller
UserController.java 1KB
common
Constants.java 295B
Result.java 2KB
config
SwaggerConfig.java 2KB
WebMvcConfig.java 731B
handler
ExceptionAdvice.java 1KB
DemoApplication.java 486B
mapper
UserMapper.java 493B
doman
User.java 663B
service
UserService.java 630B
impl
UserServiceImpl.java 1KB
util
mvnw.cmd 7KB
.idea
.gitignore 184B
uiDesigner.xml 9KB
dataSources
f8f286b1-ba1d-470d-a4b2-04be0b00a64e
storage_v2
_src_
schema
information_schema.FNRwLQ.meta 76B
sys.zb4BAA.meta 61B
mysql.osA4Bg.meta 63B
performance_schema.kIw0nw.meta 76B
f8f286b1-ba1d-470d-a4b2-04be0b00a64e.xml 44KB
workspace.xml 6KB
encodings.xml 270B
httpRequests
http-requests-log.http 80B
http-client.cookies 31B
2022-05-24T113126.200.json 1KB
misc.xml 478B
jarRepositories.xml 880B
compiler.xml 705B
dataSources.local.xml 1007B
dataSources.xml 547B
HELP.md 1KB
共 68 条
- 1
water-之
- 粉丝: 1156
- 资源: 22
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页