Class ReviewController

java.lang.Object
one.suhas.rmc.controller.ReviewController

@RestController public class ReviewController extends Object
A class for web routes related to reviews
  • Constructor Details

  • Method Details

    • submitReviewForm

      @PostMapping("/reviewForm") public org.springframework.web.servlet.ModelAndView submitReviewForm(@ModelAttribute ReviewSubmission review)
      Endpoint that recieves reviews without text and adds them to the database
      Parameters:
      review - the data from the form
      Returns:
      A redirect back to the page of the class the user submitted the review for
    • submitTextReviewForm

      @PostMapping("/textReviewForm") public String submitTextReviewForm(@ModelAttribute TextReviewSubmission review)
      Endpoint that recieves reviews with text and adds them to the review queue
      Parameters:
      review - the data from the form
      Returns:
      A notification that their review has been submitted
    • gptPage

      @GetMapping("/gpt") public org.springframework.web.servlet.ModelAndView gptPage()
      Renders the AI generated reviews page
      Returns:
      the webpage with all needed data
    • gptForm

      @PostMapping("/gptForm") public String gptForm(GPTForm gptForm)
      Endpoint that recieves data from the frontend, and makes a request to OpenAI to get a GPT generated review
      Parameters:
      gptForm - the form submission from the webpage
      Returns:
      the content of the review, rendered as HTML formatted text