blob: 2b4a3a3833164b9f24cd3963b96a567cf02de464 [file] [log] [blame]
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
);
}