Class ReportAdminRestController

java.lang.Object
se.bth.pulse.controller.ReportAdminRestController

@RestController public class ReportAdminRestController extends Object
This class is a rest controller that serves the report admin page.
  • Constructor Details

  • Method Details

    • readReport

      @PostMapping("/api/admin/report/read/{id}") public org.springframework.http.ResponseEntity readReport(@PathVariable("id") Integer id)
      Marks a report as read. The report is retrieved from the report repository using the id.
      Parameters:
      id - - the id of the report to be read
      Returns:
      ResponseEntity - the response entity containing a success message if the report was read successfully, an error message otherwise.
    • commentReport

      @PostMapping("/api/admin/report/comment/{id}") public org.springframework.http.ResponseEntity commentReport(@PathVariable("id") Integer reportId, @RequestBody String content)
      Adds a comment to a report. The report is retrieved from the report repository using the id. The comment is saved in the report comment repository.
      Parameters:
      reportId - - the id of the report to be commented on
      content - - the content of the comment
      Returns:
      ResponseEntity - the response entity containing a success message if the comment was added successfully, an error message otherwise.