Refactor: Update FormOfAdressController and add missing documentation
parent
ad0e18bc56
commit
6fa2179aff
|
@ -24,6 +24,8 @@ import org.springframework.web.bind.annotation.PutMapping;
|
|||
* - POST /api/form-of-adress
|
||||
* - PUT /api/form-of-adress
|
||||
* - DELETE /api/form-of-adress
|
||||
*
|
||||
* @see com.maradona.backend.entities.FormOfAddress
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/form-of-adress")
|
||||
|
@ -37,6 +39,7 @@ class FormOfAdressController {
|
|||
*
|
||||
* @param id The ID of the form of address to return.
|
||||
* @return The description of the form of address with the given ID.
|
||||
* @see com.maradona.backend.entities.FormOfAddress
|
||||
*/
|
||||
@GetMapping({ "/", "" })
|
||||
public ResponseEntity<FormOfAddress> getFormOfAdress(@RequestParam Long id) {
|
||||
|
@ -49,6 +52,7 @@ class FormOfAdressController {
|
|||
* Returns all form of addresses.
|
||||
*
|
||||
* @return A list of all form of addresses.
|
||||
* @see com.maradona.backend.entities.FormOfAddress
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public ResponseEntity<Iterable<FormOfAddress>> getAllFormOfAdresses() {
|
||||
|
@ -61,6 +65,7 @@ class FormOfAdressController {
|
|||
*
|
||||
* @param description The description of the new form of address.
|
||||
* @return The ID of the newly created form of address.
|
||||
* @see com.maradona.backend.entities.FormOfAddress
|
||||
*/
|
||||
@PostMapping({ "/", "" })
|
||||
public ResponseEntity<Void> createFormOfAdress(@RequestBody String description) {
|
||||
|
@ -76,6 +81,7 @@ class FormOfAdressController {
|
|||
* @param id The ID of the form of address to update.
|
||||
* @param description The new description of the form of address.
|
||||
* @return The updated form of address.
|
||||
* @see com.maradona.backend.entities.FormOfAddress
|
||||
*/
|
||||
@PutMapping({ "/", "" })
|
||||
public ResponseEntity<Void> updateFormOfAdress(@RequestParam Long id, @RequestBody String description) {
|
||||
|
@ -93,6 +99,7 @@ class FormOfAdressController {
|
|||
*
|
||||
* @param id The ID of the form of address to delete.
|
||||
* @return The deleted form of address.
|
||||
* @see com.maradona.backend.entities.FormOfAddress
|
||||
*/
|
||||
@DeleteMapping({ "/", "" })
|
||||
public ResponseEntity<Void> deleteFormOfAdress(@RequestParam Long id) {
|
||||
|
@ -103,5 +110,4 @@ class FormOfAdressController {
|
|||
formOfAdressService.deleteFormOfAddress(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue