admin
2021-05-08 f93ff67ed4681f416a653370aa1e7995a56940ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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, String 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, String 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, String 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);
            }
        });
    }
}