root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 1 | package api; |
| 2 | |
Raver | f79fdb6 | 2025-06-03 06:02:49 +0000 | [diff] [blame] | 3 | import org.springframework.core.io.Resource; |
| 4 | import org.springframework.http.ResponseEntity; |
| 5 | import org.springframework.web.bind.annotation.GetMapping; |
| 6 | import org.springframework.web.bind.annotation.PostMapping; |
| 7 | import org.springframework.web.bind.annotation.RequestMapping; |
| 8 | import org.springframework.web.bind.annotation.RequestParam; |
| 9 | import org.springframework.web.bind.annotation.RestController; |
| 10 | import org.springframework.web.multipart.MultipartFile; |
| 11 | |
| 12 | @RestController |
| 13 | @RequestMapping("/api") |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 14 | public interface ApiInterface { |
Raver | f79fdb6 | 2025-06-03 06:02:49 +0000 | [diff] [blame] | 15 | |
| 16 | @PostMapping("/save-torrent") |
| 17 | ResponseEntity<Integer> saveTorrent( |
| 18 | @RequestParam("userid") String userid, |
| 19 | @RequestParam("title") String title, |
| 20 | @RequestParam("tag") String tag, |
| 21 | @RequestParam("file") MultipartFile file |
| 22 | ); |
| 23 | |
| 24 | @GetMapping("/get-torrent") |
| 25 | ResponseEntity<Resource> getTorrent( |
Raver | aae0612 | 2025-06-05 08:13:35 +0000 | [diff] [blame] | 26 | @RequestParam("torrentId") String seedid, |
| 27 | @RequestParam("userId") String userid |
| 28 | ); |
| 29 | |
| 30 | @GetMapping("/get-seed-list-by-tag") |
| 31 | ResponseEntity<String> getSeedListByTag( |
| 32 | @RequestParam("tag") String tag |
| 33 | ); |
| 34 | |
| 35 | @GetMapping("/torrent-detail") |
| 36 | ResponseEntity<String> getTorrentDetail( |
| 37 | @RequestParam("id") String seedid |
Raver | f79fdb6 | 2025-06-03 06:02:49 +0000 | [diff] [blame] | 38 | ); |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 39 | } |