springboot-swagger

1.pom.xml配置

io.springfox
springfox-swagger-ui
2.7.0


io.springfox
springfox-swagger2
2.7.0

2.application.yml配置
swagger:
basePackage: com.example.demo.controller
contact: com.example.demo
title: API list
version: 1.0
3.主程序需要添加@EnableSwagger2注解
4.controller示例
@ApiOperation(value = "addAccount", httpMethod = "GET", response = Date.class, notes = "添加用户账号")
@RequestMapping(value = "getuser",method = RequestMethod.GET)
public Integer getUser() {
String keys = redisService.get("WECHAT:CUSTOMIZE:MENU:VERSION",String.class);
System.out.println(keys);
Integer userById = userService.getUserById();
return userById;
}

你可能感兴趣的:(springboot-swagger)