userSendMsg static method
@Author: yuer msgType:1 //'消息类型: 1在线客服,2充值客服,3游戏客服,4私信,5系统消息' contentType: 1'消息内容类型:1文本 2图片', targetUserId:10 对方用户id content:'' 消息内容 @description: 聊天历史消息 @return {*}
Implementation
static userSendMsg(obj, callBack, {Function(ErrorEntity)? onError}) {
// var obj = {'pageNo': 1, 'pageSize': 10};
DioManager().request<dynamic>(RequestType.POST, RequestApi.apiUserSendMsg, 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
onError?.call(error);
}, onStart: () {
// onStart
}, onFinish: () {
// onFinish
});
}