...
 
Commits (5)
    https://gitcode.net/github_39655029/java-learning-demos/-/commit/0928874b38d0dc9abb84e3d306e9d73b28a88bfc 🎉 update springboot-swagger-demo 注解 2022-01-06T08:54:53+08:00 cunyu1943 747731461@qq.com https://gitcode.net/github_39655029/java-learning-demos/-/commit/4fb8fd3d91f5cd63991ce7f325d909740d86c4d5 🎉 update readme.md 2022-01-06T09:27:54+08:00 cunyu1943 747731461@qq.com https://gitcode.net/github_39655029/java-learning-demos/-/commit/bba655d06cc99c590b3ebb08b756e75aa2eb729f 🎉 rename springboot-swagger-demo -> springboot-swagger2-demo 2022-01-06T10:56:58+08:00 cunyu1943 747731461@qq.com https://gitcode.net/github_39655029/java-learning-demos/-/commit/f45beece0286978dcafc0ecc6cd2b5b539ae3f40 🎉 update springboot-swagger2-demo 2022-01-06T11:27:20+08:00 cunyu1943 747731461@qq.com https://gitcode.net/github_39655029/java-learning-demos/-/commit/80ac7b1fcf2b6f404c047f5d6ad2736ad7aad701 🎉 update readme 2022-01-06T11:29:47+08:00 cunyu1943 747731461@qq.com
......@@ -4,3 +4,6 @@
MyBatis Generator 代码生成器,配套教程:[MyBatis Generator 代码自动生成器,从此解放你的双手](https://blog.csdn.net/github_39655029/article/details/121927666)
## [springboot-swagger2-demo](https://github.com/cunyu1943/java-learning-demos/tree/main/springboot-swagger2-demo)
SpringBoot 集成 Swagger2,配套教程:[Spring Boot 集成 Swagger2,构建强大的 API 文档](https://mp.weixin.qq.com/s/Z4D2p9hDVNM15SnXvz661w)
......@@ -30,13 +30,6 @@
<version>2.9.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.google.guava</groupId>-->
<!-- <artifactId>guava</artifactId>-->
<!-- <version>20.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
......
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
......@@ -34,7 +35,7 @@ public class SwaggerDemoController {
@ApiOperation(value = "有参接口")
@PostMapping("demo")
public String demo(@ApiParam(name = "name", value = "村雨遥", required = true) String name) {
public String demo(@ApiParam(value = "姓名", required = true, example = "村雨遥") @RequestBody String name) {
return "hello," + name;
}
}