Class CountryEndpoint
- java.lang.Object
-
- com.broadleafcommerce.customer.web.endpoint.CountryEndpoint
-
@FrameworkRestController @FrameworkMapping("/countries") @DataRouteByExample(ISOCountry.class) public class CountryEndpoint extends Object
Temporary endpoint to retrieve a list of ISO countries for use in admin. This is planned to be its own service so we have a single source for this data, because right now it's peppered throughout the framework where addresses are used.Choosing this route to minimize the work when migrating to the actual implementation.
-
-
Constructor Summary
Constructors Constructor Description CountryEndpoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initializeCountries()
Collection<ISOCountry>
readAllCountries()
protected Map<String,ISOCountry>
readCountries(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
ISOCountry
readCountry(String alpha2)
protected Map<String,List<String>>
readStateProvinceRegions(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
List<String>
readStateProvinceRegionsForCountry(String alpha2)
-
-
-
Field Detail
-
BASE_URI
public static final String BASE_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
readAllCountries
@FrameworkGetMapping public Collection<ISOCountry> readAllCountries()
-
readCountry
@FrameworkGetMapping("/{alpha2}") public ISOCountry readCountry(@PathVariable("alpha2") String alpha2)
-
readStateProvinceRegionsForCountry
@FrameworkGetMapping("/{alpha2}/stateProvinceRegion") public List<String> readStateProvinceRegionsForCountry(@PathVariable("alpha2") String alpha2)
-
initializeCountries
protected void initializeCountries()
-
readStateProvinceRegions
protected Map<String,List<String>> readStateProvinceRegions(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
readCountries
protected Map<String,ISOCountry> readCountries(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-