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; |
rhj | c6a4ee0 | 2025-06-06 00:45:18 +0800 | [diff] [blame] | 11 | import org.springframework.web.bind.annotation.RequestBody; |
Raver | f79fdb6 | 2025-06-03 06:02:49 +0000 | [diff] [blame] | 12 | |
| 13 | @RestController |
| 14 | @RequestMapping("/api") |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 15 | public interface ApiInterface { |
Raver | f79fdb6 | 2025-06-03 06:02:49 +0000 | [diff] [blame] | 16 | |
| 17 | @PostMapping("/save-torrent") |
| 18 | ResponseEntity<Integer> saveTorrent( |
| 19 | @RequestParam("userid") String userid, |
| 20 | @RequestParam("title") String title, |
| 21 | @RequestParam("tag") String tag, |
| 22 | @RequestParam("file") MultipartFile file |
| 23 | ); |
| 24 | |
| 25 | @GetMapping("/get-torrent") |
| 26 | ResponseEntity<Resource> getTorrent( |
Raver | aae0612 | 2025-06-05 08:13:35 +0000 | [diff] [blame] | 27 | @RequestParam("torrentId") String seedid, |
| 28 | @RequestParam("userId") String userid |
| 29 | ); |
| 30 | |
| 31 | @GetMapping("/get-seed-list-by-tag") |
| 32 | ResponseEntity<String> getSeedListByTag( |
| 33 | @RequestParam("tag") String tag |
| 34 | ); |
| 35 | |
| 36 | @GetMapping("/torrent-detail") |
| 37 | ResponseEntity<String> getTorrentDetail( |
| 38 | @RequestParam("id") String seedid |
Raver | f79fdb6 | 2025-06-03 06:02:49 +0000 | [diff] [blame] | 39 | ); |
rhj | c6a4ee0 | 2025-06-06 00:45:18 +0800 | [diff] [blame] | 40 | |
| 41 | @GetMapping("user-profile") |
| 42 | ResponseEntity<String> getUserProfile( |
| 43 | @RequestParam("id") String userid |
| 44 | ); |
| 45 | |
| 46 | @PostMapping("/change-profile") |
| 47 | ResponseEntity<Integer> changeProfile( |
| 48 | @RequestBody String requestBody |
| 49 | ); |
| 50 | |
| 51 | @GetMapping("/user-seeds") |
| 52 | ResponseEntity<String> getUserSeeds( |
| 53 | @RequestParam("userid") String userid |
| 54 | ); |
| 55 | |
| 56 | @PostMapping("/delete-seed") |
| 57 | ResponseEntity<Integer> deleteSeed( |
| 58 | @RequestBody String requestBody |
| 59 | ); |
| 60 | |
| 61 | @GetMapping("/user-stat") |
| 62 | ResponseEntity<String> getUserStat( |
| 63 | @RequestParam("userid") String userid |
| 64 | ); |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 65 | } |