Class AcmeContactResource


  • @RestController
    @RequestMapping("/api")
    public class AcmeContactResource
    extends Object
    REST controller for managing AcmeContact.
    • Constructor Detail

      • AcmeContactResource

        public AcmeContactResource​(AcmeContactService acmeContactService)
    • Method Detail

      • createAcmeContact

        @PostMapping("/acme-contacts")
        public org.springframework.http.ResponseEntity<AcmeContact> createAcmeContact​(@Valid @RequestBody
                                                                                      @Valid AcmeContact acmeContact)
                                                                               throws URISyntaxException
        POST /acme-contacts : Create a new acmeContact.
        Parameters:
        acmeContact - the acmeContact to create.
        Returns:
        the ResponseEntity with status 201 (Created) and with body the new acmeContact, or with status 400 (Bad Request) if the acmeContact has already an ID.
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • updateAcmeContact

        @PutMapping("/acme-contacts")
        public org.springframework.http.ResponseEntity<AcmeContact> updateAcmeContact​(@Valid @RequestBody
                                                                                      @Valid AcmeContact acmeContact)
                                                                               throws URISyntaxException
        PUT /acme-contacts : Updates an existing acmeContact.
        Parameters:
        acmeContact - the acmeContact to update.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the updated acmeContact, or with status 400 (Bad Request) if the acmeContact is not valid, or with status 500 (Internal Server Error) if the acmeContact couldn't be updated.
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • getAllAcmeContacts

        @GetMapping("/acme-contacts")
        public List<AcmeContact> getAllAcmeContacts()
        GET /acme-contacts : get all the acmeContacts.
        Returns:
        the ResponseEntity with status 200 (OK) and the list of acmeContacts in body.
      • getAcmeContact

        @GetMapping("/acme-contacts/{id}")
        public org.springframework.http.ResponseEntity<AcmeContact> getAcmeContact​(@PathVariable
                                                                                   Long id)
        GET /acme-contacts/:id : get the "id" acmeContact.
        Parameters:
        id - the id of the acmeContact to retrieve.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the acmeContact, or with status 404 (Not Found).
      • deleteAcmeContact

        @DeleteMapping("/acme-contacts/{id}")
        public org.springframework.http.ResponseEntity<Void> deleteAcmeContact​(@PathVariable
                                                                               Long id)
        DELETE /acme-contacts/:id : delete the "id" acmeContact.
        Parameters:
        id - the id of the acmeContact to delete.
        Returns:
        the ResponseEntity with status 204 (NO_CONTENT).