use of com.bob.vertx.webapi.param.res.UserRes in project vertx-swagger by bobxwang.
the class UserVerticle method updateUserById.
@BBRouter(path = "/user/:id", httpMethod = HttpMethod.PUT)
@ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户标识", required = true, dataType = "integer", paramType = "path"), @ApiImplicitParam(name = "query", value = "用户体", dataType = "com.bob.vertx.webapi.param.req.UserReq", paramType = "body") })
@ApiOperation(value = "更新一个用户", response = UserRes.class)
@ApiResponses({ @ApiResponse(message = "response_annotation1", code = 200, response = UserRes.class) })
private void updateUserById(RoutingContext ctx) {
UserReq userReq = Json.decodeValue(ctx.getBody(), UserReq.class);
UserRes userRes = new UserRes();
userRes.setId(Integer.valueOf(ctx.request().getParam("id")));
userRes.setName(userReq.getName() + " updated");
ctx.response().putHeader("content-type", "application/json;charset=UTF-8").end(Json.encodePrettily(userRes));
}