//public async Task<StatusData<object>> MessagePull(ChatRequest.MessageRequest request, SystemSession session) //{ // var result = new StatusData<object> { Status = SystemDbStatus.Selected }; // var chatMessagePull = new ChatMessagePull { UserId = session.UserName, PageSize = request.PageSize, DrillUp = request.DrillUp, DrillDown = request.DrillDown, Limit = request.Limit, InstanceId = request.InstanceId, LastMsg = request.LastMessage, Cursor = request.Cursor, UnreadMsg = request.UnReadMessage }; // var response = await Task.Factory.StartNew(() => _client.ChatService.msgPull(chatMessagePull, session.GetSession())).ConfigureAwait(false); // ExtractData(result, response, "error", elementsToBypass: new Collection<string> { "error" }); // return result; //} public async Task <StatusData <object> > Search(ChatRequest.SearchRequest request, SystemSession session) { var serviceRequest = new SearchQuery { Query = request.Query, InstanceId = request.InstanceId, Start = request.Start, Limit = request.Limit }; var response = await Task.Factory.StartNew(() => Client.SearchService.query(serviceRequest, session.GetSession())).ConfigureAwait(false); var result = new StatusData <object> { Status = SystemDbStatus.Selected }; Helper.Helper.ExtractData(result, JObject.FromObject(new { Response = JsonConvert.DeserializeObject <object>(response.Response), response.Channel, response.Error }), "Error", elementsToBypass: new Collection <string> { "Error" }); return(result); }
public async Task <HttpResponseMessage> Post([FromBody] ChatRequest.SearchRequest request) { var response = await _service.Search(request, Request.GetSession()).ConfigureAwait(false); return(Request.SystemResponse(response)); }
public Task <StatusData <object> > Search(ChatRequest.SearchRequest request, SystemSession session) { return(_jUnitOfWork.Chat.Search(request, session)); }