using Assets.MyGame.Scripts.Net.API; using Assets.MyGame.Scripts.Net.APIRequest.Objs; using Assets.MyGame.Scripts.Net.APIRequest.Params; using Assets.MyGame.Scripts.Net.APIResponses.Customer_SubClass; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; namespace Assets.MyGame.Scripts.Net { public static partial class APIRequestList { #region Customer /// /// 发起会话(POST) /// 参数:userId、userName /// 返回:ConversationInfo(会话信息) /// public static void StartConversation(StartConversationObj req, Action callback) { APIManager.Response(APIType.Customer_Start, req, callback); } /// /// 发送消息(POST) /// 参数:conversationId、senderType、senderId、senderName、senderAvatar、contentType、content /// 返回:CustomerMessageInfo(消息信息) /// public static void SendMessage(SendMessageObj req, Action callback) { APIManager.Response(APIType.Customer_Message, req, callback); } /// /// 获取消息列表(GET) /// 参数:conversationId /// 返回:List(消息列表) /// public static void GetMessages(string conversationId, Action> callback) { APIManager.Response>(APIType.Customer_Messages, new GetMessagesParam { conversationId = conversationId }, callback); } /// /// 获取会话列表(GET) /// 参数:customerId(可选) /// 返回:List(会话列表) /// public static void GetConversations(Action> callback) { APIManager.Response>(APIType.Customer_Conversations, callback); } /// /// 获取会话列表(GET,带客服ID筛选) /// 参数:customerId /// 返回:List(会话列表) /// public static void GetConversations(string customerId, Action> callback) { APIManager.Response>(APIType.Customer_Conversations, new GetConversationsParam { customerId = customerId }, callback); } /// /// 结束会话(POST) /// 参数:conversationId /// 返回:string(结果提示) /// public static void EndConversation(EndConversationObj req, Action callback) { APIManager.Response(APIType.Customer_End, req, callback); } /// /// 获取在线客服列表(GET) /// 返回:List(在线客服列表) /// public static void GetOnlineCustomers(Action> callback) { APIManager.Response>(APIType.Customer_Online, callback); } /// /// 更新客服状态(POST) /// 参数:userId、status(0:离线 1:在线) /// 返回:string(结果提示) /// public static void UpdateCustomerStatus(UpdateCustomerStatusObj req, Action callback) { APIManager.Response(APIType.Customer_Status, req, callback); } /// /// 获取聊天记录(GET) /// 参数:conversationId /// 返回:List(聊天记录列表) /// public static void GetChatLog(string conversationId, Action> callback) { APIManager.Response>(APIType.Customer_ChatLog, new GetMessagesParam { conversationId = conversationId }, callback); } /// /// 上传客服图片(POST,multipart/form-data) /// 参数:file(文件二进制) /// 返回:string(图片URL) /// public static void UploadCustomerImage(string filePath, Action callback) { APIManager.Response(APIType.ImageUpload_Upload, callback); } #endregion } }