import 'package:bytedesk_kefu/http/bytedesk_message_api.dart'; import 'package:bytedesk_kefu/model/jsonResult.dart'; import 'package:bytedesk_kefu/model/message.dart'; import 'package:bytedesk_kefu/model/requestAnswer.dart'; import 'package:bytedesk_kefu/model/requestCategory.dart'; import 'package:bytedesk_kefu/model/uploadJsonResult.dart'; class MessageRepository { final BytedeskMessageHttpApi bytedeskHttpApi = BytedeskMessageHttpApi(); MessageRepository(); Future sendMessageRest(String? jsonString) async { return await bytedeskHttpApi.sendMessageRest(jsonString); } Future> loadHistoryMessages( String? uid, int? page, int? size) async { return await bytedeskHttpApi.loadHistoryMessages(uid, page, size); } Future> loadTopicMessages( String? topic, int? page, int? size) async { return await bytedeskHttpApi.loadTopicMessages(topic, page, size); } Future> loadChannelMessages( String? cid, int? page, int? size) async { return await bytedeskHttpApi.loadChannelMessages(cid, page, size); } Future> loadUnreadMessages( String? wid, int? page, int? size) async { return await bytedeskHttpApi.loadUnreadMessages(wid, page, size); } Future> loadUnreadVisitorMessages(int? page, int? size) async { return await bytedeskHttpApi.loadUnreadMessagesVisitor(page, size); } Future> loadUnreadAgentMessages(int? page, int? size) async { return await bytedeskHttpApi.loadUnreadMessagesAgent(page, size); } Future queryAnswer(String? tid, String? aid, String? mid) async { return await bytedeskHttpApi.queryAnswer2(tid, aid, mid); } Future queryCategory( String? tid, String? cid) async { return await bytedeskHttpApi.queryCategory(tid, cid); } Future messageAnswer(String? wid, String? content) async { return await bytedeskHttpApi.messageAnswer(wid, content); } Future rateAnswer( String? aid, String? mid, bool? rate) async { return await bytedeskHttpApi.rateAnswer(aid, mid, rate); } Future uploadImage(String? filePath) async { return await bytedeskHttpApi.uploadImage(filePath); } Future uploadVideo(String? filePath) async { return await bytedeskHttpApi.uploadVideo(filePath); } }