feat: code
This commit is contained in:
@@ -2,7 +2,6 @@ package online.mineroo.common;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import online.mineroo.common.NetworkServiceInterface;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package online.mineroo.common;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class ProxyNetworkRequest {
|
||||
private final String requestId;
|
||||
private final String method; // "GET" or "POST"
|
||||
private final String endpoint;
|
||||
private final Map<String, String> params;
|
||||
private final String jsonBody;
|
||||
|
||||
public ProxyNetworkRequest(String method, String endpoint, Map<String, String> params, JsonObject body) {
|
||||
this.requestId = UUID.randomUUID().toString();
|
||||
this.method = method;
|
||||
this.endpoint = endpoint;
|
||||
this.params = params;
|
||||
this.jsonBody = (body != null) ? body.toString() : null;
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public String getEndpoint() {
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public String getJsonBody() {
|
||||
return jsonBody;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user