Skip to content

Commit

Permalink
MediaType updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dukris committed Jan 17, 2024
1 parent eb8c9ab commit d44582a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/git/tracehub/pmo/controller/ProjectController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,7 +59,7 @@ public class ProjectController {
* @param user User
* @return List of projects
*/
@GetMapping
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public List<Project> byUser(
@AuthenticationPrincipal final OAuth2User user
) {
Expand All @@ -71,7 +72,10 @@ public List<Project> 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
Expand All @@ -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
Expand Down

0 comments on commit d44582a

Please sign in to comment.