Package org.jsondoc.sample.pojo

Examples of org.jsondoc.sample.pojo.City


    @ApiError(code="9000", description="Illegal argument")
  })
  @RequestMapping(value="/{name}", method=RequestMethod.GET)
  public @ResponseBody @ApiResponseObject Country getCountryByName(@PathVariable @ApiParam(name="name", paramType=ApiParamType.PATH) String name) {
    List<City> cities = new ArrayList<City>();
    cities.add(new City("Sydney", 19329, 43));
    cities.add(new City("Melbourne", 85743, 12));
    cities.add(new City("Perth", 58735, 39));
    return new Country(32198, 5487, "Australia", cities, Continent.AUSTRALIA);
  }
View Full Code Here


  @ApiErrors(apierrors = { @ApiError(code = "2000", description = "City not found"), @ApiError(code = "9000", description = "Illegal argument") })
  @RequestMapping(value = "/{name}", method = RequestMethod.GET)
  public @ResponseBody
  @ApiResponseObject
  City get(@PathVariable @ApiParam(name = "name", description = "The city name", allowedvalues = { "Melbourne", "Sydney", "Perth" }, paramType=ApiParamType.PATH) String name) {
    return new City(name, 1982700, 52);
  }
View Full Code Here

  @RequestMapping(value = "/map", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })
  public @ApiResponseObject
  @ResponseBody
  Map<String, City> map() {
    Map<String, City> cities = new HashMap<String, City>();
    cities.put("a", new City("Adelaide", 4322, 8));
    cities.put("m", new City("Melbourne", 9080, 12));
    cities.put("p", new City("Perth", 743534, 5));
    cities.put("s", new City("Sydney", 54654, 32));
    return cities;
  }
View Full Code Here

TOP

Related Classes of org.jsondoc.sample.pojo.City

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.