Swagger

访问http://localhost:8080/

如果不想用UI的部分工作,可以使用Swagger。

Swagger需要两个另外的Dependencies。

swagger ui 和 swagger2

@EnableSwagger2

这是项目的可选步骤。

@Bean

public Docket api() {

return new Docket(DocumentationType.SWAGGER_2).select()

.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)).paths(PathSelectors.any())

.build().apiInfo(apiInfo()).useDefaultResponseMessages(false);

}

@Bean

public ApiInfo apiInfo() {

final ApiInfoBuilder builder = new ApiInfoBuilder();

return builder.build();

}

相关推荐
打工仔折腾 AI8 小时前
工业场景下时序库与实时计算一体化架构选型实践对比
java·开发语言·后端·python·性能优化·架构·ai agent 实战
蜗牛互联网8 小时前
长任务多Agent共享文件系统的Manifest交接模式
java·人工智能·后端
苏supper10 小时前
Spring Boot多环境配置与打包运行
spring boot·后端·spring
geovindu10 小时前
rust: Composite Pattern
开发语言·后端·设计模式·rust·组合模式
SearchMan11 小时前
还有人不知道&和&&的区别?
后端
想用offer打牌11 小时前
Personal Agent爆火 - 它到底是个什么
人工智能·后端·ai编程
IT_陈寒11 小时前
Vue的v-if和v-for混用居然是个天坑
前端·人工智能·后端
打工仔折腾 AI13 小时前
从Attention到BERT:双向预训练语言模型到底解决了什么问题
人工智能·后端·python·深度学习·语言模型·bert
lizhongxuan14 小时前
Agent Sandbox: Firecracker 任务生命周期
后端
YYYing.15 小时前
【设计模式系列 (七) 】桥接模式
c++·后端·设计模式·桥接模式