getNewMessage static method
dynamic
getNewMessage(
- dynamic obj,
- dynamic callBack
@Author: yuer msgType:1 //'消息类型: 1在线客服,2充值客服,3游戏客服,4私信,5系统消息' targetUserId:10 对方用户id @description: 聊天历史消息 @return {*}
Implementation
static getNewMessage(obj, callBack) {
// var obj = {'pageNo': 1, 'pageSize': 10};
DioManager().request<dynamic>(RequestType.POST, RequestApi.apiGetNewMessage, params: obj, onSuccess: (data) {
List<ChatListMo> itemList = [];
for (var item in data) {
itemList.add(ChatListMo.fromJson(item));
}
callBack(itemList);
// onSuccess
}, onError: (error) {
// when called , already show toast, then do another things
}, onStart: () {
// onStart
}, onFinish: () {
// onFinish
});
}