package com.tejia.lijin.app.model;
|
|
import android.content.Context;
|
|
import com.tejia.lijin.app.BasicTextHttpResponseHandler;
|
import com.tejia.lijin.app.ShoppingApi;
|
import com.tejia.lijin.app.contract.MessgeContract;
|
|
import org.apache.http.Header;
|
import org.json.JSONObject;
|
|
/**
|
* 消息页面Model
|
*/
|
public class MessgeModel {
|
/**
|
* 未读消息
|
*/
|
public void getUnReadMsgCount(Context mContext, Long uid, final MessgeContract.onMessgeCallBack callBack) {
|
ShoppingApi.getUnReadMsgCount(mContext, uid, new BasicTextHttpResponseHandler() {
|
@Override
|
public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception {
|
callBack.onSuccess(jsonObject);
|
}
|
});
|
}
|
|
/**
|
* 清空未读消息
|
*/
|
public void setAllMsgRead(Context mContext, Long uid, final MessgeContract.onMessgeCallBack callBack) {
|
ShoppingApi.setAllMsgRead(mContext, uid, new BasicTextHttpResponseHandler() {
|
@Override
|
public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception {
|
callBack.onSuccess(jsonObject);
|
}
|
});
|
}
|
|
/**
|
* 消息中心红包
|
*/
|
public void getMSGConfig(Context mContext, Long uid, final MessgeContract.onMessgeCallBack callBack) {
|
ShoppingApi.getMSGConfig(mContext, uid, new BasicTextHttpResponseHandler() {
|
@Override
|
public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception {
|
callBack.onSuccess(jsonObject);
|
}
|
});
|
}
|
}
|