This commit is contained in:
18401019693 2022-07-29 16:04:12 +08:00
parent 41f07f2e3d
commit 00de2169b9
39 changed files with 531 additions and 385 deletions

View File

@ -167,5 +167,12 @@ dependencies {
api 'com.adjust.sdk:adjust-android:4.30.1' api 'com.adjust.sdk:adjust-android:4.30.1'
api 'com.android.installreferrer:installreferrer:2.2' api 'com.android.installreferrer:installreferrer:2.2'
api 'com.google.firebase:firebase-analytics:15.0.0' api 'com.google.firebase:firebase-analytics:15.0.0'
//Retrofit2库
api 'com.squareup.retrofit2:retrofit:2.3.0'
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
//gson解析
api 'com.squareup.retrofit2:converter-gson:2.3.0'
//rxjava2库
api 'io.reactivex.rxjava2:rxjava:2.0.1'
api 'io.reactivex.rxjava2:rxandroid:2.0.1'
} }

View File

@ -0,0 +1,52 @@
package com.yunbao.common.http;
import android.content.Context;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.internal.bind.DateTypeAdapter;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.http.base.BaseApi;
import java.util.Date;
import okhttp3.OkHttpClient;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* pdLive接口
*/
public class API extends BaseApi {
private PDLiveApi pdLiveApi;
private static API api;
/**
* 获取单利
*
* @return
*/
public static API get() {
if (null == api) {
api = new API();
}
return api;
}
public PDLiveApi pdLiveApi(Context context) {
if (null == pdLiveApi) {
//实例化gson
Gson gson = new GsonBuilder()
.registerTypeAdapter(Date.class, new DateTypeAdapter())
.create();
OkHttpClient.Builder builder = new OkHttpClient()
.newBuilder()
.addInterceptor(new PDLiveInterceptor(context));
pdLiveApi = create(builder.build(),
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
}
return pdLiveApi;
}
}

View File

@ -162,8 +162,6 @@ public class CommonHttpUtil {
Log.i("来了", lang); Log.i("来了", lang);
//或者仅仅使用 locale = Locale.getDefault(); 不需要考虑接口 deprecated(弃用)问题 //或者仅仅使用 locale = Locale.getDefault(); 不需要考虑接口 deprecated(弃用)问题
HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG) HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("langue", lang) .params("langue", lang)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
@ -228,32 +226,6 @@ public class CommonHttpUtil {
setAttention(CommonHttpConsts.SET_ATTENTION, touid, callback); setAttention(CommonHttpConsts.SET_ATTENTION, touid, callback);
} }
// /**
// * 关注别人 取消对别人的关注的接口
// */
// public static void setAttention(String tag, final String touid, final CommonCallback<Integer> callback) {
// if (touid.equals(CommonAppConfig.getInstance().getUid())) {
// ToastUtil.show(WordUtil.getString(R.string.cannot_follow_self));
// return;
// }
// HttpClient.getInstance().get("User.setAttent", tag)
// .params("uid", CommonAppConfig.getInstance().getUid())
// .params("token", CommonAppConfig.getInstance().getToken())
// .params("touid", touid)
// .execute(new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 0 && info.length > 0) {
// int isAttention = JSON.parseObject(info[0]).getIntValue("isattent");//1是 关注 0是未关注
// EventBus.getDefault().post(new FollowEvent(touid, isAttention));
// if (callback != null) {
// callback.callback(isAttention);
// }
// }
// }
// });
// }
/** /**
* 关注别人 取消对别人的关注的接口 * 关注别人 取消对别人的关注的接口
*/ */
@ -263,8 +235,6 @@ public class CommonHttpUtil {
return; return;
} }
HttpClient.getInstance().get("User.setAttents", tag) HttpClient.getInstance().get("User.setAttents", tag)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
@ -291,8 +261,6 @@ public class CommonHttpUtil {
isGoogle = "-1"; isGoogle = "-1";
} }
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE) HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("type", 0) .params("type", 0)
.params("isGooglePay", isGoogle) .params("isGooglePay", isGoogle)
.execute(callback); .execute(callback);
@ -349,8 +317,6 @@ public class CommonHttpUtil {
*/ */
public static void checkTokenInvalid() { public static void checkTokenInvalid() {
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID) HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(NO_CALLBACK); .execute(NO_CALLBACK);
} }
@ -391,8 +357,6 @@ public class CommonHttpUtil {
if ("2".equals(community_type)) { if ("2".equals(community_type)) {
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT) request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT)
.isMultipart(true) .isMultipart(true)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("dynamic_id", dynamic_id) .params("dynamic_id", dynamic_id)
.params("report_type", report_type) .params("report_type", report_type)
.params("content", content) .params("content", content)
@ -401,8 +365,6 @@ public class CommonHttpUtil {
} else { } else {
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT) request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT)
.isMultipart(true) .isMultipart(true)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("dynamic_id", dynamic_id) .params("dynamic_id", dynamic_id)
.params("report_type", report_type) .params("report_type", report_type)
.params("content", content) .params("content", content)
@ -425,7 +387,6 @@ public class CommonHttpUtil {
*/ */
public static void getUserBaseinfo(String touid, HttpCallback callback) { public static void getUserBaseinfo(String touid, HttpCallback callback) {
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO) HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
} }

View File

@ -1,8 +1,10 @@
package com.yunbao.common.http; package com.yunbao.common.http;
import android.app.Dialog; import android.app.Dialog;
import android.util.Log;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.lzy.okgo.callback.AbsCallback; import com.lzy.okgo.callback.AbsCallback;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.base.Request; import com.lzy.okgo.request.base.Request;
@ -33,6 +35,8 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
@Override @Override
public void onSuccess(Response<JsonBean> response) { public void onSuccess(Response<JsonBean> response) {
JsonBean bean = response.body(); JsonBean bean = response.body();
String gson = new Gson().toJson(bean);
Log.e("onSuccess",gson);
if (bean != null) { if (bean != null) {
if (200 == bean.getRet()) { if (200 == bean.getRet()) {
Data data = bean.getData(); Data data = bean.getData();

View File

@ -1,5 +1,7 @@
package com.yunbao.common.http; package com.yunbao.common.http;
import android.content.Context;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheMode; import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.cookie.CookieJarImpl; import com.lzy.okgo.cookie.CookieJarImpl;
@ -8,7 +10,11 @@ import com.lzy.okgo.request.GetRequest;
import com.lzy.okgo.request.PostRequest; import com.lzy.okgo.request.PostRequest;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.manager.IMLoginManager;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
@ -47,17 +53,12 @@ public class HttpClient {
builder.writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS); builder.writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS);
builder.cookieJar(new CookieJarImpl(new MemoryCookieStore())); builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
builder.retryOnConnectionFailure(true); builder.retryOnConnectionFailure(true);
// Dispatcher dispatcher = new Dispatcher();
// dispatcher.setMaxRequests(20000);
// dispatcher.setMaxRequestsPerHost(10000);
// builder.dispatcher(dispatcher);
//输出HTTP请求 响应信息 //输出HTTP请求 响应信息
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("http"); HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("http");
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY); loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
builder.addInterceptor(loggingInterceptor); builder.addInterceptor(loggingInterceptor);
//添加PDLive请求常用信息
mOkHttpClient = builder.build(); mOkHttpClient = builder.build();
OkGo.getInstance().init(CommonAppContext.sInstance) OkGo.getInstance().init(CommonAppContext.sInstance)
.setOkHttpClient(mOkHttpClient) .setOkHttpClient(mOkHttpClient)
.setCacheMode(CacheMode.NO_CACHE) .setCacheMode(CacheMode.NO_CACHE)
@ -66,23 +67,51 @@ public class HttpClient {
} }
public GetRequest<JsonBean> get(String serviceName, String tag) { public GetRequest<JsonBean> get(String serviceName, String tag) {
Context context = CommonAppContext.sInstance.getApplicationContext();
//拼装基本信息
Map<String, String> map = new HashMap<>();
if (IMLoginManager.isLogin(context)) {
IMLoginModel model = IMLoginManager.get(context).getUserInfo();
map.put("uid", String.valueOf(model.getId()));
map.put("token", model.getToken());
}
return OkGo.<JsonBean>get(mUrl + serviceName) return OkGo.<JsonBean>get(mUrl + serviceName)
.headers("Connection","keep-alive") .params(map, true)
.headers("Connection", "keep-alive")
.tag(tag) .tag(tag)
.params(CommonHttpConsts.LANGUAGE, mLanguage); .params(CommonHttpConsts.LANGUAGE, mLanguage);
} }
public GetRequest<JsonBean> get(String url,String serviceName, String tag) { public GetRequest<JsonBean> get(String url, String serviceName, String tag) {
Context context = CommonAppContext.sInstance.getApplicationContext();
//拼装基本信息
Map<String, String> map = new HashMap<>();
if (IMLoginManager.isLogin(context)) {
IMLoginModel model = IMLoginManager.get(context).getUserInfo();
map.put("uid", String.valueOf(model.getId()));
map.put("token", model.getToken());
}
return OkGo.<JsonBean>get(url + serviceName) return OkGo.<JsonBean>get(url + serviceName)
.headers("Connection","keep-alive") .headers("Connection", "keep-alive")
.params(map, true)
.tag(tag) .tag(tag)
.params(CommonHttpConsts.LANGUAGE, mLanguage); .params(CommonHttpConsts.LANGUAGE, mLanguage);
} }
public PostRequest<JsonBean> post(String serviceName, String tag) { public PostRequest<JsonBean> post(String serviceName, String tag) {
Context context = CommonAppContext.sInstance.getApplicationContext();
//拼装基本信息
Map<String, String> map = new HashMap<>();
if (IMLoginManager.isLogin(context)) {
IMLoginModel model = IMLoginManager.get(context).getUserInfo();
map.put("uid", String.valueOf(model.getId()));
map.put("token", model.getToken());
}
return OkGo.<JsonBean>post(mUrl + serviceName) return OkGo.<JsonBean>post(mUrl + serviceName)
.headers("Connection","keep-alive") .headers("Connection", "keep-alive")
.params(map, true)
.tag(tag) .tag(tag)
.params(CommonHttpConsts.LANGUAGE, mLanguage); .params(CommonHttpConsts.LANGUAGE, mLanguage);
} }

View File

@ -0,0 +1,33 @@
package com.yunbao.common.http;
import com.yunbao.common.bean.IMLoginModel;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
/**
* PDLive网络接口访问
*/
public interface PDLiveApi {
/**
* 用户手机号登录
*
* @param userName
* @param passWord
* @param uuidDevice
* @param pushid
* @param lastlogindevice
* @return
*/
@FormUrlEncoded
@POST("/api/public/?service=Login.userLogin")
Observable<ResponseModel<IMLoginModel>> loginByManager(
@Field("user_login") String userName,
@Field("user_pass") String passWord,
@Field("uuid_Device") String uuidDevice,
@Field("pushid") String pushid,
@Field("lastlogindevice") String lastlogindevice
);
}

View File

@ -0,0 +1,41 @@
package com.yunbao.common.http;
import android.content.Context;
import android.util.Log;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.manager.IMLoginManager;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
/**
* PDlLive通用拦截器
*/
public class PDLiveInterceptor implements Interceptor {
private Context context;
PDLiveInterceptor(Context context) {
this.context = context;
}
@Override
public Response intercept(Chain chain) throws IOException {
//拼接请求添加头
Request request = chain.request();
Request.Builder builder = request.newBuilder();
Log.e("TAG", "Request: " + request.toString());
//已登录则添加全局参数
if (IMLoginManager.isLogin(context)) {
IMLoginModel model = IMLoginManager.get(context).getUserInfo();
builder.addHeader("userid", String.valueOf(model.getId()));
builder.addHeader("token", model.getToken());
}
Response response = chain.proceed(builder.build());
Log.e("TAG", "Request: " + response.toString());
return response;
}
}

View File

@ -0,0 +1,39 @@
package com.yunbao.common.http;
import com.google.gson.annotations.SerializedName;
public class ResponseData<T> {
@SerializedName("code")
private int code;
@SerializedName("msg")
private String msg;
@SerializedName("info")
private T info;
public int getCode() {
return code;
}
public ResponseData<T> setCode(int code) {
this.code = code;
return this;
}
public String getMsg() {
return msg;
}
public ResponseData<T> setMsg(String msg) {
this.msg = msg;
return this;
}
public T getInfo() {
return info;
}
public ResponseData<T> setInfo(T info) {
this.info = info;
return this;
}
}

View File

@ -0,0 +1,49 @@
package com.yunbao.common.http;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
/**
* 响应体基础结构(使用info字符串数组数据)
*/
public class ResponseModel<T> {
/**
* ret : 200
* data : {"code":0,"msg":"登录成功","info":{"id":139372,"user_nicename":"新手指导员05","avatar":"https://napi.yaoulive.com/default.jpg","avatar_thumb":"https://napi.yaoulive.com/default_thumb.jpg","sex":1,"signature":"这家伙很懒,什么都没留下","coin":0,"gold":470,"goldsumption":0,"consumption":7200,"votestotal":0,"province":"","city":"","birthday":"","user_status":1,"issuper":0,"location":"","noble_id":0,"goodnum":"","is_guess":null,"langue":"chinese","goodnum_expire_time":null,"avatar2":null,"front_task":1,"level":"5","level_anchor":"1","vip":{"type":"0"},"liang":{"name":"0"},"medal_level":"0","medal_name":"","token":"790b4a59b46e22e68e04ba76c505dbc3","first_login":"0","token_rong":"Qx7tt7henwUJC3NXkwaOsnQeHkqz/DDlzFfBg3prJ6c=@xln2.sg.rongnav.com;xln2.sg.rongcfg.com"}}
* msg :
*/
@SerializedName("ret")
private int ret;
@SerializedName("data")
private ResponseData<T> data;
@SerializedName("msg")
private String msg;
public int getRet() {
return ret;
}
public ResponseModel<T> setRet(int ret) {
this.ret = ret;
return this;
}
public ResponseData<T> getData() {
return data;
}
public ResponseModel<T> setData(ResponseData<T> data) {
this.data = data;
return this;
}
public String getMsg() {
return msg;
}
public ResponseModel<T> setMsg(String msg) {
this.msg = msg;
return this;
}
}

View File

@ -0,0 +1,93 @@
package com.yunbao.common.http.base;
import java.util.HashMap;
import java.util.Map;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import retrofit2.CallAdapter;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
/**
* 网络请求基类
*/
public class BaseApi {
/**
* 创建一个接口方法
*
* @param okHttpClient okhttp客户端
* @param converterFactory 处理工厂类
* @param callAdapterFactory 请求适配器工厂
* @param baseUrl 基础地质
* @param service 接口
* @param <T> 接口泛型
* @return 接口
*/
public <T> T create(OkHttpClient okHttpClient, Converter.Factory converterFactory, CallAdapter.Factory callAdapterFactory, String baseUrl, Class<T> service) {
Retrofit.Builder builder = new Retrofit.Builder()
//基础url
.baseUrl(baseUrl)
//客户端OKHttp
.client(okHttpClient);
//添加转换工厂
if (null != converterFactory) {
builder.addConverterFactory(converterFactory);
}
//添加请求工厂
if (null != callAdapterFactory) {
builder.addCallAdapterFactory(callAdapterFactory);
}
//创建retrofit对象
Retrofit retrofit = builder.build();
//返回创建的api
return retrofit.create(service);
}
public <T> T createApi(Interceptor interceptor, Converter.Factory converterFactory, CallAdapter.Factory callAdapterFactory, String baseUrl, Class<T> service) {
OkHttpClient.Builder builder = new OkHttpClient().newBuilder();
if (null != interceptor) {
builder.addInterceptor(interceptor);
}
return create(builder.build(), converterFactory, callAdapterFactory, baseUrl, service);
}
public <T> T createApi(Map<String, String> headerMap, Converter.Factory converterFactory, CallAdapter.Factory callAdapterFactory, String baseUrl, Class<T> service) {
return createApi(new CommonInterceptor(headerMap), converterFactory, callAdapterFactory, baseUrl, service);
}
public <T> T createApi(Converter.Factory converterFactory, CallAdapter.Factory callAdapterFactory, String baseUrl, Class<T> service) {
return createApi(new HashMap<>(), converterFactory, callAdapterFactory, baseUrl, service);
}
public <T> T createApi(CallAdapter.Factory callAdapterFactory, String baseUrl, Class<T> service) {
return createApi(null, callAdapterFactory, baseUrl, service);
}
public <T> T createApi(String baseUrl, Class<T> service) {
return createApi(null, baseUrl, service);
}
public <T> T createRxApi(Interceptor interceptor, Converter.Factory converterFactory, String baseUrl, Class<T> service) {
OkHttpClient.Builder builder = new OkHttpClient().newBuilder();
if (null != interceptor) {
builder.addInterceptor(interceptor);
}
return create(builder.build(), converterFactory, RxJava2CallAdapterFactory.create(), baseUrl, service);
}
public <T> T createRxApi(Map<String, String> headerMap, Converter.Factory converterFactory, String baseUrl, Class<T> service) {
return createRxApi(new CommonInterceptor(headerMap), converterFactory, baseUrl, service);
}
public <T> T createRxApi(Converter.Factory converterFactory, String baseUrl, Class<T> service) {
return createRxApi(new HashMap<>(), converterFactory, baseUrl, service);
}
public <T> T createRxApi(String baseUrl, Class<T> service) {
return createRxApi(null, baseUrl, service);
}
}

View File

@ -0,0 +1,35 @@
package com.yunbao.common.http.base;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import okhttp3.Interceptor;
import okhttp3.Request;
/**
* 通用性拦截器
*/
public class CommonInterceptor implements Interceptor {
private Map<String, String> headerMap;
public CommonInterceptor(Map<String, String> headerMap) {
this.headerMap = headerMap;
}
@Override
public okhttp3.Response intercept(Chain chain) throws IOException {
//拼接请求添加头
Request.Builder builder = chain.request()
.newBuilder();
if (null != headerMap) {
Iterator<String> iterator = headerMap.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
String value = headerMap.get(key);
builder.addHeader(key, value);
}
}
return chain.proceed(builder.build());
}
}

View File

@ -0,0 +1,20 @@
package com.yunbao.common.http.main;
/**
* maim的请求回调接口
*/
public interface HttpCallback<T> {
/**
* 请求成功
*
* @param data
*/
void onSuccess(T data);
/**
* 请求失败
*
* @param error
*/
void onError(String error);
}

View File

@ -0,0 +1,64 @@
package com.yunbao.common.http.main;
import android.app.Activity;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.http.API;
import com.yunbao.common.http.ResponseModel;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
* main库的网络请求管理
*/
public class MainNetManager {
private Activity mContext;
private static MainNetManager manager;
public MainNetManager(Activity context) {
this.mContext = context;
}
/**
* 获取单利
*
* @return
*/
public static MainNetManager get(Activity context) {
if (null == manager) {
manager = new MainNetManager(context);
}
return manager;
}
/**
* 手机号登录
*
* @param phoneNum 手机号码
* @param pwd 密码
* @param uuid 设备码
* @param callback 网络请求回调
*/
public void login(String phoneNum, String pwd, String uuid, HttpCallback<IMLoginModel> callback) {
API.get().pdLiveApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "Android")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
@Override
public void accept(ResponseModel<IMLoginModel> imLoginModelResponseModel) throws Exception {
if (callback != null) {
IMLoginModel model = imLoginModelResponseModel.getData().getInfo();
callback.onSuccess(model);
}
}
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
}
}

View File

@ -125,8 +125,8 @@ public class IMLoginManager extends BaseCacheManager {
@Override @Override
public void run() { public void run() {
HttpClient.getInstance().get("User.isInstructor", "isInstructor") HttpClient.getInstance().get("User.isInstructor", "isInstructor")
.params("uid", userInfo.getId()) .params("uid", userInfo.getId(),true)
.params("token", userInfo.getToken()) .params("token", userInfo.getToken(),true)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -103,8 +103,8 @@ public class InstructorRemarkManager extends BaseCacheManager {
public void run() { public void run() {
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo(); IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark") HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark")
.params("uid", userInfo.getId()) .params("uid", userInfo.getId(),true)
.params("token", userInfo.getToken()) .params("token", userInfo.getToken(),true)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -112,7 +112,7 @@ public class NoviceInstructorManager extends BaseCacheManager {
if (TextUtils.equals(userModel.getIsAdmin(), "1")) { if (TextUtils.equals(userModel.getIsAdmin(), "1")) {
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo(); IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg") HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg")
.params("uid", userInfo.getId()) .params("uid", userInfo.getId(),true)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -59,6 +59,7 @@
android:id="@+id/quote_linear" android:id="@+id/quote_linear"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:visibility="gone"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center_horizontal" android:gravity="center_horizontal"

View File

@ -9,9 +9,9 @@ ext {
] ]
manifestPlaceholders = [ manifestPlaceholders = [
// //
// serverHost : "https://napi.yaoulive.com", serverHost : "https://napi.yaoulive.com",
// //
serverHost : "https://ceshi.yaoulive.com", // serverHost : "https://ceshi.yaoulive.com",
// //
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -306,9 +306,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back)); sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
} }
HttpClient.getInstance().get("Live.isLeave", "Live.isLeave") HttpClient.getInstance().get("Live.isLeave", "Live.isLeave")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("isleave", leave) .params("isleave", leave)
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new Callback<JsonBean>() { .execute(new Callback<JsonBean>() {
@Override @Override
public void onStart(Request<JsonBean, ? extends Request> request) { public void onStart(Request<JsonBean, ? extends Request> request) {

View File

@ -920,7 +920,6 @@ public class LiveAudienceActivity extends LiveActivity {
//退出多人房间 //退出多人房间
HttpClient.getInstance().get("live.leaveDrLm", "live.leaveDrLm") HttpClient.getInstance().get("live.leaveDrLm", "live.leaveDrLm")
.params("roomid", LiveActivity.mLiveUid) .params("roomid", LiveActivity.mLiveUid)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -247,7 +247,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
case Constants.LIVE_FUNC_DR://多人PK case Constants.LIVE_FUNC_DR://多人PK
if(isDRPK != 1) { if(isDRPK != 1) {
HttpClient.getInstance().get("live.getdrnum", "live.getdrnum") HttpClient.getInstance().get("live.getdrnum", "live.getdrnum")
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -261,7 +260,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
@Override @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
HttpClient.getInstance().get("live.createDRPKroom", "live.createDRPKroom") HttpClient.getInstance().get("live.createDRPKroom", "live.createDRPKroom")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("type", "1") .params("type", "1")
.params("sign", "1") .params("sign", "1")
.execute(new HttpCallback() { .execute(new HttpCallback() {

View File

@ -1,6 +1,5 @@
package com.yunbao.live.activity; package com.yunbao.live.activity;
import android.app.Activity;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
@ -20,7 +19,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
@ -59,7 +57,6 @@ public class PDLIiveChatActivity extends FragmentActivity {
} }
public void windowColor() { public void windowColor() {
Window window = getWindow(); Window window = getWindow();

View File

@ -2,6 +2,7 @@ package com.yunbao.live.dialog;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Handler;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -11,11 +12,12 @@ import android.widget.LinearLayout;
import android.widget.PopupWindow; import android.widget.PopupWindow;
import android.widget.TextView; import android.widget.TextView;
import com.yunbao.common.Constants; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.EditNameRemarksActivity; import com.yunbao.live.activity.EditNameRemarksActivity;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
/** /**
@ -28,6 +30,7 @@ public class MenuPopuwWindow implements View.OnClickListener {
private TextView tvBlack, tvBlackMove; private TextView tvBlack, tvBlackMove;
private LinearLayout ltRemarks; private LinearLayout ltRemarks;
private PopupWindow popupWindow; private PopupWindow popupWindow;
private Handler netHandler = new Handler();
public MenuPopuwWindow(Activity context) { public MenuPopuwWindow(Activity context) {
this.mContext = context; this.mContext = context;
@ -110,6 +113,7 @@ public class MenuPopuwWindow implements View.OnClickListener {
popupWindow.dismiss(); popupWindow.dismiss();
tvBlack.setVisibility(View.VISIBLE); tvBlack.setVisibility(View.VISIBLE);
tvBlackMove.setVisibility(View.GONE); tvBlackMove.setVisibility(View.GONE);
netHandler.post(setBlackRunnable);
} }
@Override @Override
@ -126,6 +130,7 @@ public class MenuPopuwWindow implements View.OnClickListener {
popupWindow.dismiss(); popupWindow.dismiss();
tvBlackMove.setVisibility(View.VISIBLE); tvBlackMove.setVisibility(View.VISIBLE);
tvBlack.setVisibility(View.GONE); tvBlack.setVisibility(View.GONE);
netHandler.post(setBlackRunnable);
} }
@Override @Override
@ -141,4 +146,14 @@ public class MenuPopuwWindow implements View.OnClickListener {
popupWindow.dismiss(); popupWindow.dismiss();
} }
} }
//将对方拉黑或者解除拉黑(自己后台
private Runnable setBlackRunnable = new Runnable() {
@Override
public void run() {
HttpClient.getInstance().get("User.setBlack", "setBlack")
.params("touid", userId);
}
};
} }

View File

@ -22,8 +22,6 @@ public class ImHttpUtil {
*/ */
public static void getImUserInfo(String uids, HttpCallback callback) { public static void getImUserInfo(String uids, HttpCallback callback) {
HttpClient.getInstance().get("Message.getLists", ImHttpConsts.GET_IM_USER_INFO) HttpClient.getInstance().get("Message.getLists", ImHttpConsts.GET_IM_USER_INFO)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -32,8 +30,6 @@ public class ImHttpUtil {
*/ */
public static void sendDynamicComment(String dynamic_id, String content, String to_comment_id, HttpCallback callback) { public static void sendDynamicComment(String dynamic_id, String content, String to_comment_id, HttpCallback callback) {
HttpClient.getInstance().get("Community.sendDynamicComment", ImHttpConsts.SEND_DYNAMICCOMMENT) HttpClient.getInstance().get("Community.sendDynamicComment", ImHttpConsts.SEND_DYNAMICCOMMENT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("dynamic_id", dynamic_id) .params("dynamic_id", dynamic_id)
.params("content", content) .params("content", content)
.params("to_comment_id", to_comment_id) .params("to_comment_id", to_comment_id)
@ -45,8 +41,6 @@ public class ImHttpUtil {
*/ */
public static void getSystemMessageList(String type, int p, HttpCallback callback) { public static void getSystemMessageList(String type, int p, HttpCallback callback) {
HttpClient.getInstance().get("Message.getListInfo", ImHttpConsts.GET_SYSTEM_MESSAGE_LIST) HttpClient.getInstance().get("Message.getListInfo", ImHttpConsts.GET_SYSTEM_MESSAGE_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.params("type", type) .params("type", type)
.execute(callback); .execute(callback);
@ -57,8 +51,6 @@ public class ImHttpUtil {
*/ */
public static void getCommunityList(int p, HttpCallback callback) { public static void getCommunityList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Community.guessYouLike", ImHttpConsts.GET_COMMUNITYLIST_LIST) HttpClient.getInstance().get("Community.guessYouLike", ImHttpConsts.GET_COMMUNITYLIST_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -69,8 +61,6 @@ public class ImHttpUtil {
*/ */
public static void checkBlack(String touid, HttpCallback callback) { public static void checkBlack(String touid, HttpCallback callback) {
HttpClient.getInstance().get("User.checkBlack", ImHttpConsts.CHECK_BLACK) HttpClient.getInstance().get("User.checkBlack", ImHttpConsts.CHECK_BLACK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
} }
@ -80,8 +70,6 @@ public class ImHttpUtil {
*/ */
public static void setBlack(String touid, HttpCallback callback) { public static void setBlack(String touid, HttpCallback callback) {
HttpClient.getInstance().get("User.setBlack", ImHttpConsts.SET_BLACK) HttpClient.getInstance().get("User.setBlack", ImHttpConsts.SET_BLACK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
} }

View File

@ -4,11 +4,13 @@ import android.text.TextUtils;
import com.lzy.okgo.request.PostRequest; import com.lzy.okgo.request.PostRequest;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.JsonBean; import com.yunbao.common.http.JsonBean;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.MD5Util;
@ -47,7 +49,7 @@ public class LiveHttpUtil {
*/ */
public static void getMicList(String liveuid, int p, HttpCallback callback) { public static void getMicList(String liveuid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Live.getDrLm", "Live.getDrLm") HttpClient.getInstance().get("Live.getDrLm", "Live.getDrLm")
.params("uid", liveuid) .params("uid", liveuid, true)
.execute(callback); .execute(callback);
} }
@ -56,8 +58,6 @@ public class LiveHttpUtil {
*/ */
public static void getHDList(HttpCallback callback) { public static void getHDList(HttpCallback callback) {
HttpClient.getInstance().get("Active.getActiveList", "Active.getActiveList") HttpClient.getInstance().get("Active.getActiveList", "Active.getActiveList")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -69,8 +69,6 @@ public class LiveHttpUtil {
*/ */
public static void roomCharge(String liveUid, String stream, HttpCallback callback) { public static void roomCharge(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.roomCharge", LiveHttpConsts.ROOM_CHARGE) HttpClient.getInstance().get("Live.roomCharge", LiveHttpConsts.ROOM_CHARGE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("liveuid", liveUid) .params("liveuid", liveUid)
.execute(callback); .execute(callback);
@ -85,8 +83,6 @@ public class LiveHttpUtil {
*/ */
public static void timeCharge(String liveUid, String stream, HttpCallback callback) { public static void timeCharge(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.timeCharge", LiveHttpConsts.TIME_CHARGE) HttpClient.getInstance().get("Live.timeCharge", LiveHttpConsts.TIME_CHARGE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("liveuid", liveUid) .params("liveuid", liveUid)
.execute(callback); .execute(callback);
@ -98,8 +94,6 @@ public class LiveHttpUtil {
*/ */
public static void getCoin(HttpCallback callback) { public static void getCoin(HttpCallback callback) {
HttpClient.getInstance().get("Live.getCoin", LiveHttpConsts.GET_COIN) HttpClient.getInstance().get("Live.getCoin", LiveHttpConsts.GET_COIN)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -110,7 +104,6 @@ public class LiveHttpUtil {
*/ */
public static void getLiveRecord(String touid, int p, HttpCallback callback) { public static void getLiveRecord(String touid, int p, HttpCallback callback) {
HttpClient.getInstance().get("User.getLiverecord", LiveHttpConsts.GET_LIVE_RECORD) HttpClient.getInstance().get("User.getLiverecord", LiveHttpConsts.GET_LIVE_RECORD)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -133,7 +126,6 @@ public class LiveHttpUtil {
*/ */
public static void getAllImpress(String touid, HttpCallback callback) { public static void getAllImpress(String touid, HttpCallback callback) {
HttpClient.getInstance().get("User.getUserLabel", LiveHttpConsts.GET_ALL_IMPRESS) HttpClient.getInstance().get("User.getUserLabel", LiveHttpConsts.GET_ALL_IMPRESS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
} }
@ -143,8 +135,6 @@ public class LiveHttpUtil {
*/ */
public static void setImpress(String touid, String ImpressIDs, HttpCallback callback) { public static void setImpress(String touid, String ImpressIDs, HttpCallback callback) {
HttpClient.getInstance().get("User.setUserLabel", LiveHttpConsts.SET_IMPRESS) HttpClient.getInstance().get("User.setUserLabel", LiveHttpConsts.SET_IMPRESS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.params("labels", ImpressIDs) .params("labels", ImpressIDs)
.execute(callback); .execute(callback);
@ -156,8 +146,6 @@ public class LiveHttpUtil {
*/ */
public static void getAdminList(String liveUid, HttpCallback callback) { public static void getAdminList(String liveUid, HttpCallback callback) {
HttpClient.getInstance().get("Live.getAdminList", LiveHttpConsts.GET_ADMIN_LIST) HttpClient.getInstance().get("Live.getAdminList", LiveHttpConsts.GET_ADMIN_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.execute(callback); .execute(callback);
} }
@ -167,8 +155,6 @@ public class LiveHttpUtil {
*/ */
public static void setAdmin(String liveUid, String touid, HttpCallback callback) { public static void setAdmin(String liveUid, String touid, HttpCallback callback) {
HttpClient.getInstance().get("Live.setAdmin", LiveHttpConsts.SET_ADMIN) HttpClient.getInstance().get("Live.setAdmin", LiveHttpConsts.SET_ADMIN)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
@ -179,8 +165,6 @@ public class LiveHttpUtil {
*/ */
public static void getLiveShutUpList(String liveUid, int p, HttpCallback callback) { public static void getLiveShutUpList(String liveUid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Livemanage.getShutList", LiveHttpConsts.GET_LIVE_SHUT_UP_LIST) HttpClient.getInstance().get("Livemanage.getShutList", LiveHttpConsts.GET_LIVE_SHUT_UP_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -191,8 +175,6 @@ public class LiveHttpUtil {
*/ */
public static void liveCancelShutUp(String liveUid, String toUid, HttpCallback callback) { public static void liveCancelShutUp(String liveUid, String toUid, HttpCallback callback) {
HttpClient.getInstance().get("Livemanage.cancelShut", LiveHttpConsts.LIVE_CANCEL_SHUT_UP) HttpClient.getInstance().get("Livemanage.cancelShut", LiveHttpConsts.LIVE_CANCEL_SHUT_UP)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("touid", toUid) .params("touid", toUid)
.execute(callback); .execute(callback);
@ -203,8 +185,6 @@ public class LiveHttpUtil {
*/ */
public static void getLiveBlackList(String liveUid, int p, HttpCallback callback) { public static void getLiveBlackList(String liveUid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Livemanage.getKickList", LiveHttpConsts.GET_LIVE_BLACK_LIST) HttpClient.getInstance().get("Livemanage.getKickList", LiveHttpConsts.GET_LIVE_BLACK_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -215,8 +195,6 @@ public class LiveHttpUtil {
*/ */
public static void liveCancelBlack(String liveUid, String toUid, HttpCallback callback) { public static void liveCancelBlack(String liveUid, String toUid, HttpCallback callback) {
HttpClient.getInstance().get("Livemanage.cancelKick", LiveHttpConsts.LIVE_CANCEL_BLACK) HttpClient.getInstance().get("Livemanage.cancelKick", LiveHttpConsts.LIVE_CANCEL_BLACK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("touid", toUid) .params("touid", toUid)
.execute(callback); .execute(callback);
@ -245,8 +223,6 @@ public class LiveHttpUtil {
*/ */
public static void setReport(String touid, String content, HttpCallback callback) { public static void setReport(String touid, String content, HttpCallback callback) {
HttpClient.getInstance().get("Live.setReport", LiveHttpConsts.SET_REPORT) HttpClient.getInstance().get("Live.setReport", LiveHttpConsts.SET_REPORT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.params("content", content) .params("content", content)
.execute(callback); .execute(callback);
@ -258,8 +234,6 @@ public class LiveHttpUtil {
public static void setReport(String touid, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) { public static void setReport(String touid, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.setReport", LiveHttpConsts.SET_REPORT) PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.setReport", LiveHttpConsts.SET_REPORT)
.isMultipart(true) .isMultipart(true)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.params("content", content); .params("content", content);
if (file1 != null) { if (file1 != null) {
@ -282,7 +256,6 @@ public class LiveHttpUtil {
*/ */
public static void getLiveUser(String touid, String liveUid, HttpCallback callback) { public static void getLiveUser(String touid, String liveUid, HttpCallback callback) {
HttpClient.getInstance().get("Live.getPop", LiveHttpConsts.GET_LIVE_USER) HttpClient.getInstance().get("Live.getPop", LiveHttpConsts.GET_LIVE_USER)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.params("liveuid", liveUid) .params("liveuid", liveUid)
.execute(callback); .execute(callback);
@ -293,8 +266,6 @@ public class LiveHttpUtil {
*/ */
public static void kicking(String liveUid, String touid, HttpCallback callback) { public static void kicking(String liveUid, String touid, HttpCallback callback) {
HttpClient.getInstance().get("Live.kicking", LiveHttpConsts.KICKING) HttpClient.getInstance().get("Live.kicking", LiveHttpConsts.KICKING)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
@ -306,8 +277,6 @@ public class LiveHttpUtil {
*/ */
public static void setShutUp(String liveUid, String stream, int type, String touid, HttpCallback callback) { public static void setShutUp(String liveUid, String stream, int type, String touid, HttpCallback callback) {
HttpClient.getInstance().get("Live.setShutUp", LiveHttpConsts.SET_SHUT_UP) HttpClient.getInstance().get("Live.setShutUp", LiveHttpConsts.SET_SHUT_UP)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.params("type", type) .params("type", type)
@ -323,8 +292,6 @@ public class LiveHttpUtil {
*/ */
public static void superCloseRoom(String liveUid, int type, HttpCallback callback) { public static void superCloseRoom(String liveUid, int type, HttpCallback callback) {
HttpClient.getInstance().get("Live.superStopRoom", LiveHttpConsts.SUPER_CLOSE_ROOM) HttpClient.getInstance().get("Live.superStopRoom", LiveHttpConsts.SUPER_CLOSE_ROOM)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("type", type) .params("type", type)
.execute(callback); .execute(callback);
@ -336,8 +303,6 @@ public class LiveHttpUtil {
*/ */
public static void getGuardBuyList(HttpCallback callback) { public static void getGuardBuyList(HttpCallback callback) {
HttpClient.getInstance().get("Guard.getList", LiveHttpConsts.GET_GUARD_BUY_LIST) HttpClient.getInstance().get("Guard.getList", LiveHttpConsts.GET_GUARD_BUY_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -346,8 +311,6 @@ public class LiveHttpUtil {
*/ */
public static void buyGuard(String liveUid, String stream, int guardId, HttpCallback callback) { public static void buyGuard(String liveUid, String stream, int guardId, HttpCallback callback) {
HttpClient.getInstance().get("Guard.buyGuard", LiveHttpConsts.BUY_GUARD) HttpClient.getInstance().get("Guard.buyGuard", LiveHttpConsts.BUY_GUARD)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.params("guardid", guardId) .params("guardid", guardId)
@ -360,8 +323,6 @@ public class LiveHttpUtil {
*/ */
public static void getGuardList(String liveUid, int p, HttpCallback callback) { public static void getGuardList(String liveUid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Guard.getGuardList", LiveHttpConsts.GET_GUARD_LIST) HttpClient.getInstance().get("Guard.getGuardList", LiveHttpConsts.GET_GUARD_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -373,7 +334,6 @@ public class LiveHttpUtil {
*/ */
public static void getLinkMicStream(HttpCallback callback) { public static void getLinkMicStream(HttpCallback callback) {
HttpClient.getInstance().get("Linkmic.requestLVBAddrForLinkMic", LiveHttpConsts.GET_LINK_MIC_STREAM) HttpClient.getInstance().get("Linkmic.requestLVBAddrForLinkMic", LiveHttpConsts.GET_LINK_MIC_STREAM)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
@ -385,8 +345,6 @@ public class LiveHttpUtil {
*/ */
public static void linkMicShowVideo(String touid, String pull_url) { public static void linkMicShowVideo(String touid, String pull_url) {
HttpClient.getInstance().get("Live.showVideo", LiveHttpConsts.LINK_MIC_SHOW_VIDEO) HttpClient.getInstance().get("Live.showVideo", LiveHttpConsts.LINK_MIC_SHOW_VIDEO)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", CommonAppConfig.getInstance().getUid()) .params("liveuid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.params("pull_url", pull_url) .params("pull_url", pull_url)
@ -403,8 +361,6 @@ public class LiveHttpUtil {
*/ */
public static void setLinkMicEnable(boolean linkMicEnable, HttpCallback callback) { public static void setLinkMicEnable(boolean linkMicEnable, HttpCallback callback) {
HttpClient.getInstance().get("Linkmic.setMic", LiveHttpConsts.SET_LINK_MIC_ENABLE) HttpClient.getInstance().get("Linkmic.setMic", LiveHttpConsts.SET_LINK_MIC_ENABLE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("ismic", linkMicEnable ? 1 : 0) .params("ismic", linkMicEnable ? 1 : 0)
.execute(callback); .execute(callback);
} }
@ -415,7 +371,6 @@ public class LiveHttpUtil {
*/ */
public static void checkLinkMicEnable(String liveUid, HttpCallback callback) { public static void checkLinkMicEnable(String liveUid, HttpCallback callback) {
HttpClient.getInstance().get("Linkmic.isMic", LiveHttpConsts.CHECK_LINK_MIC_ENABLE) HttpClient.getInstance().get("Linkmic.isMic", LiveHttpConsts.CHECK_LINK_MIC_ENABLE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.execute(callback); .execute(callback);
} }
@ -425,7 +380,7 @@ public class LiveHttpUtil {
*/ */
public static void livePkCheckLive(String liveUid, String stream, String uidStream, HttpCallback callback) { public static void livePkCheckLive(String liveUid, String stream, String uidStream, HttpCallback callback) {
HttpClient.getInstance().get("Home.getisPk", "Home.getisPk") HttpClient.getInstance().get("Home.getisPk", "Home.getisPk")
.params("uid", liveUid) .params("uid", liveUid, true)
// .params("token", CommonAppConfig.getInstance().getToken()) // .params("token", CommonAppConfig.getInstance().getToken())
// .params("liveuid", liveUid) // .params("liveuid", liveUid)
// .params("stream", stream) // .params("stream", stream)
@ -438,8 +393,6 @@ public class LiveHttpUtil {
*/ */
public static void sendRedPack(String stream, String coin, String count, String title, int type, int sendType, HttpCallback callback) { public static void sendRedPack(String stream, String coin, String count, String title, int type, int sendType, HttpCallback callback) {
HttpClient.getInstance().get("Red.SendRed", LiveHttpConsts.SEND_RED_PACK) HttpClient.getInstance().get("Red.SendRed", LiveHttpConsts.SEND_RED_PACK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("coin", coin) .params("coin", coin)
.params("nums", count) .params("nums", count)
@ -455,8 +408,6 @@ public class LiveHttpUtil {
public static void getRedPackList(String stream, HttpCallback callback) { public static void getRedPackList(String stream, HttpCallback callback) {
String sign = MD5Util.getMD5("stream=" + stream + "&" + SALT); String sign = MD5Util.getMD5("stream=" + stream + "&" + SALT);
HttpClient.getInstance().get("Red.GetRedList", LiveHttpConsts.GET_RED_PACK_LIST) HttpClient.getInstance().get("Red.GetRedList", LiveHttpConsts.GET_RED_PACK_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("sign", sign) .params("sign", sign)
.execute(callback); .execute(callback);
@ -466,11 +417,10 @@ public class LiveHttpUtil {
* 直播间抢红包 * 直播间抢红包
*/ */
public static void robRedPack(String stream, int redPackId, HttpCallback callback) { public static void robRedPack(String stream, int redPackId, HttpCallback callback) {
String uid = CommonAppConfig.getInstance().getUid(); String uid = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo().getId() + "";
String sign = MD5Util.getMD5("redid=" + redPackId + "&stream=" + stream + "&uid=" + uid + "&" + SALT); String sign = MD5Util.getMD5("redid=" + redPackId + "&stream=" + stream + "&uid=" + uid + "&" + SALT);
HttpClient.getInstance().get("Red.RobRed", LiveHttpConsts.ROB_RED_PACK) HttpClient.getInstance().get("Red.RobRed", LiveHttpConsts.ROB_RED_PACK)
.params("uid", uid) .params("uid", uid,true)
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("redid", redPackId) .params("redid", redPackId)
.params("sign", sign) .params("sign", sign)
@ -482,11 +432,8 @@ public class LiveHttpUtil {
* 直播间红包领取详情 * 直播间红包领取详情
*/ */
public static void getRedPackResult(String stream, int redPackId, HttpCallback callback) { public static void getRedPackResult(String stream, int redPackId, HttpCallback callback) {
String uid = CommonAppConfig.getInstance().getUid();
String sign = MD5Util.getMD5("redid=" + redPackId + "&stream=" + stream + "&" + SALT); String sign = MD5Util.getMD5("redid=" + redPackId + "&stream=" + stream + "&" + SALT);
HttpClient.getInstance().get("Red.GetRedRobList", LiveHttpConsts.GET_RED_PACK_RESULT) HttpClient.getInstance().get("Red.GetRedRobList", LiveHttpConsts.GET_RED_PACK_RESULT)
.params("uid", uid)
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("redid", redPackId) .params("redid", redPackId)
.params("sign", sign) .params("sign", sign)
@ -498,8 +445,6 @@ public class LiveHttpUtil {
*/ */
public static void sendDanmu(String content, String liveUid, String stream, HttpCallback callback) { public static void sendDanmu(String content, String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.sendBarrage", LiveHttpConsts.SEND_DANMU) HttpClient.getInstance().get("Live.sendBarrage", LiveHttpConsts.SEND_DANMU)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.params("giftid", "1") .params("giftid", "1")
@ -516,8 +461,6 @@ public class LiveHttpUtil {
*/ */
public static void checkLive(String liveUid, String stream, HttpCallback callback) { public static void checkLive(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.checkLive", LiveHttpConsts.CHECK_LIVE) HttpClient.getInstance().get("Live.checkLive", LiveHttpConsts.CHECK_LIVE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.execute(callback); .execute(callback);
@ -529,8 +472,6 @@ public class LiveHttpUtil {
*/ */
public static void enterRoom(String liveUid, String stream, HttpCallback callback) { public static void enterRoom(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.enterRoom", LiveHttpConsts.ENTER_ROOM) HttpClient.getInstance().get("Live.enterRoom", LiveHttpConsts.ENTER_ROOM)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("city", CommonAppConfig.getInstance().getCity()) .params("city", CommonAppConfig.getInstance().getCity())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
@ -542,7 +483,6 @@ public class LiveHttpUtil {
*/ */
public static void enterBackRoom(String liveUid, String stream, HttpCallback callback) { public static void enterBackRoom(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Tx.userjoinroom", "Tx.userjoinroom") HttpClient.getInstance().get("Tx.userjoinroom", "Tx.userjoinroom")
.params("token", CommonAppConfig.getInstance().getToken())
.params("GroupId", "g" + liveUid) .params("GroupId", "g" + liveUid)
.params("stream", stream) .params("stream", stream)
.execute(callback); .execute(callback);
@ -553,7 +493,6 @@ public class LiveHttpUtil {
*/ */
public static void qBackRoom(String liveUid, String stream, HttpCallback callback) { public static void qBackRoom(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Tx.leave_room", "Tx.leave_room") HttpClient.getInstance().get("Tx.leave_room", "Tx.leave_room")
.params("token", CommonAppConfig.getInstance().getToken())
.params("GroupId", "g" + liveUid) .params("GroupId", "g" + liveUid)
.params("stream", stream) .params("stream", stream)
.execute(callback); .execute(callback);
@ -564,8 +503,6 @@ public class LiveHttpUtil {
*/ */
public static void getGiftList(HttpCallback callback) { public static void getGiftList(HttpCallback callback) {
HttpClient.getInstance().get("Live.getGiftList", LiveHttpConsts.GET_GIFT_LIST) HttpClient.getInstance().get("Live.getGiftList", LiveHttpConsts.GET_GIFT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -574,8 +511,6 @@ public class LiveHttpUtil {
*/ */
public static void getNewGiftList(HttpCallback callback) { public static void getNewGiftList(HttpCallback callback) {
HttpClient.getInstance().get("Live.getGiftListApp", LiveHttpConsts.GET_GIFT_LIST) HttpClient.getInstance().get("Live.getGiftListApp", LiveHttpConsts.GET_GIFT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -584,8 +519,6 @@ public class LiveHttpUtil {
*/ */
public static void getWrapList(HttpCallback callback) { public static void getWrapList(HttpCallback callback) {
HttpClient.getInstance().get("Live.getPackList", LiveHttpConsts.GET_WRAP_LIST) HttpClient.getInstance().get("Live.getPackList", LiveHttpConsts.GET_WRAP_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -594,8 +527,6 @@ public class LiveHttpUtil {
*/ */
public static void getWishList(HttpCallback callback) { public static void getWishList(HttpCallback callback) {
HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST) HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -604,40 +535,37 @@ public class LiveHttpUtil {
*/ */
public static void getWishList(String liveId, HttpCallback callback) { public static void getWishList(String liveId, HttpCallback callback) {
HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST) HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST)
.params("token", CommonAppConfig.getInstance().getToken()) .params("uid", liveId, true)
.params("uid", liveId)
.execute(callback); .execute(callback);
} }
/** /**
* 獲取新手任務 * 獲取新手任務
*
* @param callback * @param callback
*/ */
public static void getFrontTask(HttpCallback callback) { public static void getFrontTask(HttpCallback callback) {
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask") HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
.params("token", CommonAppConfig.getInstance().getToken())
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
/** /**
* 獲取新手任務 * 獲取新手任務
*
* @param callback * @param callback
*/ */
public static void getFrontTask(String Token,String uid,HttpCallback callback) { public static void getFrontTask(String Token, String uid, HttpCallback callback) {
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask") HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
.params("token", Token) .params("token", Token, true)
.params("uid", uid) .params("uid", uid, true)
.execute(callback); .execute(callback);
} }
/** /**
* 完成新手任務 * 完成新手任務
*/ */
public static void setFrontTask(String type , HttpCallback callback) { public static void setFrontTask(String type, HttpCallback callback) {
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask") HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
.params("token", CommonAppConfig.getInstance().getToken())
.params("uid", CommonAppConfig.getInstance().getUid())
.params("type", type) .params("type", type)
.execute(callback); .execute(callback);
} }
@ -645,21 +573,18 @@ public class LiveHttpUtil {
/** /**
* 完成新手任務 * 完成新手任務
*/ */
public static void setFrontTask(String type ,String liveuid , HttpCallback callback) { public static void setFrontTask(String type, String liveuid, HttpCallback callback) {
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask") HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
.params("token", CommonAppConfig.getInstance().getToken())
.params("uid", CommonAppConfig.getInstance().getUid())
.params("type", type) .params("type", type)
.params("liveuid", liveuid) .params("liveuid", liveuid)
.execute(callback); .execute(callback);
} }
/** /**
* 修改心愿单列表 * 修改心愿单列表
*/ */
public static void modifyWishList(String list, HttpCallback callback) { public static void modifyWishList(String list, HttpCallback callback) {
HttpClient.getInstance().get("Guide.setWishlist", LiveHttpConsts.SET_WISH_LIST) HttpClient.getInstance().get("Guide.setWishlist", LiveHttpConsts.SET_WISH_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("list", list) .params("list", list)
.execute(callback); .execute(callback);
} }
@ -669,8 +594,6 @@ public class LiveHttpUtil {
*/ */
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, HttpCallback callback) { public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, HttpCallback callback) {
HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT) HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.params("giftid", giftId) .params("giftid", giftId)
@ -697,8 +620,6 @@ public class LiveHttpUtil {
public static void sendZAN(String liveUid, HttpCallback callback) { public static void sendZAN(String liveUid, HttpCallback callback) {
HttpClient.getInstance().get("Fans.doubleClickLight", "Fans.DoubleClickLight") HttpClient.getInstance().get("Fans.doubleClickLight", "Fans.DoubleClickLight")
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -707,7 +628,6 @@ public class LiveHttpUtil {
*/ */
public static void livePkSearchAnchor(String key, int p, HttpCallback callback) { public static void livePkSearchAnchor(String key, int p, HttpCallback callback) {
HttpClient.getInstance().get("Livepk.search", LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR) HttpClient.getInstance().get("Livepk.search", LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("key", key) .params("key", key)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -719,8 +639,6 @@ public class LiveHttpUtil {
*/ */
public static void getLivePkList(int p, HttpCallback callback) { public static void getLivePkList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Livepk.getLiveList", LiveHttpConsts.GET_LIVE_PK_LIST) HttpClient.getInstance().get("Livepk.getLiveList", LiveHttpConsts.GET_LIVE_PK_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -746,44 +664,6 @@ public class LiveHttpUtil {
.execute(callback); .execute(callback);
} }
/**
* 主播开播
*
* @param title 直播标题
* @param type 直播类型 普通 密码 收费等
* @param typeVal 密码 价格等
* @param file 封面图片文件
* @param callback
*/
public static void createRoom(String title, int liveClassId, int type, int typeVal, File file, boolean openLocation, HttpCallback callback) {
// CommonAppConfig appConfig = CommonAppConfig.getInstance();
// UserBean u = appConfig.getUserBean();
// if (u == null) {
// return;
// }
// PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom", LiveHttpConsts.CREATE_ROOM)
// .params("uid", appConfig.getUid())
// .params("token", appConfig.getToken())
// .params("user_nicename", u.getUserNiceName())
// .params("avatar", u.getAvatar())
// .params("avatar_thumb", u.getAvatarThumb())
// .params("city", openLocation ? appConfig.getCity() : "")
// .params("province", openLocation ? appConfig.getProvince() : "")
// .params("lat", openLocation ? String.valueOf(appConfig.getLat()) : "")
// .params("lng", openLocation ? String.valueOf(appConfig.getLng()) : "")
// .params("title", title)
// .params("liveclassid", liveClassId)
// .params("type", type)
// .params("type_val", typeVal)
// .params("deviceinfo", LiveConfig.getSystemParams());
// ;
// if (file != null) {
// request.params("file", file);
// }
// request.execute(callback);
}
/** /**
* 新主播开播 * 新主播开播
* *
@ -794,14 +674,8 @@ public class LiveHttpUtil {
* @param callback * @param callback
*/ */
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, HttpCallback callback) { public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, HttpCallback callback) {
CommonAppConfig appConfig = CommonAppConfig.getInstance();
UserBean u = appConfig.getUserBean();
if (u == null) {
return;
}
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM) PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM)
.params("uid", appConfig.getUid())
.params("token", appConfig.getToken())
.params("title", title) .params("title", title)
.params("liveclassid", liveClassId) .params("liveclassid", liveClassId)
.params("type", type) .params("type", type)
@ -819,8 +693,6 @@ public class LiveHttpUtil {
*/ */
public static void changeLive(String stream) { public static void changeLive(String stream) {
HttpClient.getInstance().get("Live.changeLive", LiveHttpConsts.CHANGE_LIVE) HttpClient.getInstance().get("Live.changeLive", LiveHttpConsts.CHANGE_LIVE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("stream", stream) .params("stream", stream)
.params("status", "1") .params("status", "1")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@ -837,8 +709,6 @@ public class LiveHttpUtil {
public static void stopLive(String stream, HttpCallback callback) { public static void stopLive(String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.stopRoom", LiveHttpConsts.STOP_LIVE) HttpClient.getInstance().get("Live.stopRoom", LiveHttpConsts.STOP_LIVE)
.params("stream", stream) .params("stream", stream)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -852,7 +722,6 @@ public class LiveHttpUtil {
public static void getisRong(HttpCallback callback) { public static void getisRong(HttpCallback callback) {
HttpClient.getInstance().get("Live.isRong", "Live.isRong") HttpClient.getInstance().get("Live.isRong", "Live.isRong")
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
@ -861,7 +730,6 @@ public class LiveHttpUtil {
*/ */
public static void getTxLinkMicAccUrl(String originStreamUrl, HttpCallback callback) { public static void getTxLinkMicAccUrl(String originStreamUrl, HttpCallback callback) {
HttpClient.getInstance().get("Linkmic.requestPlayUrlWithSignForLinkMic", LiveHttpConsts.GET_TX_LINK_MIC_ACC_URL) HttpClient.getInstance().get("Linkmic.requestPlayUrlWithSignForLinkMic", LiveHttpConsts.GET_TX_LINK_MIC_ACC_URL)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("originStreamUrl", originStreamUrl) .params("originStreamUrl", originStreamUrl)
.execute(callback); .execute(callback);
} }
@ -872,7 +740,6 @@ public class LiveHttpUtil {
*/ */
public static void linkMicTxMixStream(String mergeparams) { public static void linkMicTxMixStream(String mergeparams) {
HttpClient.getInstance().get("Linkmic.mergeVideoStream", LiveHttpConsts.LINK_MIC_TX_MIX_STREAM) HttpClient.getInstance().get("Linkmic.mergeVideoStream", LiveHttpConsts.LINK_MIC_TX_MIX_STREAM)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("mergeparams", mergeparams) .params("mergeparams", mergeparams)
.execute(CommonHttpUtil.NO_CALLBACK); .execute(CommonHttpUtil.NO_CALLBACK);
} }
@ -883,8 +750,6 @@ public class LiveHttpUtil {
*/ */
public static void getMyAdminRoomList(int p, HttpCallback callback) { public static void getMyAdminRoomList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Livemanage.getRoomList", LiveHttpConsts.GET_MY_ADMIN_ROOM_LIST) HttpClient.getInstance().get("Livemanage.getRoomList", LiveHttpConsts.GET_MY_ADMIN_ROOM_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -895,8 +760,6 @@ public class LiveHttpUtil {
*/ */
public static void getLiveGiftPrizePool(String liveUid, String stream, HttpCallback callback) { public static void getLiveGiftPrizePool(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Jackpot.getJackpot", LiveHttpConsts.GET_LIVE_GIFT_PRIZE_POOL) HttpClient.getInstance().get("Jackpot.getJackpot", LiveHttpConsts.GET_LIVE_GIFT_PRIZE_POOL)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.execute(callback); .execute(callback);
@ -907,8 +770,6 @@ public class LiveHttpUtil {
*/ */
public static void anchorCheckLive(String liveUid, String stream, HttpCallback callback) { public static void anchorCheckLive(String liveUid, String stream, HttpCallback callback) {
HttpClient.getInstance().get("Live.checkLiveing", LiveHttpConsts.ANCHOR_CHECK_LIVE) HttpClient.getInstance().get("Live.checkLiveing", LiveHttpConsts.ANCHOR_CHECK_LIVE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.execute(callback); .execute(callback);
@ -931,8 +792,6 @@ public class LiveHttpUtil {
public static void getHcGiftList(HttpCallback callback) { public static void getHcGiftList(HttpCallback callback) {
HttpClient.getInstance().get("Live.getSvgaList", LiveHttpConsts.GET_GIFT_LIST) HttpClient.getInstance().get("Live.getSvgaList", LiveHttpConsts.GET_GIFT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -943,8 +802,6 @@ public class LiveHttpUtil {
public static void getHczGiftList(HttpCallback callback) { public static void getHczGiftList(HttpCallback callback) {
HttpClient.getInstance().get("Home.aoto_load", "Home.aoto_load") HttpClient.getInstance().get("Home.aoto_load", "Home.aoto_load")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -955,8 +812,6 @@ public class LiveHttpUtil {
public static void geteEvent(String anchor_id, HttpCallback callback) { public static void geteEvent(String anchor_id, HttpCallback callback) {
HttpClient.getInstance().get("Rank.isActivity", LiveHttpConsts.GET_EVENT) HttpClient.getInstance().get("Rank.isActivity", LiveHttpConsts.GET_EVENT)
.params("anchorUid", anchor_id) .params("anchorUid", anchor_id)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -966,8 +821,6 @@ public class LiveHttpUtil {
public static void setEvent(String anchor_id, HttpCallback callback) { public static void setEvent(String anchor_id, HttpCallback callback) {
HttpClient.getInstance().get("Rank.crystalTimeEnd", LiveHttpConsts.GET_EVENT) HttpClient.getInstance().get("Rank.crystalTimeEnd", LiveHttpConsts.GET_EVENT)
.params("anchor_id", anchor_id) .params("anchor_id", anchor_id)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -976,8 +829,6 @@ public class LiveHttpUtil {
*/ */
public static void userHopePrankTurntable(String anchor_id, String prankid, HttpCallback callback) { public static void userHopePrankTurntable(String anchor_id, String prankid, HttpCallback callback) {
HttpClient.getInstance().get("Prank.userHopePrankTurntable", LiveHttpConsts.USERHOPEPRANKTURNTABLE) HttpClient.getInstance().get("Prank.userHopePrankTurntable", LiveHttpConsts.USERHOPEPRANKTURNTABLE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("prankid", prankid) .params("prankid", prankid)
.params("anchor_id", anchor_id) .params("anchor_id", anchor_id)
.execute(callback); .execute(callback);
@ -988,8 +839,6 @@ public class LiveHttpUtil {
*/ */
public static void endPrankTurntable(String anchor_id, HttpCallback callback) { public static void endPrankTurntable(String anchor_id, HttpCallback callback) {
HttpClient.getInstance().get("Prank.endPrankTurntable", LiveHttpConsts.ENDPRANKTURNTABLE) HttpClient.getInstance().get("Prank.endPrankTurntable", LiveHttpConsts.ENDPRANKTURNTABLE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("anchor_id", anchor_id) .params("anchor_id", anchor_id)
.execute(callback); .execute(callback);
} }
@ -999,8 +848,6 @@ public class LiveHttpUtil {
*/ */
public static void getAnchorLastWeekList(HttpCallback callback) { public static void getAnchorLastWeekList(HttpCallback callback) {
HttpClient.getInstance().get("WeekStar.getAnchorLastWeekList", LiveHttpConsts.GETANCHORLASTWEEKLIST) HttpClient.getInstance().get("WeekStar.getAnchorLastWeekList", LiveHttpConsts.GETANCHORLASTWEEKLIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -1009,8 +856,6 @@ public class LiveHttpUtil {
*/ */
public static void useHotCardUserList(String anchor_id, HttpCallback callback) { public static void useHotCardUserList(String anchor_id, HttpCallback callback) {
HttpClient.getInstance().get("Live.useHotCardUserList", LiveHttpConsts.USEHOTCARDUSERLIST) HttpClient.getInstance().get("Live.useHotCardUserList", LiveHttpConsts.USEHOTCARDUSERLIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("anchor_id", anchor_id) .params("anchor_id", anchor_id)
.execute(callback); .execute(callback);
} }
@ -1020,8 +865,6 @@ public class LiveHttpUtil {
*/ */
public static void isHotCard(String anchor_id, HttpCallback callback) { public static void isHotCard(String anchor_id, HttpCallback callback) {
HttpClient.getInstance().get("Live.isHotCard", LiveHttpConsts.ISHOTCARD) HttpClient.getInstance().get("Live.isHotCard", LiveHttpConsts.ISHOTCARD)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("anchor_id", anchor_id) .params("anchor_id", anchor_id)
.execute(callback); .execute(callback);
} }
@ -1031,8 +874,6 @@ public class LiveHttpUtil {
*/ */
public static void setInstructorRemark(String touid, String remark, HttpCallback callback) { public static void setInstructorRemark(String touid, String remark, HttpCallback callback) {
HttpClient.getInstance().get("User.setInstructorRemark", LiveHttpConsts.SETINSTRUCTORREMARK) HttpClient.getInstance().get("User.setInstructorRemark", LiveHttpConsts.SETINSTRUCTORREMARK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", touid) .params("touid", touid)
.params("remark", remark) .params("remark", remark)
.execute(callback); .execute(callback);

View File

@ -784,7 +784,6 @@ public class SocketClient {
LivePushTxViewHolder.mPreView.setLayoutParams(params); LivePushTxViewHolder.mPreView.setLayoutParams(params);
//断开连麦 //断开连麦
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -44,7 +44,6 @@ public class SocketLinkMicPkUtil {
public static void linkMicPkAccept(SocketClient client, String pkUid, String url, String name) { public static void linkMicPkAccept(SocketClient client, String pkUid, String url, String name) {
Log.i("pksend", "发送的pkurl=" + url + "****发送的pkname=" + name); Log.i("pksend", "发送的pkurl=" + url + "****发送的pkname=" + name);
HttpClient.getInstance().get("Livepk.changeLive", "Livepk.changeLive") HttpClient.getInstance().get("Livepk.changeLive", "Livepk.changeLive")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("pkuid", pkUid) .params("pkuid", pkUid)
.params("type", "1") .params("type", "1")
.params("sign", "1") .params("sign", "1")
@ -53,7 +52,6 @@ public class SocketLinkMicPkUtil {
public void onSuccess(int code, String msgs, String[] info) { public void onSuccess(int code, String msgs, String[] info) {
if (code == 0) { if (code == 0) {
HttpClient.getInstance().get("Livepk.setPK", "Livepk.setPK") HttpClient.getInstance().get("Livepk.setPK", "Livepk.setPK")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("pkuid", pkUid) .params("pkuid", pkUid)
.params("type", "1") .params("type", "1")
.params("sign", "1") .params("sign", "1")

View File

@ -910,7 +910,6 @@ public class SocketRyClient {
LivePushRyViewHolder.mPreView.setLayoutParams(params); LivePushRyViewHolder.mPreView.setLayoutParams(params);
//断开连麦 //断开连麦
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -179,7 +179,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
public void onClick(View v) { public void onClick(View v) {
//获取房间连麦状态 //获取房间连麦状态
HttpClient.getInstance().get("live.getDrLm", "live.getDrLm") HttpClient.getInstance().get("live.getDrLm", "live.getDrLm")
.params("uid", mLiveUid) .params("uid", mLiveUid,true)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -727,7 +727,6 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
HttpClient.getInstance().get("live.joinDrLm", "live.joinDrLm") HttpClient.getInstance().get("live.joinDrLm", "live.joinDrLm")
.params("roomid", LiveActivity.mLiveUid) .params("roomid", LiveActivity.mLiveUid)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -354,7 +354,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
//断开连麦 //断开连麦
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -108,7 +108,6 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
//断开连麦 //断开连麦
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -117,7 +116,6 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi
}); });
HttpClient.getInstance().get("Livepk.endPK", "Livepk.endPK") HttpClient.getInstance().get("Livepk.endPK", "Livepk.endPK")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("addtime", "00:00") .params("addtime", "00:00")
.params("type", "0") .params("type", "0")
.params("sign", "1") .params("sign", "1")

View File

@ -81,7 +81,6 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
public void onClick(View view) { public void onClick(View view) {
//開始多人PK //開始多人PK
HttpClient.getInstance().post("live.startDRPK", "live.startDRPK") HttpClient.getInstance().post("live.startDRPK", "live.startDRPK")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("roomid", CommonAppConfig.getInstance().getUid()) .params("roomid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
@ -103,7 +102,6 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
HttpClient.getInstance().get("live.endDRpk", "live.endDRpk") HttpClient.getInstance().get("live.endDRpk", "live.endDRpk")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("roomid", CommonAppConfig.getInstance().getUid()) .params("roomid", CommonAppConfig.getInstance().getUid())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override

View File

@ -209,6 +209,7 @@ public class EntryActivity extends AppCompatActivity {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY1); WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY1);
} }
}); });
@ -571,6 +572,7 @@ public class EntryActivity extends AppCompatActivity {
public static void ToLogin() { public static void ToLogin() {
activity.startActivity(new Intent(activity, LoginActivity.class)); activity.startActivity(new Intent(activity, LoginActivity.class));
activity.finish();
} }
private static final String EMAIL = "email"; private static final String EMAIL = "email";
@ -725,8 +727,6 @@ public class EntryActivity extends AppCompatActivity {
EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class)); EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
} else { } else {
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor") HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -311,14 +311,13 @@ public class LoginActivity extends AbsActivity {
logger.logEvent("FB_login"); logger.logEvent("FB_login");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor") HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (info[0] != null && mFirstLogin == true) { if (info[0] != null && mFirstLogin == true) {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
MainActivity.forward(LoginActivity.this, false); MainActivity.forward(LoginActivity.this, false);
finish();
gotoLive(obj.getString("anchor_id")); gotoLive(obj.getString("anchor_id"));
IMLoginManager.get(mContext).setisNewUserOne(true); IMLoginManager.get(mContext).setisNewUserOne(true);
IMLoginManager.get(mContext).setNewUserGif(true); IMLoginManager.get(mContext).setNewUserGif(true);
@ -327,6 +326,7 @@ public class LoginActivity extends AbsActivity {
} }
} else { } else {
MainActivity.forward(LoginActivity.this, false); MainActivity.forward(LoginActivity.this, false);
finish();
} }
} }

View File

@ -94,8 +94,6 @@ public class OneLoginDialog extends AbsDialogFragment {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
HttpClient.getInstance().post("User.userBindAgentAdmin", "User.userBindAgentAdmin") HttpClient.getInstance().post("User.userBindAgentAdmin", "User.userBindAgentAdmin")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("invitation_code", bundle.getString("code")) .params("invitation_code", bundle.getString("code"))
.params("user_nicename", bundle.getString("name")) .params("user_nicename", bundle.getString("name"))
.execute(new HttpCallback() { .execute(new HttpCallback() {
@ -114,8 +112,6 @@ public class OneLoginDialog extends AbsDialogFragment {
} }
}); });
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor") HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -95,8 +95,6 @@ public class MainHttpUtil {
public static void requestBonus(HttpCallback callback) { public static void requestBonus(HttpCallback callback) {
String appVer = AppUtils.getAppVersionName(); String appVer = AppUtils.getAppVersionName();
HttpClient.getInstance().get("User.bonus", MainHttpConsts.REQUEST_BONUS) HttpClient.getInstance().get("User.bonus", MainHttpConsts.REQUEST_BONUS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("appAndroidVersion", appVer) .params("appAndroidVersion", appVer)
.execute(callback); .execute(callback);
} }
@ -106,9 +104,6 @@ public class MainHttpUtil {
*/ */
public static void requestNewBonus(HttpCallback callback) { public static void requestNewBonus(HttpCallback callback) {
HttpClient.getInstance().get("Sign.userSign", MainHttpConsts.REQUEST_BONUS) HttpClient.getInstance().get("Sign.userSign", MainHttpConsts.REQUEST_BONUS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("token", CommonAppConfig.getInstance().getToken())
.params("uuid_Device", DeviceUtils.getUniqueDeviceId()) .params("uuid_Device", DeviceUtils.getUniqueDeviceId())
.params("lastlogindevice", "Android") .params("lastlogindevice", "Android")
.params("model", android.os.Build.BRAND + android.os.Build.MODEL) .params("model", android.os.Build.BRAND + android.os.Build.MODEL)
@ -120,8 +115,6 @@ public class MainHttpUtil {
*/ */
public static void getBonus(HttpCallback callback) { public static void getBonus(HttpCallback callback) {
HttpClient.getInstance().get("User.getBonus", MainHttpConsts.GET_BONUS) HttpClient.getInstance().get("User.getBonus", MainHttpConsts.GET_BONUS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -130,8 +123,6 @@ public class MainHttpUtil {
*/ */
public static void setDistribut(String code, HttpCallback callback) { public static void setDistribut(String code, HttpCallback callback) {
HttpClient.getInstance().get("User.setDistribut", MainHttpConsts.SET_DISTRIBUT) HttpClient.getInstance().get("User.setDistribut", MainHttpConsts.SET_DISTRIBUT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("code", code) .params("code", code)
.execute(callback); .execute(callback);
} }
@ -142,7 +133,6 @@ public class MainHttpUtil {
public static void getHot(int p, HttpCallback callback) { public static void getHot(int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.getHot", MainHttpConsts.GET_HOT) HttpClient.getInstance().get("Home.getHot", MainHttpConsts.GET_HOT)
.params("p", p) .params("p", p)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
@ -151,7 +141,6 @@ public class MainHttpUtil {
*/ */
public static void getRandom(int p, HttpCallback callback) { public static void getRandom(int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.getRandom", MainHttpConsts.GET_RANDOM) HttpClient.getInstance().get("Home.getRandom", MainHttpConsts.GET_RANDOM)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
@ -161,7 +150,6 @@ public class MainHttpUtil {
public static void getHomeFollow(int p, HttpCallback callback) { public static void getHomeFollow(int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.getFollow", MainHttpConsts.GET_HOME_FOLLOW) HttpClient.getInstance().get("Home.getFollow", MainHttpConsts.GET_HOME_FOLLOW)
.params("p", p) .params("p", p)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
@ -171,7 +159,6 @@ public class MainHttpUtil {
*/ */
public static void getFollow(int p, HttpCallback callback) { public static void getFollow(int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.getFollow", MainHttpConsts.GET_FOLLOW) HttpClient.getInstance().get("Home.getFollow", MainHttpConsts.GET_FOLLOW)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -191,7 +178,6 @@ public class MainHttpUtil {
//排行榜 收益榜 //排行榜 收益榜
public static void profitList(String type, int p, HttpCallback callback) { public static void profitList(String type, int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.profitList", MainHttpConsts.PROFIT_LIST) HttpClient.getInstance().get("Home.profitList", MainHttpConsts.PROFIT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("type", type) .params("type", type)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -200,7 +186,6 @@ public class MainHttpUtil {
//排行榜 贡献榜 //排行榜 贡献榜
public static void consumeList(String type, int p, HttpCallback callback) { public static void consumeList(String type, int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.consumeList", MainHttpConsts.CONSUME_LIST) HttpClient.getInstance().get("Home.consumeList", MainHttpConsts.CONSUME_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("type", type) .params("type", type)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -242,8 +227,6 @@ public class MainHttpUtil {
*/ */
public static void getBaseInfo(String uid, String token, final CommonCallback<UserBean> commonCallback) { public static void getBaseInfo(String uid, String token, final CommonCallback<UserBean> commonCallback) {
HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO) HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO)
.params("uid", uid)
.params("token", token)
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -277,8 +260,6 @@ public class MainHttpUtil {
public static void getBaseInfos(String uid, String token, HttpCallback callback) { public static void getBaseInfos(String uid, String token, HttpCallback callback) {
HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO) HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO)
.params("uid", uid)
.params("token", token)
.execute(callback); .execute(callback);
} }
@ -296,8 +277,6 @@ public class MainHttpUtil {
*/ */
public static void getBalance(HttpCallback callback) { public static void getBalance(HttpCallback callback) {
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance") HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -314,8 +293,6 @@ public class MainHttpUtil {
*/ */
public static void setBlack(String toUid, HttpCallback callback) { public static void setBlack(String toUid, HttpCallback callback) {
HttpClient.getInstance().get("User.setBlack", MainHttpConsts.SET_BLACK) HttpClient.getInstance().get("User.setBlack", MainHttpConsts.SET_BLACK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", toUid) .params("touid", toUid)
.execute(callback); .execute(callback);
} }
@ -325,8 +302,6 @@ public class MainHttpUtil {
*/ */
public static void getSettingList(HttpCallback callback) { public static void getSettingList(HttpCallback callback) {
HttpClient.getInstance().get("User.getPerSetting", MainHttpConsts.GET_SETTING_LIST) HttpClient.getInstance().get("User.getPerSetting", MainHttpConsts.GET_SETTING_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -335,8 +310,6 @@ public class MainHttpUtil {
*/ */
public static void search(String key, int type, int p, HttpCallback callback) { public static void search(String key, int type, int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.search", MainHttpConsts.SEARCH) HttpClient.getInstance().get("Home.search", MainHttpConsts.SEARCH)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("key", key) .params("key", key)
.params("type", type) .params("type", type)
.params("p", p) .params("p", p)
@ -348,7 +321,6 @@ public class MainHttpUtil {
*/ */
public static void getBlackList(int p, HttpCallback callback) { public static void getBlackList(int p, HttpCallback callback) {
HttpClient.getInstance().get("User.getBlackList", "User.getBlackList") HttpClient.getInstance().get("User.getBlackList", "User.getBlackList")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -360,7 +332,6 @@ public class MainHttpUtil {
*/ */
public static void getFollowList(String touid, int p, HttpCallback callback) { public static void getFollowList(String touid, int p, HttpCallback callback) {
HttpClient.getInstance().get("User.getFollowsList", MainHttpConsts.GET_FOLLOW_LIST) HttpClient.getInstance().get("User.getFollowsList", MainHttpConsts.GET_FOLLOW_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -373,7 +344,6 @@ public class MainHttpUtil {
*/ */
public static void getFansList(String touid, int p, HttpCallback callback) { public static void getFansList(String touid, int p, HttpCallback callback) {
HttpClient.getInstance().get("User.getFansList", MainHttpConsts.GET_FANS_LIST) HttpClient.getInstance().get("User.getFansList", MainHttpConsts.GET_FANS_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -386,8 +356,6 @@ public class MainHttpUtil {
public static void updateAvatar(File file, HttpCallback callback) { public static void updateAvatar(File file, HttpCallback callback) {
HttpClient.getInstance().post("User.updateAvatar", MainHttpConsts.UPDATE_AVATAR) HttpClient.getInstance().post("User.updateAvatar", MainHttpConsts.UPDATE_AVATAR)
.isMultipart(true) .isMultipart(true)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("file", file) .params("file", file)
.execute(callback); .execute(callback);
} }
@ -399,8 +367,6 @@ public class MainHttpUtil {
*/ */
public static void updateFields(String fields, HttpCallback callback) { public static void updateFields(String fields, HttpCallback callback) {
HttpClient.getInstance().get("User.updateFields", MainHttpConsts.UPDATE_FIELDS) HttpClient.getInstance().get("User.updateFields", MainHttpConsts.UPDATE_FIELDS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("fields", fields) .params("fields", fields)
.execute(callback); .execute(callback);
} }
@ -411,8 +377,6 @@ public class MainHttpUtil {
*/ */
public static void getProfit(HttpCallback callback) { public static void getProfit(HttpCallback callback) {
HttpClient.getInstance().get("User.getProfit", MainHttpConsts.GET_PROFIT) HttpClient.getInstance().get("User.getProfit", MainHttpConsts.GET_PROFIT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -421,8 +385,6 @@ public class MainHttpUtil {
*/ */
public static void getCashAccountList(HttpCallback callback) { public static void getCashAccountList(HttpCallback callback) {
HttpClient.getInstance().get("User.getUserAccountList", MainHttpConsts.GET_USER_ACCOUNT_LIST) HttpClient.getInstance().get("User.getUserAccountList", MainHttpConsts.GET_USER_ACCOUNT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -432,8 +394,6 @@ public class MainHttpUtil {
*/ */
public static void addCashAccount(String account, String name, String bank, int type, HttpCallback callback) { public static void addCashAccount(String account, String name, String bank, int type, HttpCallback callback) {
HttpClient.getInstance().get("User.setUserAccount", MainHttpConsts.ADD_CASH_ACCOUNT) HttpClient.getInstance().get("User.setUserAccount", MainHttpConsts.ADD_CASH_ACCOUNT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("account", account) .params("account", account)
.params("name", name) .params("name", name)
.params("account_bank", bank) .params("account_bank", bank)
@ -446,8 +406,6 @@ public class MainHttpUtil {
*/ */
public static void deleteCashAccount(String accountId, HttpCallback callback) { public static void deleteCashAccount(String accountId, HttpCallback callback) {
HttpClient.getInstance().get("User.delUserAccount", MainHttpConsts.DEL_CASH_ACCOUNT) HttpClient.getInstance().get("User.delUserAccount", MainHttpConsts.DEL_CASH_ACCOUNT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("id", accountId) .params("id", accountId)
.execute(callback); .execute(callback);
} }
@ -457,8 +415,6 @@ public class MainHttpUtil {
*/ */
public static void doCash(String votes, String accountId, HttpCallback callback) { public static void doCash(String votes, String accountId, HttpCallback callback) {
HttpClient.getInstance().get("User.setCash", MainHttpConsts.DO_CASH) HttpClient.getInstance().get("User.setCash", MainHttpConsts.DO_CASH)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("cashvote", votes)//提现的票数 .params("cashvote", votes)//提现的票数
.params("accountid", accountId)//账号ID .params("accountid", accountId)//账号ID
.execute(callback); .execute(callback);
@ -471,7 +427,6 @@ public class MainHttpUtil {
public static void getClassLive(int classId, int p, HttpCallback callback) { public static void getClassLive(int classId, int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.getClassLive", MainHttpConsts.GET_CLASS_LIVE) HttpClient.getInstance().get("Home.getClassLive", MainHttpConsts.GET_CLASS_LIVE)
.params("liveclassid", classId) .params("liveclassid", classId)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -481,8 +436,6 @@ public class MainHttpUtil {
*/ */
public static void getMyImpress(HttpCallback callback) { public static void getMyImpress(HttpCallback callback) {
HttpClient.getInstance().get("User.getMyLabel", MainHttpConsts.GET_MY_IMPRESS) HttpClient.getInstance().get("User.getMyLabel", MainHttpConsts.GET_MY_IMPRESS)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -491,7 +444,6 @@ public class MainHttpUtil {
*/ */
public static void getRecommend(HttpCallback callback) { public static void getRecommend(HttpCallback callback) {
HttpClient.getInstance().get("Home.getRecommend", MainHttpConsts.GET_RECOMMEND) HttpClient.getInstance().get("Home.getRecommend", MainHttpConsts.GET_RECOMMEND)
.params("uid", CommonAppConfig.getInstance().getUid())
.execute(callback); .execute(callback);
} }
@ -501,7 +453,6 @@ public class MainHttpUtil {
*/ */
public static void recommendFollow(String touid, HttpCallback callback) { public static void recommendFollow(String touid, HttpCallback callback) {
HttpClient.getInstance().get("Home.attentRecommend", MainHttpConsts.RECOMMEND_FOLLOW) HttpClient.getInstance().get("Home.attentRecommend", MainHttpConsts.RECOMMEND_FOLLOW)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("touid", touid) .params("touid", touid)
.execute(callback); .execute(callback);
} }
@ -545,8 +496,8 @@ public class MainHttpUtil {
HttpClient.getInstance().get("Login.bindMobile", MainHttpConsts.BINDMOBILE) HttpClient.getInstance().get("Login.bindMobile", MainHttpConsts.BINDMOBILE)
.params("mobile", mobile) .params("mobile", mobile)
.params("country_code", countryCode + "") .params("country_code", countryCode + "")
.params("uid", uid) .params("uid", uid,true)
.params("token", token) .params("token", token,true)
.params("user_pass", user_pass) .params("user_pass", user_pass)
.params("user_pass2", user_pass2) .params("user_pass2", user_pass2)
.params("code", code) .params("code", code)
@ -560,8 +511,8 @@ public class MainHttpUtil {
HttpClient.getInstance().get("Login.updateBindMobile", MainHttpConsts.UPDATEBINDMOBILE) HttpClient.getInstance().get("Login.updateBindMobile", MainHttpConsts.UPDATEBINDMOBILE)
.params("mobile", mobile) .params("mobile", mobile)
.params("country_code", countryCode + "") .params("country_code", countryCode + "")
.params("uid", uid) .params("uid", uid,true)
.params("token", token) .params("token", token,true)
.params("code", code) .params("code", code)
.execute(callback); .execute(callback);
} }
@ -618,8 +569,6 @@ public class MainHttpUtil {
*/ */
public static void modifyPwd(String oldpass, String pass, String pass2, HttpCallback callback) { public static void modifyPwd(String oldpass, String pass, String pass2, HttpCallback callback) {
HttpClient.getInstance().get("User.updatePass", MainHttpConsts.MODIFY_PWD) HttpClient.getInstance().get("User.updatePass", MainHttpConsts.MODIFY_PWD)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("oldpass", oldpass) .params("oldpass", oldpass)
.params("pass", pass) .params("pass", pass)
.params("pass2", pass2) .params("pass2", pass2)
@ -644,8 +593,6 @@ public class MainHttpUtil {
*/ */
public static void getQrCode(HttpCallback callback) { public static void getQrCode(HttpCallback callback) {
HttpClient.getInstance().get("Agent.getCode", MainHttpConsts.GET_QR_CODE) HttpClient.getInstance().get("Agent.getCode", MainHttpConsts.GET_QR_CODE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -655,7 +602,6 @@ public class MainHttpUtil {
*/ */
public static void getHomeTop(HttpCallback callback) { public static void getHomeTop(HttpCallback callback) {
HttpClient.getInstance().get("Home.consumeproList", MainHttpConsts.HOME_TOP) HttpClient.getInstance().get("Home.consumeproList", MainHttpConsts.HOME_TOP)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("type", "month") .params("type", "month")
.params("p", "1") .params("p", "1")
.execute(callback); .execute(callback);
@ -666,8 +612,6 @@ public class MainHttpUtil {
*/ */
public static void sendDynamicGift(String id, int gift_num, String gift_id, HttpCallback callback) { public static void sendDynamicGift(String id, int gift_num, String gift_id, HttpCallback callback) {
HttpClient.getInstance().get("Community.sendDynamicGift", MainHttpConsts.SEND_DYNAMICGIFT) HttpClient.getInstance().get("Community.sendDynamicGift", MainHttpConsts.SEND_DYNAMICGIFT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("dynamic_id", id) .params("dynamic_id", id)
.params("gift_num", gift_num) .params("gift_num", gift_num)
.params("gift_id", gift_id) .params("gift_id", gift_id)
@ -679,8 +623,6 @@ public class MainHttpUtil {
*/ */
public static void getDynamicGiftInfo(HttpCallback callback) { public static void getDynamicGiftInfo(HttpCallback callback) {
HttpClient.getInstance().get("Community.getDynamicGiftInfo", MainHttpConsts.GET_DYNAMICGIFTINFO) HttpClient.getInstance().get("Community.getDynamicGiftInfo", MainHttpConsts.GET_DYNAMICGIFTINFO)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -689,8 +631,6 @@ public class MainHttpUtil {
*/ */
public static void getDynamicSendGiftList(String id, HttpCallback callback) { public static void getDynamicSendGiftList(String id, HttpCallback callback) {
HttpClient.getInstance().get("Community.getDynamicSendGiftList", MainHttpConsts.GET_DYNAMICSENDGIFTLIST) HttpClient.getInstance().get("Community.getDynamicSendGiftList", MainHttpConsts.GET_DYNAMICSENDGIFTLIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("dynamic_id", id) .params("dynamic_id", id)
.execute(callback); .execute(callback);
} }
@ -700,8 +640,6 @@ public class MainHttpUtil {
*/ */
public static void isAnchor(HttpCallback callback) { public static void isAnchor(HttpCallback callback) {
HttpClient.getInstance().get("User.isAnchor", MainHttpConsts.ISANCHOR) HttpClient.getInstance().get("User.isAnchor", MainHttpConsts.ISANCHOR)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -710,8 +648,6 @@ public class MainHttpUtil {
*/ */
public static void getUserFrontTaskType(HttpCallback callback) { public static void getUserFrontTaskType(HttpCallback callback) {
HttpClient.getInstance().get("Task.getUserFrontTaskType", MainHttpConsts.GET_USER_FRONTTASKTYPE) HttpClient.getInstance().get("Task.getUserFrontTaskType", MainHttpConsts.GET_USER_FRONTTASKTYPE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -720,8 +656,6 @@ public class MainHttpUtil {
*/ */
public static void getCustomerService(HttpCallback callback) { public static void getCustomerService(HttpCallback callback) {
HttpClient.getInstance().get("Home.getCustomerService", MainHttpConsts.GETCUSTOMERSERVICE) HttpClient.getInstance().get("Home.getCustomerService", MainHttpConsts.GETCUSTOMERSERVICE)
// .params("uid", CommonAppConfig.getInstance().getUid())
// .params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -730,8 +664,6 @@ public class MainHttpUtil {
*/ */
public static void getInstructorRemark(HttpCallback callback) { public static void getInstructorRemark(HttpCallback callback) {
HttpClient.getInstance().get("User.getInstructorRemark", MainHttpConsts.GETINSTRUCTORREMARK) HttpClient.getInstance().get("User.getInstructorRemark", MainHttpConsts.GETINSTRUCTORREMARK)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -740,8 +672,6 @@ public class MainHttpUtil {
*/ */
public static void isInstructor(HttpCallback callback) { public static void isInstructor(HttpCallback callback) {
HttpClient.getInstance().get("User.isInstructor", MainHttpConsts.ISINSTRUCTOR) HttpClient.getInstance().get("User.isInstructor", MainHttpConsts.ISINSTRUCTOR)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }

View File

@ -76,8 +76,7 @@ public class HonorViewHolder extends AbsUserHomeViewHolder {
* 获取用户荣誉和座骑 * 获取用户荣誉和座骑
*/ */
HttpClient.getInstance().get("User.medalCarList", LiveHttpConsts.GET_USER_LIST) HttpClient.getInstance().get("User.medalCarList", LiveHttpConsts.GET_USER_LIST)
.params("uid", mToUid) .params("uid", mToUid,true)
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -30,8 +30,6 @@ public class VideoHttpUtil {
*/ */
public static void getHomeVideoList(int p, HttpCallback callback) { public static void getHomeVideoList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Video.getVideoList", VideoHttpConsts.GET_HOME_VIDEO_LIST) HttpClient.getInstance().get("Video.getVideoList", VideoHttpConsts.GET_HOME_VIDEO_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -42,8 +40,6 @@ public class VideoHttpUtil {
*/ */
public static void setVideoLike(String tag, String videoid, HttpCallback callback) { public static void setVideoLike(String tag, String videoid, HttpCallback callback) {
HttpClient.getInstance().get("Video.addLike", tag) HttpClient.getInstance().get("Video.addLike", tag)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoid) .params("videoid", videoid)
.execute(callback); .execute(callback);
} }
@ -53,8 +49,6 @@ public class VideoHttpUtil {
*/ */
public static void getVideoCommentList(String videoid, int p, HttpCallback callback) { public static void getVideoCommentList(String videoid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Video.getComments", VideoHttpConsts.GET_VIDEO_COMMENT_LIST) HttpClient.getInstance().get("Video.getComments", VideoHttpConsts.GET_VIDEO_COMMENT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoid) .params("videoid", videoid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -66,8 +60,6 @@ public class VideoHttpUtil {
public static void setCommentLike(String commentid, HttpCallback callback) { public static void setCommentLike(String commentid, HttpCallback callback) {
HttpClient.getInstance().get("Video.addCommentLike", VideoHttpConsts.SET_COMMENT_LIKE) HttpClient.getInstance().get("Video.addCommentLike", VideoHttpConsts.SET_COMMENT_LIKE)
.params("commentid", commentid) .params("commentid", commentid)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(callback); .execute(callback);
} }
@ -76,8 +68,6 @@ public class VideoHttpUtil {
*/ */
public static void setComment(String toUid, String videoId, String content, String commentId, String parentId, HttpCallback callback) { public static void setComment(String toUid, String videoId, String content, String commentId, String parentId, HttpCallback callback) {
HttpClient.getInstance().get("Video.setComment", VideoHttpConsts.SET_COMMENT) HttpClient.getInstance().get("Video.setComment", VideoHttpConsts.SET_COMMENT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", toUid) .params("touid", toUid)
.params("videoid", videoId) .params("videoid", videoId)
.params("commentid", commentId) .params("commentid", commentId)
@ -94,8 +84,6 @@ public class VideoHttpUtil {
public static void getCommentReply(String commentid, int p, HttpCallback callback) { public static void getCommentReply(String commentid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Video.getReplys", VideoHttpConsts.GET_COMMENT_REPLY) HttpClient.getInstance().get("Video.getReplys", VideoHttpConsts.GET_COMMENT_REPLY)
.params("commentid", commentid) .params("commentid", commentid)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -113,8 +101,6 @@ public class VideoHttpUtil {
*/ */
public static void getHotMusicList(int p, HttpCallback callback) { public static void getHotMusicList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Music.hotLists", VideoHttpConsts.GET_HOT_MUSIC_LIST) HttpClient.getInstance().get("Music.hotLists", VideoHttpConsts.GET_HOT_MUSIC_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -124,8 +110,6 @@ public class VideoHttpUtil {
*/ */
public static void setMusicCollect(int muiscId, HttpCallback callback) { public static void setMusicCollect(int muiscId, HttpCallback callback) {
HttpClient.getInstance().get("Music.collectMusic", VideoHttpConsts.SET_MUSIC_COLLECT) HttpClient.getInstance().get("Music.collectMusic", VideoHttpConsts.SET_MUSIC_COLLECT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("musicid", muiscId) .params("musicid", muiscId)
.execute(callback); .execute(callback);
} }
@ -135,8 +119,6 @@ public class VideoHttpUtil {
*/ */
public static void getMusicCollectList(int p, HttpCallback callback) { public static void getMusicCollectList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Music.getCollectMusicLists", VideoHttpConsts.GET_MUSIC_COLLECT_LIST) HttpClient.getInstance().get("Music.getCollectMusicLists", VideoHttpConsts.GET_MUSIC_COLLECT_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
} }
@ -146,8 +128,6 @@ public class VideoHttpUtil {
*/ */
public static void getMusicList(String classId, int p, HttpCallback callback) { public static void getMusicList(String classId, int p, HttpCallback callback) {
HttpClient.getInstance().get("Music.music_list", VideoHttpConsts.GET_MUSIC_LIST) HttpClient.getInstance().get("Music.music_list", VideoHttpConsts.GET_MUSIC_LIST)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("classify", classId) .params("classify", classId)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -159,8 +139,6 @@ public class VideoHttpUtil {
*/ */
public static void videoSearchMusic(String key, int p, HttpCallback callback) { public static void videoSearchMusic(String key, int p, HttpCallback callback) {
HttpClient.getInstance().get("Music.searchMusic", VideoHttpConsts.VIDEO_SEARCH_MUSIC) HttpClient.getInstance().get("Music.searchMusic", VideoHttpConsts.VIDEO_SEARCH_MUSIC)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("key", key) .params("key", key)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -186,8 +164,6 @@ public class VideoHttpUtil {
*/ */
public static void saveUploadVideoInfo(String title, String thumb, String href, int musicId, boolean openLocation, HttpCallback callback) { public static void saveUploadVideoInfo(String title, String thumb, String href, int musicId, boolean openLocation, HttpCallback callback) {
HttpClient.getInstance().get("Video.setVideo", VideoHttpConsts.SAVE_UPLOAD_VIDEO_INFO) HttpClient.getInstance().get("Video.setVideo", VideoHttpConsts.SAVE_UPLOAD_VIDEO_INFO)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("lat", openLocation ? String.valueOf(CommonAppConfig.getInstance().getLat()) : "") .params("lat", openLocation ? String.valueOf(CommonAppConfig.getInstance().getLat()) : "")
.params("lng", openLocation ? String.valueOf(CommonAppConfig.getInstance().getLng()) : "") .params("lng", openLocation ? String.valueOf(CommonAppConfig.getInstance().getLng()) : "")
.params("city", openLocation ? CommonAppConfig.getInstance().getCity() : "") .params("city", openLocation ? CommonAppConfig.getInstance().getCity() : "")
@ -211,8 +187,6 @@ public class VideoHttpUtil {
*/ */
public static void getHomeVideo(String toUid, int p, HttpCallback callback) { public static void getHomeVideo(String toUid, int p, HttpCallback callback) {
HttpClient.getInstance().get("Video.getHomeVideo", VideoHttpConsts.GET_HOME_VIDEO) HttpClient.getInstance().get("Video.getHomeVideo", VideoHttpConsts.GET_HOME_VIDEO)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("touid", toUid) .params("touid", toUid)
.params("p", p) .params("p", p)
.execute(callback); .execute(callback);
@ -232,8 +206,6 @@ public class VideoHttpUtil {
*/ */
public static void videoReport(String videoId, String reportId, String content, HttpCallback callback) { public static void videoReport(String videoId, String reportId, String content, HttpCallback callback) {
HttpClient.getInstance().get("Video.report", VideoHttpConsts.VIDEO_REPORT) HttpClient.getInstance().get("Video.report", VideoHttpConsts.VIDEO_REPORT)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoId) .params("videoid", videoId)
.params("type", reportId) .params("type", reportId)
.params("content", content) .params("content", content)
@ -245,8 +217,6 @@ public class VideoHttpUtil {
*/ */
public static void videoDelete(String videoid, HttpCallback callback) { public static void videoDelete(String videoid, HttpCallback callback) {
HttpClient.getInstance().get("Video.del", VideoHttpConsts.VIDEO_DELETE) HttpClient.getInstance().get("Video.del", VideoHttpConsts.VIDEO_DELETE)
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoid) .params("videoid", videoid)
.execute(callback); .execute(callback);
} }
@ -258,8 +228,7 @@ public class VideoHttpUtil {
String uid = CommonAppConfig.getInstance().getUid(); String uid = CommonAppConfig.getInstance().getUid();
String s = MD5Util.getMD5(uid + "-" + videoid + "-" + VIDEO_SALT); String s = MD5Util.getMD5(uid + "-" + videoid + "-" + VIDEO_SALT);
HttpClient.getInstance().get("Video.addShare", VideoHttpConsts.SET_VIDEO_SHARE) HttpClient.getInstance().get("Video.addShare", VideoHttpConsts.SET_VIDEO_SHARE)
.params("uid", uid) .params("uid", uid,true)
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoid) .params("videoid", videoid)
.params("random_str", s) .params("random_str", s)
.execute(callback); .execute(callback);
@ -277,8 +246,7 @@ public class VideoHttpUtil {
VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_WATCH_START); VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_WATCH_START);
String s = MD5Util.getMD5(uid + "-" + videoId + "-" + VIDEO_SALT); String s = MD5Util.getMD5(uid + "-" + videoId + "-" + VIDEO_SALT);
HttpClient.getInstance().get("Video.addView", VideoHttpConsts.VIDEO_WATCH_START) HttpClient.getInstance().get("Video.addView", VideoHttpConsts.VIDEO_WATCH_START)
.params("uid", uid) .params("uid", uid,true)
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoId) .params("videoid", videoId)
.params("random_str", s) .params("random_str", s)
.execute(CommonHttpUtil.NO_CALLBACK); .execute(CommonHttpUtil.NO_CALLBACK);
@ -295,8 +263,7 @@ public class VideoHttpUtil {
VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_WATCH_END); VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_WATCH_END);
String s = MD5Util.getMD5(uid + "-" + videoId + "-" + VIDEO_SALT); String s = MD5Util.getMD5(uid + "-" + videoId + "-" + VIDEO_SALT);
HttpClient.getInstance().get("Video.setConversion", VideoHttpConsts.VIDEO_WATCH_END) HttpClient.getInstance().get("Video.setConversion", VideoHttpConsts.VIDEO_WATCH_END)
.params("uid", uid) .params("uid", uid,true)
.params("token", CommonAppConfig.getInstance().getToken())
.params("videoid", videoId) .params("videoid", videoId)
.params("random_str", s) .params("random_str", s)
.execute(CommonHttpUtil.NO_CALLBACK); .execute(CommonHttpUtil.NO_CALLBACK);