Class RestApiController

java.lang.Object
com.datengaertnerei.test.dataservice.RestApiController

@RestController @RequestMapping(value="/api/v1", produces="application/json") public class RestApiController extends Object
Spring Boot main REST API controller
  • Constructor Details

    • RestApiController

      public RestApiController()
  • Method Details

    • bundles

      @GetMapping("/bundles") public List<Bundle> bundles(@RequestParam(required=false,defaultValue="1") @Max(50L) @jakarta.validation.constraints.Max(50L) int size)
      Parameters:
      size - the size of the result set
      Returns:
      random adult persons inc. phone and payment data
    • mobile

      @GetMapping("/mobile") public PhoneNumber mobile()
      Returns:
      random german mobile number
    • landline

      @GetMapping("/landline") public PhoneNumber landline()
      Returns:
      random german landline number with generic area code
    • landlineForCity

      @GetMapping("/landline/{city}") public PhoneNumber landlineForCity(@PathVariable("city") String city)
      Parameters:
      city - city name to generate landline number for
      Returns:
      random german landline number with area code for the given city (fallback to generic area code if city not found)
    • creditcard

      @GetMapping("/creditcard") public CreditCard creditcard()
      Returns:
      random credit card (major types, german issuers)
    • account

      @GetMapping("/account") public BankAccount account()
      Returns:
      random german bank account (uses Frankfurt am Main as default location)
    • accountForCity

      @GetMapping("/account/{city}") public BankAccount accountForCity(@PathVariable("city") String city)
      Parameters:
      city - city name to generate bank account for
      Returns:
      random german bank account for given city (fallback to Frankfurt am Main if no bank found for given city)
    • person

      @GetMapping("/person") public Person person(@RequestParam(required=false) AgeRange age)
      Parameters:
      age - age
      Returns:
      random person with a valid german postal address
    • personForCity

      @GetMapping("/person/city/{city}") public Person personForCity(@PathVariable("city") String city, @RequestParam(required=false) AgeRange age)
      Parameters:
      city - city
      age - age
      Returns:
      random person with a valid german postal address within the given city
    • personForPostcode

      @GetMapping("/person/postalcode/{postalcode}") public Person personForPostcode(@PathVariable("postalcode") String postalCode, @RequestParam(required=false) AgeRange age)
      Parameters:
      postalCode - postalCode
      age - age
      Returns:
      random person with a valid german postal address within the given postal code (zip) area (1-5 digits)
    • avatar

      @GetMapping(value="/avatar", produces="image/png") public org.springframework.http.ResponseEntity<byte[]> avatar(@RequestParam(defaultValue="female",required=false) String gender)
      Parameters:
      gender - gender
      Returns:
      random female or male avatar PNG image