| package api; |
| |
| import org.springframework.core.io.Resource; |
| import org.springframework.http.ResponseEntity; |
| import org.springframework.web.bind.annotation.GetMapping; |
| import org.springframework.web.bind.annotation.PostMapping; |
| import org.springframework.web.bind.annotation.RequestMapping; |
| import org.springframework.web.bind.annotation.RequestParam; |
| import org.springframework.web.bind.annotation.RestController; |
| import org.springframework.web.multipart.MultipartFile; |
| import org.springframework.web.bind.annotation.RequestBody; |
| |
| @RestController |
| @RequestMapping("/api") |
| public interface ApiInterface { |
| |
| @PostMapping("/save-torrent") |
| ResponseEntity<Integer> saveTorrent( |
| @RequestParam("userid") String userid, |
| @RequestParam("title") String title, |
| @RequestParam("tag") String tag, |
| @RequestParam("file") MultipartFile file |
| ); |
| |
| @GetMapping("/get-torrent") |
| ResponseEntity<Resource> getTorrent( |
| @RequestParam("torrentId") String seedid, |
| @RequestParam("userId") String userid |
| ); |
| |
| @GetMapping("/get-seed-list-by-tag") |
| ResponseEntity<String> getSeedListByTag( |
| @RequestParam("tag") String tag |
| ); |
| |
| @GetMapping("/torrent-detail") |
| ResponseEntity<String> getTorrentDetail( |
| @RequestParam("id") String seedid |
| ); |
| |
| @GetMapping("user-profile") |
| ResponseEntity<String> getUserProfile( |
| @RequestParam("id") String userid |
| ); |
| |
| @PostMapping("/change-profile") |
| ResponseEntity<Integer> changeProfile( |
| @RequestBody String requestBody |
| ); |
| |
| @GetMapping("/user-seeds") |
| ResponseEntity<String> getUserSeeds( |
| @RequestParam("userid") String userid |
| ); |
| |
| @PostMapping("/delete-seed") |
| ResponseEntity<Integer> deleteSeed( |
| @RequestBody String requestBody |
| ); |
| |
| @GetMapping("/user-stat") |
| ResponseEntity<String> getUserStat( |
| @RequestParam("userid") String userid |
| ); |
| |
| @PostMapping("/login") |
| ResponseEntity<String> loginUser( |
| @RequestBody String requestBody |
| ); |
| |
| @PostMapping("/register") |
| ResponseEntity<Integer> registerUser( |
| @RequestBody String requestBody |
| ); |
| |
| @GetMapping("/forum") |
| ResponseEntity<String> getForum(); |
| |
| @GetMapping("/forum-detail") |
| ResponseEntity<String> getPostById( |
| @RequestParam("postid") String postid |
| ); |
| |
| @PostMapping("/forum-reply") |
| ResponseEntity<Integer> addPostReply( |
| @RequestBody String requestBody |
| ); |
| |
| @GetMapping("/search-seeds") |
| ResponseEntity<String> searchSeeds( |
| @RequestParam("tag") String tag, |
| @RequestParam("keyword") String query |
| ); |
| |
| @GetMapping("/search-posts") |
| ResponseEntity<String> searchPosts( |
| @RequestParam("keyword") String query |
| ); |
| |
| @GetMapping("/get-userpt") |
| ResponseEntity<String> getUserPT( |
| @RequestParam("userid") String userid |
| ); |
| } |