blob: d2e804b462f411f4d8c6e8ed5747439474c2c76f [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 );
rhj46f62c42025-06-06 23:24:10 +080065
66 @PostMapping("/login")
67 ResponseEntity<String> loginUser(
68 @RequestBody String requestBody
69 );
70
71 @PostMapping("/register")
72 ResponseEntity<Integer> registerUser(
73 @RequestBody String requestBody
74 );
75
76 @GetMapping("/forum")
77 ResponseEntity<String> getForum();
rhj5b69b7e2025-06-07 01:28:08 +080078
79 @GetMapping("/forum-detail")
80 ResponseEntity<String> getPostById(
81 @RequestParam("postid") String postid
82 );
83
84 @PostMapping("/forum-reply")
85 ResponseEntity<Integer> addPostReply(
86 @RequestBody String requestBody
87 );
88
89 @GetMapping("/search-seeds")
90 ResponseEntity<String> searchSeeds(
91 @RequestParam("tag") String tag,
92 @RequestParam("keyword") String query
93 );
rootcd436562025-05-08 14:09:19 +000094}