@RestController
@CrossOrigin(origins="*")
@RequestMapping(value="/api/v1/packs")
public class ServerPackController
extends java.lang.Object
/api/v1/packs.| Constructor and Description |
|---|
ServerPackController(ServerPackService injectedServerPackService)
Constructor responsible for our DI.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> |
downloadServerPack(int id)
GET request for downloading a server pack by the id in the database.
|
org.springframework.http.ResponseEntity<java.util.List<ServerPackModel>> |
getAllServerPacks()
GET request for retrieving a list of all available server packs.
|
org.springframework.http.ResponseEntity<ServerPackModel> |
getByFileID(int fileID)
GET request for a server pack matching the given CurseForge fileID.
|
org.springframework.http.ResponseEntity<ServerPackModel> |
getByFileID(java.lang.String specific)
GET request for retrieving a server pack for a specific CurseForge projectID and fileID.
|
org.springframework.http.ResponseEntity<java.util.List<ServerPackModel>> |
getByProjectID(int projectID)
GET request for retrieving a list of server packs by CurseForge projectID.
|
org.springframework.http.ResponseEntity<java.lang.Object> |
voteForServerPack(java.lang.String voting)
GET request for voting whether a server pack works or not.
|
@Autowired public ServerPackController(ServerPackService injectedServerPackService)
injectedServerPackService - Instance of ServerPackService@GetMapping(value="/download/{id}",
produces="application/zip")
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> downloadServerPack(@PathVariable
int id)
id - Integer. The id of the server pack in the database.@GetMapping(value="project/{projectid}")
public org.springframework.http.ResponseEntity<java.util.List<ServerPackModel>> getByProjectID(@PathVariable(value="projectid")
int projectID)
projectID - Integer. The id of the CurseForge project.ServerPackModel. A list of all server packs, if any, with the given CurseForge projectID.@GetMapping(value="file/{fileid}")
public org.springframework.http.ResponseEntity<ServerPackModel> getByFileID(@PathVariable(value="fileid")
int fileID)
fileID - Integer. The fileID of the CurseForge project for which to retrieve the server pack.ServerPackModel. The server pack for the corresponding CurseForge fileID, if it was found.@GetMapping(value="all") public org.springframework.http.ResponseEntity<java.util.List<ServerPackModel>> getAllServerPacks()
ServerPackModel. A list of all available server packs on this instance.@GetMapping(value="specific/{specific}")
public org.springframework.http.ResponseEntity<ServerPackModel> getByFileID(@PathVariable(value="specific")
java.lang.String specific)
specific - String. Comma seperated combination of CurseForge projectID and fileID.ServerPackModel. The server pack for the specified CurseForge projectID and fileID, if it was found.@GetMapping(value="vote/{voting}")
public org.springframework.http.ResponseEntity<java.lang.Object> voteForServerPack(@PathVariable(value="voting")
java.lang.String voting)
voting - String. The vote, consisting of the id of the server pack and whether the vote should be incremented or decremented. Example 42,up or 23,down.