| | |
| | | class ApiUtil |
| | | { |
| | | |
| | | static String BASE_URL = "http://192.168.1.122:8082/"; |
| | | public static String BASE_URL = "http://192.168.1.122:8082/"; |
| | | |
| | | static void basePost(object obj) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | public static void getRequestUrl(String token, String baseUrl, OnRequestResultListener listener) |
| | | public static void getRequestUrl(String tbUid, String baseUrl, OnSuccess listener) |
| | | { |
| | | Dictionary<String, String> paramsMap = new Dictionary<String, String>(); |
| | | paramsMap.Add("baseUrl", baseUrl); |
| | | paramsMap.Add("tbUid", tbUid); |
| | | Dictionary<String, String> headers = new Dictionary<String, String>(); |
| | | headers.Add("token", token); |
| | | headers.Add("token", Constant.token); |
| | | startRequest(new RequestParams(BASE_URL + "parse/getRequestUrl", paramsMap, null, listener)); |
| | | } |
| | | |
| | | |
| | | public static void uploadCookie(String token, String cookies, OnRequestResultListener listener) |
| | | public static void uploadCookie( String cookies, OnRequestResultListener listener) |
| | | { |
| | | Dictionary<String, String> headers = new Dictionary<String, String>(); |
| | | headers.Add("token", token); |
| | | headers.Add("token", Constant.token); |
| | | Dictionary<String, String> paramsMap = new Dictionary<String, String>(); |
| | | paramsMap.Add("cookies", cookies); |
| | | startRequest(new RequestParams(BASE_URL + "parse/uploadCookies", paramsMap, headers, listener)); |
| | | } |
| | | |
| | | public static void uploadContent(String token, String content, OnRequestResultListener listener) |
| | | public static void uploadContent(String tbUid, String content, OnSuccess listener) |
| | | { |
| | | Dictionary<String, String> headers = new Dictionary<String, String>(); |
| | | headers.Add("token", token); |
| | | headers.Add("token", Constant.token); |
| | | Dictionary<String, String> paramsMap = new Dictionary<String, String>(); |
| | | paramsMap.Add("content", content); |
| | | startRequest(new RequestParams(BASE_URL + "parse/uploadContent", paramsMap, headers, listener)); |
| | |
| | | |
| | | |
| | | //搜索商品 |
| | | public static void searchGoods(String token, SearchInfo searchInfo,int page, OnSuccess listener) { |
| | | public static void searchGoods(int classType, SearchInfo searchInfo,int page, OnSuccess listener) { |
| | | Dictionary<String, String> headers = new Dictionary<String, String>(); |
| | | headers.Add("token", token); |
| | | headers.Add("token", Constant.token); |
| | | Dictionary<String, String> paramsMap = new Dictionary<String, String>(); |
| | | paramsMap.Add("searchInfo", JsonConvert.SerializeObject(searchInfo)); |
| | | paramsMap.Add("page",page+""); |
| | | paramsMap.Add("classType", classType + ""); |
| | | startRequest(new RequestParams(BASE_URL + "sdlj/goods/searchGoods", paramsMap, headers, listener)); |
| | | } |
| | | //发送验证码 |
| | | public static void SendVerifyCode(String email,String vcode, OnSuccess listener) |
| | | { |
| | | Dictionary<String, String> headers = new Dictionary<String, String>(); |
| | | headers.Add("token", Constant.token); |
| | | Dictionary<String, String> paramsMap = new Dictionary<String, String>(); |
| | | paramsMap.Add("email",email); |
| | | paramsMap.Add("vcode", vcode); |
| | | startRequest(new RequestParams(BASE_URL + "user/getVerifyCode", paramsMap, headers, listener)); |
| | | } |
| | | |
| | | public static void Login(String email, String vcode,String inviteCode, OnSuccess listener) |
| | | { |
| | | Dictionary<String, String> headers = new Dictionary<String, String>(); |
| | | headers.Add("token", Constant.token); |
| | | Dictionary<String, String> paramsMap = new Dictionary<String, String>(); |
| | | paramsMap.Add("account", email); |
| | | paramsMap.Add("vcode", vcode); |
| | | paramsMap.Add("inviteCode", inviteCode); |
| | | startRequest(new RequestParams(BASE_URL + "user/login", paramsMap, headers, listener)); |
| | | } |
| | | |
| | | } |
| | | } |