blob: 16e0b223bb7ae2c1bb38e0bb7bac93aa4200ff2f [file] [log] [blame]
Krishyab0cc1882025-06-09 10:54:09 +08001package com.example.myproject.controller;
2
3import com.example.myproject.service.SeedRatingService;
4import org.springframework.web.bind.annotation.*;
5
6import java.util.Map;
7
8@RestController
9@RequestMapping("/echo/ratings")
10public class SeedRatingController {
11
12 private final SeedRatingService ratingService;
13
14 public SeedRatingController(SeedRatingService ratingService) {
15 this.ratingService = ratingService;
16 }
17
18 @PostMapping
19 public Map<String, Object> submitRating(
20 @RequestParam("userId") Long userId,
21 @RequestParam("seedId") Long seedId,
22 @RequestParam("score") Integer score
23 ) {
24 return ratingService.rateSeed(userId, seedId, score);
25 }
26}