blob: 2b4a3a3833164b9f24cd3963b96a567cf02de464 [file] [log] [blame]
rootcd436562025-05-08 14:09:19 +00001package api;
2
Raverf79fdb62025-06-03 06:02:49 +00003import org.springframework.core.io.Resource;
4import org.springframework.http.ResponseEntity;
5import org.springframework.web.bind.annotation.GetMapping;
6import org.springframework.web.bind.annotation.PostMapping;
7import org.springframework.web.bind.annotation.RequestMapping;
8import org.springframework.web.bind.annotation.RequestParam;
9import org.springframework.web.bind.annotation.RestController;
10import org.springframework.web.multipart.MultipartFile;
rhjc6a4ee02025-06-06 00:45:18 +080011import org.springframework.web.bind.annotation.RequestBody;
Raverf79fdb62025-06-03 06:02:49 +000012
13@RestController
14@RequestMapping("/api")
rootcd436562025-05-08 14:09:19 +000015public interface ApiInterface {
Raverf79fdb62025-06-03 06:02:49 +000016
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(
Raveraae06122025-06-05 08:13:35 +000027 @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
Raverf79fdb62025-06-03 06:02:49 +000039 );
rhjc6a4ee02025-06-06 00:45:18 +080040
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 );
rootcd436562025-05-08 14:09:19 +000065}