blob: 475b5d2fbdeefbfe3f5e16efef5bd95d73081145 [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 );
rhj5ebd93c2025-06-07 15:57:28 +080094
95 @GetMapping("/search-posts")
96 ResponseEntity<String> searchPosts(
97 @RequestParam("keyword") String query
98 );
99
100 @GetMapping("/get-userpt")
101 ResponseEntity<String> getUserPT(
102 @RequestParam("userid") String userid
103 );
rhje18c3f72025-06-08 00:27:01 +0800104
105 @GetMapping("/admin/config")
106 ResponseEntity<String> getConfig(
107 @RequestParam("userid") String userid
108 );
109
110 @GetMapping("/admin/cheat-users")
111 ResponseEntity<String> getCheatUsers(
112 @RequestParam("userid") String userid
113 );
114
115 @GetMapping("/admin/suspicious-users")
116 ResponseEntity<String> getSuspiciousUsers(
117 @RequestParam("userid") String userid
118 );
119
120 @PostMapping("/admin/unban-user")
121 ResponseEntity<Integer> unbanUser(
122 @RequestBody String requestBody
123 );
124
125 @PostMapping("/admin/ban-user")
126 ResponseEntity<Integer> banUser(
127 @RequestBody String requestBody
128 );
129
130 @GetMapping("/appeals")
131 ResponseEntity<String> getAppeals();
132
133 @GetMapping("/migrations")
134 ResponseEntity<String> getMigrations();
135
136 @PostMapping("/appeals-approve")
137 ResponseEntity<Integer> approveAppeal(
138 @RequestBody String requestBody
139 );
140
141 @PostMapping("/appeals-reject")
142 ResponseEntity<Integer> rejectAppeal(
143 @RequestBody String requestBody
144 );
145
146 @PostMapping("/migrations-approve")
147 ResponseEntity<Integer> approveMigration(
148 @RequestBody String requestBody
149 );
150
151 @PostMapping("/migrations-reject")
152 ResponseEntity<Integer> rejectMigration(
153 @RequestBody String requestBody
154 );
155
156 @PostMapping("/invite")
157 ResponseEntity<Integer> inviteUser(
158 @RequestBody String requestBody
159 );
160
161 @PostMapping("/submit-appeal")
162 ResponseEntity<Integer> submitAppeal(
163 @RequestParam("userid") String userid,
164 @RequestParam("content") String content,
165 @RequestParam("file") MultipartFile file
166 );
167
168 @GetMapping("/user-stats")
169 ResponseEntity<String> getUserStats(
170 @RequestParam("userid") String userid
171 );
172
173 @PostMapping("/exchange")
174 ResponseEntity<Integer> magicExchange(
175 @RequestBody String requestBody
176 );
177
178 @GetMapping("/user-favorites")
179 ResponseEntity<String> getUserFavorites(
180 @RequestParam("userid") String userid
181 );
182
183 @PostMapping("/remove-favorite")
184 ResponseEntity<Integer> removeFavorite(
185 @RequestBody String requestBody
186 );
187
188 @PostMapping("/add-favorite")
189 ResponseEntity<Integer> addFavorite(
190 @RequestBody String requestBody
191 );
192
193 @PostMapping("/migrate-account")
194 ResponseEntity<Integer> migrateAccount(
195 @RequestParam("userid") String userid,
196 @RequestParam("file") MultipartFile file
197 );
198
199 @GetMapping("/begseed-list")
200 ResponseEntity<String> getBegSeedList();
201
202 @GetMapping("/begseed-detail")
203 ResponseEntity<String> getBegSeedDetail(
204 @RequestParam("begid") String begid
205 );
206
207 @GetMapping("/begseed-submissions")
208 ResponseEntity<String> getBegSeedSubmissions(
209 @RequestParam("begid") String begid
210 );
211
212 @PostMapping("/submit-seed")
213 ResponseEntity<Integer> submitSeed(
214 @RequestBody String requestBody
215 );
216
217 @PostMapping("/vote-seed")
218 ResponseEntity<Integer> voteSeed(
219 @RequestBody String requestBody
220 );
221
222 @PostMapping("/create-begseed")
223 ResponseEntity<Integer> createBegSeed(
224 @RequestBody String requestBody
225 );
rootcd436562025-05-08 14:09:19 +0000226}