mirror of
https://github.com/Team-xManager/xManager.git
synced 2024-11-27 12:45:26 +01:00
Update RequestNetwork.java
This commit is contained in:
parent
2418b1c46d
commit
514398920d
@ -5,48 +5,48 @@ import android.app.Activity;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class RequestNetwork {
|
public class RequestNetwork {
|
||||||
private HashMap<String, Object> params = new HashMap<>();
|
private HashMap<String, Object> params = new HashMap<>();
|
||||||
private HashMap<String, Object> headers = new HashMap<>();
|
private HashMap<String, Object> headers = new HashMap<>();
|
||||||
|
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
|
|
||||||
private int requestType = 0;
|
private int requestType = 0;
|
||||||
|
|
||||||
public RequestNetwork(Activity activity) {
|
public RequestNetwork(Activity activity) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHeaders(HashMap<String, Object> headers) {
|
public void setHeaders(HashMap<String, Object> headers) {
|
||||||
this.headers = headers;
|
this.headers = headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(HashMap<String, Object> params, int requestType) {
|
public void setParams(HashMap<String, Object> params, int requestType) {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this.requestType = requestType;
|
this.requestType = requestType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Object> getParams() {
|
public HashMap<String, Object> getParams() {
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Object> getHeaders() {
|
public HashMap<String, Object> getHeaders() {
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Activity getActivity() {
|
public Activity getActivity() {
|
||||||
return activity;
|
return activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRequestType() {
|
public int getRequestType() {
|
||||||
return requestType;
|
return requestType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startRequestNetwork(String method, String url, String tag, RequestListener requestListener) {
|
public void startRequestNetwork(String method, String url, String tag, RequestListener requestListener) {
|
||||||
RequestNetworkController.getInstance().execute(this, method, url, tag, requestListener);
|
RequestNetworkController.getInstance().execute(this, method, url, tag, requestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface RequestListener {
|
public interface RequestListener {
|
||||||
public void onResponse(String tag, String response);
|
public void onResponse(String tag, String response, HashMap<String, Object> responseHeaders);
|
||||||
public void onErrorResponse(String tag, String message);
|
public void onErrorResponse(String tag, String message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user