diff --git a/src/main/java/com/business/intelligence/service/controller/ProjectController.java b/src/main/java/com/business/intelligence/service/controller/ProjectController.java index 08dbb17..d0886a7 100644 --- a/src/main/java/com/business/intelligence/service/controller/ProjectController.java +++ b/src/main/java/com/business/intelligence/service/controller/ProjectController.java @@ -12,7 +12,6 @@ import java.util.Optional; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; -import static org.springframework.util.MimeTypeUtils.IMAGE_PNG_VALUE; @RestController @RequestMapping("/project") @@ -24,21 +23,21 @@ public ProjectController(final ProjectRepository projectRepository) { this.projectRepository = projectRepository; } - @RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE) public ResponseEntity create(@RequestHeader final HttpHeaders headers, @RequestBody final Project project) throws Exception { projectRepository.save(project); return ResponseEntity.ok().build(); } - @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) public ResponseEntity getById(@RequestHeader final HttpHeaders headers, @PathVariable("id") final int id) throws Exception { Optional result = projectRepository.findById(id); return result.map(ResponseEntity::ok).orElseGet(() -> ResponseEntity.notFound().build()); } - @RequestMapping(value = "/all", method = RequestMethod.GET, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/all", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) public ResponseEntity> getAll(@RequestHeader final HttpHeaders headers) throws Exception { return ResponseEntity.ok(projectRepository.findAll()); } @@ -56,7 +55,7 @@ public ResponseEntity addStage(@PathVariable("id") final int id, return ResponseEntity.ok(result); } - @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = APPLICATION_JSON_VALUE) public ResponseEntity delete(@RequestHeader final HttpHeaders headers, @PathVariable("id") final int id) throws Exception { Optional result = projectRepository.findById(id); diff --git a/src/main/java/com/business/intelligence/service/controller/StageController.java b/src/main/java/com/business/intelligence/service/controller/StageController.java index 3001f24..d3d793f 100644 --- a/src/main/java/com/business/intelligence/service/controller/StageController.java +++ b/src/main/java/com/business/intelligence/service/controller/StageController.java @@ -13,7 +13,6 @@ import java.util.Optional; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; -import static org.springframework.util.MimeTypeUtils.IMAGE_PNG_VALUE; @RestController @RequestMapping("/stage") @@ -25,7 +24,7 @@ public StageController(final StageRepository stageRepository) { this.stageRepository = stageRepository; } - @RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE) public ResponseEntity create(@RequestHeader final HttpHeaders headers, @RequestBody final Stage stage) throws Exception { stageRepository.save(stage); @@ -33,14 +32,14 @@ public ResponseEntity create(@RequestHeader final HttpHeaders headers, return ResponseEntity.ok().build(); } - @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) public ResponseEntity getById(@RequestHeader final HttpHeaders headers, @PathVariable("id") final int id) throws Exception { Optional result = stageRepository.findById(id); return result.map(ResponseEntity::ok).orElseGet(() -> ResponseEntity.notFound().build()); } - @RequestMapping(value = "/all", method = RequestMethod.GET, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/all", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) public ResponseEntity> getAll(@RequestHeader final HttpHeaders headers) throws Exception { return ResponseEntity.ok(stageRepository.findAll()); } diff --git a/src/main/java/com/business/intelligence/service/controller/TaskController.java b/src/main/java/com/business/intelligence/service/controller/TaskController.java index 6707ed6..40aa6a2 100644 --- a/src/main/java/com/business/intelligence/service/controller/TaskController.java +++ b/src/main/java/com/business/intelligence/service/controller/TaskController.java @@ -15,7 +15,6 @@ import java.util.Optional; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; -import static org.springframework.util.MimeTypeUtils.IMAGE_PNG_VALUE; @RestController @RequestMapping("/task") @@ -27,20 +26,20 @@ public TaskController(final TaskRepository taskRepository) { this.taskRepository = taskRepository; } - @RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE) public ResponseEntity create(@RequestHeader final HttpHeaders headers, @RequestBody final Task stage) throws Exception { return ResponseEntity.ok(taskRepository.save(stage)); } - @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) public ResponseEntity getById(@RequestHeader final HttpHeaders headers, @PathVariable("id") final int id) throws Exception { Optional result = taskRepository.findById(id); return result.map(ResponseEntity::ok).orElseGet(() -> ResponseEntity.notFound().build()); } - @RequestMapping(value = "/all", method = RequestMethod.GET, produces = IMAGE_PNG_VALUE) + @RequestMapping(value = "/all", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) public ResponseEntity> getAll(@RequestHeader final HttpHeaders headers) throws Exception { return ResponseEntity.ok(taskRepository.findAll()); }