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( |
| 26 | @RequestParam("seedid") String seedid, |
| 27 | @RequestParam("userid") String userid, |
| 28 | @RequestParam("ip") String ip |
| 29 | ); |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 30 | } |