service/transportation-service/src/main/java/org/bananaforscale/transportation/rest/resource/AirplaneResource.java
@POST
    @Path("")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response add(SimpleAirplaneBinding airplane) {
        try {
            Integer id = apm.add(airplane);
            return Response.ok(JsonUtil.createSuccessMessage(String.valueOf(id))).build();
        } catch (Exception ex) {
            LOGGER.error("Could not add airplane", ex);
            return Response.ok(JsonUtil.createErrorMessage("An error occurred while adding airplane")).build();
        }

    }
/**
     * Add an airplane.
     *
     * @param airplane the airplane to add
     * @return response object containing status and data
     */
Add an airplane.
@param airplane the airplane to add
@return response object containing status and data
Add an airplane . @param airplane the airplane to add @return response object containing status and data
@POST
    @Path("")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response add(SimpleAirplaneBinding airplane) {
        try {
            Integer id = apm.add(airplane);
            return Response.ok(JsonUtil.createSuccessMessage(String.valueOf(id))).build();
        } catch (Exception ex) {
            LOGGER.error("Could not add airplane", ex);
            return Response.ok(JsonUtil.createErrorMessage("An error occurred while adding airplane")).build();
        }
    }
@ POST @ Path ( "" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response add ( SimpleAirplaneBinding airplane ) { try { Integer id = apm . add ( airplane ) ; return Response . ok ( JsonUtil . createSuccessMessage ( String . valueOf ( id ) ) ) . build ( ) ; } catch ( Exception ex ) { LOGGER . error ( "Could not add airplane" , ex ) ; return Response . ok ( JsonUtil . createErrorMessage ( "An error occurred while adding airplane" ) ) . build ( ) ; } }
Add an airplane.
Add an airplane .