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 | ); |
rhj | 46f62c4 | 2025-06-06 23:24:10 +0800 | [diff] [blame] | 65 | |
| 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(); |
rhj | 5b69b7e | 2025-06-07 01:28:08 +0800 | [diff] [blame] | 78 | |
| 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 | ); |
rhj | 5ebd93c | 2025-06-07 15:57:28 +0800 | [diff] [blame] | 94 | |
| 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 | ); |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame] | 104 | |
| 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 | ); |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 226 | } |