|
@@ -0,0 +1,196 @@
|
|
|
+package com.ynstkz.shitu.android.data;
|
|
|
+
|
|
|
+import com.common.library.okhttp.OkHttpUtils;
|
|
|
+import com.common.library.okhttp.callback.Callback;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 作者:fuchangle on 2018/2/12 17:33
|
|
|
+ */
|
|
|
+
|
|
|
+public class RequestGroup {
|
|
|
+
|
|
|
+ /***
|
|
|
+ * 获取系统级参数
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static Map<String, String> getSystemParams() {
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ return params;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 注册
|
|
|
+ * @param mobile
|
|
|
+ * @param userName
|
|
|
+ * @param pwd
|
|
|
+ * @param rePwd
|
|
|
+ */
|
|
|
+ public static void register(String mobile, String userName, String pwd, String rePwd, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ params.put("userName", userName);
|
|
|
+ params.put("pwd", pwd);
|
|
|
+ params.put("rePwd", rePwd);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_REGISTER).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 登陆
|
|
|
+ * @param userName
|
|
|
+ * @param userPwd
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
+ public static void login(String userName, String userPwd, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("userName", userName);
|
|
|
+ params.put("userPwd", userPwd);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_LOGIN).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取更新
|
|
|
+ */
|
|
|
+ public static void getAppVersion(Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ OkHttpUtils.get().url(UrlCat.URL_APP_VERSION).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送短信
|
|
|
+ * @param type
|
|
|
+ * @param mobile
|
|
|
+ */
|
|
|
+ public static void snedSms(String type, String mobile, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("type", type);
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_SMS_SEND).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送短信
|
|
|
+ * @param type
|
|
|
+ * @param mobile
|
|
|
+ */
|
|
|
+ public static void verifySms(String type, String mobile, String code, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("type", type);
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ params.put("code", code);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_SMS_VERIFY).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取banner
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
+ public static void getBannerList(Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ OkHttpUtils.get().url(UrlCat.URL_INDEX_BANNER).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 身份认证
|
|
|
+ * @param isParent
|
|
|
+ * @param realName
|
|
|
+ * @param idCardNum
|
|
|
+ */
|
|
|
+ public static void userAuth(String isParent, String realName, String idCardNum, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("isParent", isParent);
|
|
|
+ params.put("realName", realName);
|
|
|
+ params.put("idCardNum", idCardNum);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_AUTH).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改密码
|
|
|
+ * @param mobile
|
|
|
+ * @param pwd
|
|
|
+ * @param rePwd
|
|
|
+ */
|
|
|
+ public static void userFindPwd(String mobile, String pwd, String rePwd, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ params.put("pwd", pwd);
|
|
|
+ params.put("rePwd", rePwd);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_FINDPWD).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户详情
|
|
|
+ */
|
|
|
+ public static void userInfo(Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_INFO).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 手机号,验证码登录
|
|
|
+ * @param mobile
|
|
|
+ * @param code
|
|
|
+ */
|
|
|
+ public static void loginCode(String mobile, String code, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ params.put("code", code);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_LOGIN_CODE).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 三方登录
|
|
|
+ * @param thirdId
|
|
|
+ * @param thirdType
|
|
|
+ */
|
|
|
+ public static void loginThird(String thirdId, String thirdType, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("thirdId", thirdId);
|
|
|
+ params.put("thirdType", thirdType);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_LOGIN_THIRD).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改头像
|
|
|
+ * @param headPic
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
+ public static void userResetHeadpic(String headPic, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_HEADPIC).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改手机号
|
|
|
+ * @param mobile
|
|
|
+ */
|
|
|
+ public static void userResetMobile(String mobile, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_RESET_MOBILE).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改密码
|
|
|
+ */
|
|
|
+ public static void userResetPwd(String oldPwd, String pwd, String rePwd, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("oldPwd", oldPwd);
|
|
|
+ params.put("pwd", pwd);
|
|
|
+ params.put("rePwd", rePwd);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_RESET_PWD).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**修改用户名
|
|
|
+ * @param userName
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
+ public static void userResetUsername(String userName, Callback callback){
|
|
|
+ Map<String, String> params = getSystemParams();
|
|
|
+ params.put("userName", userName);
|
|
|
+ OkHttpUtils.post().url(UrlCat.URL_USER_RESET_USERNAME).params(params).build().execute(callback);
|
|
|
+ }
|
|
|
+}
|