Package one.suhas.rmc.controller
Class ReviewController
java.lang.Object
one.suhas.rmc.controller.ReviewController
A class for web routes related to reviews
-
Constructor Summary
ConstructorsConstructorDescriptionReviewController(ReviewService reviewService, ClassRepository classRepository) -
Method Summary
Modifier and TypeMethodDescriptionEndpoint that recieves data from the frontend, and makes a request to OpenAI to get a GPT generated revieworg.springframework.web.servlet.ModelAndViewgptPage()Renders the AI generated reviews pageorg.springframework.web.servlet.ModelAndViewsubmitReviewForm(ReviewSubmission review) Endpoint that recieves reviews without text and adds them to the databaseEndpoint that recieves reviews with text and adds them to the review queue
-
Constructor Details
-
ReviewController
-
-
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
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
-