예제 #1
0
    IEnumerator postQuery(string sendLine)
    {
        QueryOut parms = new QueryOut();

        sendLine    = sendLine.Replace("%HESITATION", "");
        parms.query = sendLine;
        byte[] bytes = Encoding.UTF8.GetBytes(JsonUtility.ToJson(parms));
        //Dictionary<String, String> headers = new Dictionary<String, String>();
        //headers.Add ("Content-type", "application/json");
        string url = backendRootURL + "conversations/" + conversationNum.ToString() + "/query/";

        print("Sending \"" + sendLine + "\"");
        //WWW response = new WWW(url, bytes, headers);
        //yield return response;
        yield return(PostJSON(url, bytes));

        QueryIn reply = JsonUtility.FromJson <QueryIn>(_json);

        print(_json);
        _json        = "";
        receivedText = reply.reply;
        if (_voice)
        {
            _queryResources.Enqueue(reply.resource);
        }
        lineToSend = "";
    }
예제 #2
0
 public JsonResult List(QueryOut queryOut)
 {
     return(new JsonResult(new SingleResponse
     {
         TotalCount = outboundService.TotalCount(queryOut),
         Data = outboundService.PageList(queryOut)
     }));
 }
예제 #3
0
 public int TotalCount(QueryOut queryOut)
 {
     return(this.Query(queryOut).Count());
 }
예제 #4
0
        private IQueryable <TOut> Query(QueryOut queryOut)
        {
            var query = wmsoutbound.TOuts;

            return(query);
        }
예제 #5
0
 public List <TOut> PageList(QueryOut queryOut)
 {
     return(this.Query(queryOut).OrderByDescending(x => x.Id).ToList());
 }