Class EventPostEditService
java.lang.Object
io.github.navjotsrakhra.eventmanager.service.EventPostEditService
The
EventPostEditService class is a Spring service responsible for updating event posts.- Version:
- 1.0
- Author:
- Navjot Singh Rakhra
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?> deletePostById(Long ID) Deletes an existing event post with the specified ID.org.springframework.http.ResponseEntity<?> deletePostById(Long id, Principal principal) Deletes an existing event post with the specified ID and checks if the user is authorized to delete the post.org.springframework.http.ResponseEntity<?> updatePostById(Long ID, @Valid EventPost newEventPostData) Updates an existing event post with the specified ID.org.springframework.http.ResponseEntity<?> updatePostById(Long id, @Valid EventPost postRecord, Principal principal) Updates an existing event post with the specified ID and checks if the user is authorized to edit the post.
-
Constructor Details
-
Method Details
-
deletePostById
Deletes an existing event post with the specified ID.- Parameters:
ID- The ID of the event post to delete.- Returns:
- A ResponseEntity containing no content if the deletion is successful. If unsuccessful, returns a 404 Not Found status code.
-
deletePostById
Deletes an existing event post with the specified ID and checks if the user is authorized to delete the post.- Parameters:
id- The ID of the event post to delete.principal- The Principal object containing the username of the user making the request.- Returns:
- A ResponseEntity containing no content if the deletion is successful. If unsuccessful, returns a 404 Not Found or 403 Forbidden status code.