Package com.righettod.swagger.jaxrs.entity

Examples of com.righettod.swagger.jaxrs.entity.Car


        @ApiError(code = 500, reason = "Unexpected error")})
    public Response add(@ApiParam(required = true, allowMultiple = false, allowableValues = "Only number", value = "Car identifier") @FormParam("id") String id, @ApiParam(required = false, allowMultiple = false, allowableValues = "All unless space", value = "Car name") @FormParam("name") String name, @ApiParam(value = "Car constructor name", allowableValues = "opel, ford, audi") @FormParam("constructor") String constructor) {
        if (id == null || "".equals(id.trim())) {
            return Response.status(Response.Status.BAD_REQUEST).build();
        }
        Car c = new Car();
        c.id = id;
        c.name = name;
        c.constructor = constructor;
        CAR_DB.put(c.id, c);
        return Response.ok("Car added", MediaType.TEXT_PLAIN_TYPE).build();
View Full Code Here


    @GET
    @Consumes(MediaType.TEXT_PLAIN)
    @ApiOperation(value = "Get car info as XML", notes = "Retrieve car info from DB", responseClass = "com.righettod.swagger.jaxrs.entity.Car", tags = "CAR,GET")
    @ApiError(code = 500, reason = "Unexpected error")
    public Response retrieve(@ApiParam(required = true, allowMultiple = false, allowableValues = "Only number", value = "Car identifier") @PathParam("id") String id) {
        Car c = null;
        if (CAR_DB.containsKey(id)) {
            c = CAR_DB.get(id);
        } else {
            c =  new Car();
        }
        //Return Car Entity and let sub class manage representation
        return Response.ok(c).build();
    }
View Full Code Here

TOP

Related Classes of com.righettod.swagger.jaxrs.entity.Car

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.