21301050 | f5f827d | 2025-06-09 15:09:33 +0800 | [diff] [blame^] | 1 | package com.pt5.pthouduan.controller; |
| 2 | |
| 3 | import com.pt5.pthouduan.entity.Torrent; |
| 4 | import com.pt5.pthouduan.entity.User; |
| 5 | import com.pt5.pthouduan.service.InviteService; |
| 6 | import com.pt5.pthouduan.service.RecommendService; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.web.bind.annotation.*; |
| 9 | |
| 10 | import java.util.List; |
| 11 | import java.util.Map; |
| 12 | |
| 13 | @RestController |
| 14 | @RequestMapping("/recommend") |
| 15 | public class RecommendController { |
| 16 | @Autowired |
| 17 | private RecommendService recommendService; |
| 18 | // @GetMapping("/test") |
| 19 | // public List<Map<String, Object>> test() { |
| 20 | // return recommendService.test(); |
| 21 | // } |
| 22 | @GetMapping("/list") |
| 23 | public List<Torrent> getRecommendList(@RequestParam Long userId) { |
| 24 | return recommendService.recommendForUser(userId); |
| 25 | } |
| 26 | } |