package com.diyidan.game.network; import android.content.Context; import com.alipay.sdk.packet.d; import com.diyidan.game.network.model.ListJsonDataModel; import com.diyidan.game.util.Utils; import java.util.HashMap; public class UserNetwork2 extends BaseNetwork2 { public UserNetwork2(Context context, INetworkHandler iNetworkHandler, int i) { super(context, iNetworkHandler, i); initSuccessListener(ListJsonDataModel.class); initErrorListener(); } public void loginByPhone(String str, String str2) { HashMap map = new HashMap(); map.put("account", str); map.put("password", str2); addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/reallogin", map, this.mSuccessListener, this.mErrorListener); } public void registerByPhone(String str, String str2, String str3, String str4, String str5) { if (Utils.isNullExists(str, str2, str3, str4)) { return; } HashMap map = new HashMap(); map.put("nickName", str); map.put("mobile", str2); map.put("password", str3); map.put("smsCode", str4); if (!Utils.isNull(str5)) { map.put("userSource", str5); } addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/register", map, this.mSuccessListener, this.mErrorListener); } public void visitorUpgrade(String str, String str2, String str3) { if (Utils.isNullExists(str, str2, str3)) { return; } HashMap map = new HashMap(); map.put("mobile", str); map.put("password", str2); map.put("smsCode", str3); addRequestToQueue(2, "https://gameapi.diyidan.net/g0.3/users/register", map, this.mSuccessListener, this.mErrorListener); } public void registerAsVisitor(Context context) { HashMap map = new HashMap(); map.put("deviceId", "" + Utils.getDeviceId(context)); addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/register", map, this.mSuccessListener, this.mErrorListener); } public void logout() { addRequestToQueue(3, "https://gameapi.diyidan.net/g0.3/users/reallogin", null, this.mSuccessListener, this.mErrorListener); } public void loginByDydToken(String str) { if (Utils.isNull(str)) { return; } HashMap map = new HashMap(); map.put("token", str); addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/reallogin", map, this.mSuccessListener, this.mErrorListener); } public void loginByDydPermanentToken(String str) { if (Utils.isNull(str)) { return; } addRequestToQueue(0, "https://gameapi.diyidan.net/g0.3/users/realtoken", null, this.mSuccessListener, this.mErrorListener); } public void verifyToken(String str) { if (Utils.isNull(str)) { return; } addRequestToQueue(0, "https://gameapi.diyidan.net/g0.3/users/realtoken", null, this.mSuccessListener, this.mErrorListener); } public void generateToken(long j) { if (j < 0) { return; } addRequestToQueue(0, "https://gameapi.diyidan.net/g0.3/users/realtoken?duration=" + j, null, this.mSuccessListener, this.mErrorListener); } public void forgetPassword(String str, String str2, String str3) { if (Utils.isNullExists(str, str2, str3)) { return; } HashMap map = new HashMap(); map.put("mobile", str); map.put("newPass", str2); map.put("smsCode", str3); addRequestToQueue(2, "https://gameapi.diyidan.net/g0.3/users/realforgetpass", map, this.mSuccessListener, this.mErrorListener); } public void bindByDydToken(String str) { if (Utils.isNull(str)) { return; } HashMap map = new HashMap(); map.put("token", str); map.put(d.p, "bind_exist_user"); addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/reallogin", map, this.mSuccessListener, this.mErrorListener); } public void bindByPhone(String str, String str2) { HashMap map = new HashMap(); map.put("account", str); map.put("password", str2); map.put(d.p, "bind_exist_user"); addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/reallogin", map, this.mSuccessListener, this.mErrorListener); } public void verifyId(String str, String str2) { HashMap map = new HashMap(); map.put("user_real_name", str); map.put("user_ID_card", str2); addRequestToQueue(1, "https://gameapi.diyidan.net/g0.3/users/real", map, this.mSuccessListener, this.mErrorListener); } }