Package de.trustable.ca3s.core.web.rest
Class CertificateResource
- java.lang.Object
-
- de.trustable.ca3s.core.web.rest.CertificateResource
-
@RestController @RequestMapping("/api") public class CertificateResource extends ObjectREST controller for managingCertificate.
-
-
Constructor Summary
Constructors Constructor Description CertificateResource(CertificateService certificateService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<Certificate>createCertificate(@Valid Certificate certificate)POST /certificates: Create a new certificate.org.springframework.http.ResponseEntity<Void>deleteCertificate(Long id)DELETE /certificates/:id: delete the "id" certificate.org.springframework.http.ResponseEntity<List<Certificate>>getAllCertificates(org.springframework.data.domain.Pageable pageable)GET /certificates: get all the certificates.org.springframework.http.ResponseEntity<Certificate>getCertificate(Long id)GET /certificates/:id: get the "id" certificate.org.springframework.http.ResponseEntity<Certificate>updateCertificate(@Valid Certificate certificate)PUT /certificates: Updates an existing certificate.
-
-
-
Constructor Detail
-
CertificateResource
public CertificateResource(CertificateService certificateService)
-
-
Method Detail
-
createCertificate
@PostMapping("/certificates") public org.springframework.http.ResponseEntity<Certificate> createCertificate(@Valid @RequestBody @Valid Certificate certificate) throws URISyntaxExceptionPOST /certificates: Create a new certificate.- Parameters:
certificate- the certificate to create.- Returns:
- the
ResponseEntitywith status201 (Created)and with body the new certificate, or with status400 (Bad Request)if the certificate has already an ID. - Throws:
URISyntaxException- if the Location URI syntax is incorrect.
-
updateCertificate
@PutMapping("/certificates") public org.springframework.http.ResponseEntity<Certificate> updateCertificate(@Valid @RequestBody @Valid Certificate certificate) throws URISyntaxExceptionPUT /certificates: Updates an existing certificate.- Parameters:
certificate- the certificate to update.- Returns:
- the
ResponseEntitywith status200 (OK)and with body the updated certificate, or with status400 (Bad Request)if the certificate is not valid, or with status500 (Internal Server Error)if the certificate couldn't be updated. - Throws:
URISyntaxException- if the Location URI syntax is incorrect.
-
getAllCertificates
@GetMapping("/certificates") public org.springframework.http.ResponseEntity<List<Certificate>> getAllCertificates(org.springframework.data.domain.Pageable pageable)GET /certificates: get all the certificates.- Parameters:
pageable- the pagination information.- Returns:
- the
ResponseEntitywith status200 (OK)and the list of certificates in body.
-
getCertificate
@GetMapping("/certificates/{id}") public org.springframework.http.ResponseEntity<Certificate> getCertificate(@PathVariable Long id)GET /certificates/:id: get the "id" certificate.- Parameters:
id- the id of the certificate to retrieve.- Returns:
- the
ResponseEntitywith status200 (OK)and with body the certificate, or with status404 (Not Found).
-
deleteCertificate
@DeleteMapping("/certificates/{id}") public org.springframework.http.ResponseEntity<Void> deleteCertificate(@PathVariable Long id)DELETE /certificates/:id: delete the "id" certificate.- Parameters:
id- the id of the certificate to delete.- Returns:
- the
ResponseEntitywith status204 (NO_CONTENT).
-
-