Class PlaceController
java.lang.Object
com.JesacaLin.GrubGoblin_v13.controllers.PlaceController
@PreAuthorize("isAuthenticated()")
@RestController
@RequestMapping("/place")
public class PlaceController
extends Object
Controller for managing Place entities.
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceController
(PlaceDAO placeDAO) Constructs a new PlaceController with the given PlaceDAO. -
Method Summary
Modifier and TypeMethodDescriptioncreatePlace
(Place place) Creates a new Place.int
deleteUser
(int id) Deletes a Place by its ID.getPlaceById
(int id) Retrieves a Place by its ID.Retrieves all Places.updatePlace
(int id, Place place) Updates a Place.
-
Constructor Details
-
PlaceController
Constructs a new PlaceController with the given PlaceDAO.- Parameters:
placeDAO
- the PlaceDAO to use for place management
-
-
Method Details
-
listOfPlaces
-
getPlaceById
Retrieves a Place by its ID.- Parameters:
id
- the ID of the Place to retrieve- Returns:
- the Place with the given ID
-
createPlace
-
updatePlace
-
deleteUser
@PreAuthorize("hasAuthority(\'admin\')") @DeleteMapping("/{id}") public int deleteUser(@PathVariable int id) Deletes a Place by its ID.- Parameters:
id
- the ID of the Place to delete- Returns:
- the number of rows affected by the delete
-