Skip to content

Commit 2649edb

Browse files
committed
test defaultValue
1 parent a5bea19 commit 2649edb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

help/http-requests.http

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ GET http://localhost:9100/async/dotask?sleep=3
1616
### /retry/test
1717
GET http://localhost:9100/retry/test
1818

19+
### /param/defaultValue
20+
GET http://localhost:9100/param/defaultValue

src/main/java/cn/netbuffer/springboot/demo/controller/ParamController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,9 @@ public Object dataName() {
161161
return dataName;
162162
}
163163

164+
@GetMapping("defaultValue")
165+
public String defaultValue(@RequestParam(defaultValue = "default") String value) {
166+
return value;
167+
}
168+
164169
}

0 commit comments

Comments
 (0)