From d44582a34bf0dff0393f27c9675533093eb15dd5 Mon Sep 17 00:00:00 2001 From: hizmailovich Date: Wed, 17 Jan 2024 17:54:10 +0300 Subject: [PATCH] MediaType updated --- .../tracehub/pmo/controller/ProjectController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/git/tracehub/pmo/controller/ProjectController.java b/src/main/java/git/tracehub/pmo/controller/ProjectController.java index 9ce2092..b9739c3 100644 --- a/src/main/java/git/tracehub/pmo/controller/ProjectController.java +++ b/src/main/java/git/tracehub/pmo/controller/ProjectController.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; @@ -58,7 +59,7 @@ public class ProjectController { * @param user User * @return List of projects */ - @GetMapping + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public List byUser( @AuthenticationPrincipal final OAuth2User user ) { @@ -71,7 +72,10 @@ public List byUser( * @param id Project id * @return Project */ - @GetMapping("/{id}") + @GetMapping( + value = "/{id}", + produces = MediaType.APPLICATION_JSON_VALUE + ) /* * @todo #1:45min/DEV check if authenticated user can access the Project. * we need create security checks that will made a statement @@ -87,11 +91,11 @@ public Project byId(@PathVariable final UUID id) { * Employ new project. * * @param project Project - * @param token Authentication token + * @param token Authentication token * @return Project * @checkstyle MethodBodyCommentsCheck (20 lines) */ - @PostMapping + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) /* * @todo #1:45min/DEV check if authenticated user can create a new * project. We need to create security checks that will make a statement