-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
done by adding classes dedicated to requests
- Loading branch information
1 parent
f91b021
commit d2701ef
Showing
23 changed files
with
262 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
shared/src/main/java/net/leaderos/shared/model/request/impl/auth/AuthRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package net.leaderos.shared.model.request.impl.auth; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class AuthRequest extends PostRequest { | ||
|
||
public AuthRequest(String username, String uuid) throws IOException { | ||
super("auth/generate-link", new HashMap<String, String>() {{ | ||
put("username", username); | ||
put("uuid", uuid); | ||
}}); | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
shared/src/main/java/net/leaderos/shared/model/request/impl/bazaar/AddBazaarItemRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.leaderos.shared.model.request.impl.bazaar; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class AddBazaarItemRequest extends PostRequest { | ||
|
||
public AddBazaarItemRequest(String userId, String name, String lore, int amount, int maxDurability, int durability, String base64, double price, String creationDate, String modelId, String enchantment, int serverId, String item) throws IOException { | ||
super("bazaar/storages/" + userId + "/items", new HashMap<String, String>() {{ | ||
put("owner", userId); | ||
put("name", name); | ||
if (lore != null) | ||
put("lore", lore); | ||
put("amount", String.valueOf(amount)); | ||
put("maxDurability", String.valueOf(maxDurability)); | ||
put("durability", String.valueOf(durability)); | ||
put("base64", base64); | ||
put("price", String.valueOf(price)); | ||
put("creationDate", String.valueOf(creationDate)); | ||
if (modelId != null) | ||
put("modelID", modelId); | ||
if (enchantment != null) | ||
put("enchantment", enchantment); | ||
put("serverID", String.valueOf(serverId)); | ||
put("itemID", item); | ||
}}); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...ed/src/main/java/net/leaderos/shared/model/request/impl/bazaar/GetBazaarItemsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.leaderos.shared.model.request.impl.bazaar; | ||
|
||
import net.leaderos.shared.model.request.GetRequest; | ||
|
||
import java.io.IOException; | ||
|
||
public class GetBazaarItemsRequest extends GetRequest { | ||
|
||
public GetBazaarItemsRequest(String userId, String serverId) throws IOException { | ||
super("bazaar/storages/" + userId + "/items?serverID=" + serverId); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
.../src/main/java/net/leaderos/shared/model/request/impl/bazaar/RemoveBazaarItemRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.leaderos.shared.model.request.impl.bazaar; | ||
|
||
import net.leaderos.shared.model.request.DeleteRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class RemoveBazaarItemRequest extends DeleteRequest { | ||
|
||
public RemoveBazaarItemRequest(String userId, String id) throws IOException { | ||
super("bazaar/storages/" + userId + "/items/" + id, new HashMap<>()); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
shared/src/main/java/net/leaderos/shared/model/request/impl/credit/AddCreditsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.leaderos.shared.model.request.impl.credit; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class AddCreditsRequest extends PostRequest { | ||
|
||
public AddCreditsRequest(String target, double amount) throws IOException { | ||
super("credits/" + target + "/add", new HashMap<String, String>() {{ | ||
put("amount", String.valueOf(amount)); | ||
}}); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
shared/src/main/java/net/leaderos/shared/model/request/impl/credit/GetCreditsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.leaderos.shared.model.request.impl.credit; | ||
|
||
import net.leaderos.shared.model.request.GetRequest; | ||
|
||
import java.io.IOException; | ||
|
||
public class GetCreditsRequest extends GetRequest { | ||
|
||
public GetCreditsRequest(String username) throws IOException { | ||
super("credits/" + username); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
shared/src/main/java/net/leaderos/shared/model/request/impl/credit/RemoveCreditsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.leaderos.shared.model.request.impl.credit; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class RemoveCreditsRequest extends PostRequest { | ||
public RemoveCreditsRequest(String target, double amount) throws IOException { | ||
super("credits/" + target + "/remove", new HashMap<String, String>() {{ | ||
put("amount", String.valueOf(amount)); | ||
}}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
shared/src/main/java/net/leaderos/shared/model/request/impl/credit/SendCreditsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.leaderos.shared.model.request.impl.credit; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class SendCreditsRequest extends PostRequest { | ||
public SendCreditsRequest(String sender, String target, double amount) throws IOException { | ||
super("credits/" + sender + "/send", new HashMap<String, String>() {{ | ||
put("target", target); | ||
put("amount", String.valueOf(amount)); | ||
}}); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
shared/src/main/java/net/leaderos/shared/model/request/impl/credit/SetCreditsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.leaderos.shared.model.request.impl.credit; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class SetCreditsRequest extends PostRequest { | ||
public SetCreditsRequest(String target, double amount) throws IOException { | ||
super("credits/" + target + "/set", new HashMap<String, String>() {{ | ||
put("amount", String.valueOf(amount)); | ||
}}); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
shared/src/main/java/net/leaderos/shared/model/request/impl/discord/DiscordSyncRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.leaderos.shared.model.request.impl.discord; | ||
|
||
import net.leaderos.shared.model.request.PostRequest; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
public class DiscordSyncRequest extends PostRequest { | ||
public DiscordSyncRequest(String username) throws IOException { | ||
super("integrations/discord/sync", new HashMap<String, String>() {{ | ||
put("user", username); | ||
}}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...d/src/main/java/net/leaderos/shared/model/request/impl/donations/GetDonationsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package net.leaderos.shared.model.request.impl.donations; | ||
|
||
import net.leaderos.shared.model.request.GetRequest; | ||
|
||
import java.io.IOException; | ||
|
||
public class GetDonationsRequest extends GetRequest { | ||
/** | ||
* Request constructor | ||
* | ||
* @param api of request | ||
* @throws IOException for HttpUrlConnection | ||
*/ | ||
public GetDonationsRequest(String type) throws IOException { | ||
super("store/donations/?type=" + type + "&limit=10"); | ||
} | ||
} |
Oops, something went wrong.