Search in sources :

Example 1 with UserDto

use of io.swagger2.spring.boot.dao.UserDto in project spring-boot-starter-samples by vindell.

the class UserController method putUser.

@ApiOperation(value = "更新用户详细信息", notes = "根据url的id来指定更新对象,并根据传过来的user信息来更新用户详细信息")
@ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long"), @ApiImplicitParam(name = "user", value = "用户详细实体user", required = true, dataType = "UserDto") })
@RequestMapping(value = "put/{id}", method = RequestMethod.PUT)
public String putUser(@PathVariable Long id, @RequestBody UserDto user) {
    UserDto u = users.get(id);
    u.setName(user.getName());
    u.setAge(user.getAge());
    users.put(id, u);
    return "success";
}
Also used : UserDto(io.swagger2.spring.boot.dao.UserDto) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ApiImplicitParams (io.swagger.annotations.ApiImplicitParams)1 ApiOperation (io.swagger.annotations.ApiOperation)1 UserDto (io.swagger2.spring.boot.dao.UserDto)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1