Skip to content

Commit 15123bc

Browse files
author
donghua
committed
update ApiImplicitParam paramType field for swagger
1 parent c297ada commit 15123bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Chapter3-1-5/src/main/java/com/didispace/web/UserController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ public String postUser(@RequestBody User user) {
3636
}
3737

3838
@ApiOperation(value="获取用户详细信息", notes="根据url的id来获取用户详细信息")
39-
@ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long")
39+
@ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "path")
4040
@RequestMapping(value="/{id}", method=RequestMethod.GET)
4141
public User getUser(@PathVariable Long id) {
4242
return users.get(id);
4343
}
4444

4545
@ApiOperation(value="更新用户详细信息", notes="根据url的id来指定更新对象,并根据传过来的user信息来更新用户详细信息")
4646
@ApiImplicitParams({
47-
@ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long"),
47+
@ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "path"),
4848
@ApiImplicitParam(name = "user", value = "用户详细实体user", required = true, dataType = "User")
4949
})
5050
@RequestMapping(value="/{id}", method=RequestMethod.PUT)
@@ -57,7 +57,7 @@ public String putUser(@PathVariable Long id, @RequestBody User user) {
5757
}
5858

5959
@ApiOperation(value="删除用户", notes="根据url的id来指定删除对象")
60-
@ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long")
60+
@ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "path")
6161
@RequestMapping(value="/{id}", method=RequestMethod.DELETE)
6262
public String deleteUser(@PathVariable Long id) {
6363
users.remove(id);

0 commit comments

Comments
 (0)