blob: 16e0b223bb7ae2c1bb38e0bb7bac93aa4200ff2f [file] [log] [blame]
package com.example.myproject.controller;
import com.example.myproject.service.SeedRatingService;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("/echo/ratings")
public class SeedRatingController {
private final SeedRatingService ratingService;
public SeedRatingController(SeedRatingService ratingService) {
this.ratingService = ratingService;
}
@PostMapping
public Map<String, Object> submitRating(
@RequestParam("userId") Long userId,
@RequestParam("seedId") Long seedId,
@RequestParam("score") Integer score
) {
return ratingService.rateSeed(userId, seedId, score);
}
}