public Result <TerminalRkiTaskInfo> SearchPushRkiTasks(int pageNo, int pageSize, Nullable <SearchOrderBy> orderBy, string terminalTid, string rkiKey, PushStatus status) { IList <string> validationErrs = ValidatePageSizeAndPageNo(pageSize, pageNo); if (string.IsNullOrEmpty(terminalTid)) { validationErrs.Add(GetMsgByKey("parameterSearchPushRkiTasksTerminalTidEmpty")); } if (validationErrs.Count > 0) { return(new Result <TerminalRkiTaskInfo>(validationErrs)); } RestRequest request = new RestRequest(SEARCH_TERMINAL_RKI_KEY_LIST_URL, Method.GET); request.AddParameter(Constants.PAGINATION_PAGE_NO, pageNo.ToString()); request.AddParameter(Constants.PAGINATION_PAGE_LIMIT, pageSize.ToString()); if (orderBy != null) { request.AddParameter("orderBy", GetOrderValue(orderBy.Value)); } request.AddParameter("terminalTid", terminalTid); if (!string.IsNullOrEmpty(rkiKey)) { request.AddParameter("rkiKey", rkiKey); } request.AddParameter("status", PushStatusHelper.GetPushStatusVal(status)); var responseContent = Execute(request); TerminalRkiTaskInfoPageResponse terminalRkiTaskInfoPage = JsonConvert.DeserializeObject <TerminalRkiTaskInfoPageResponse>(responseContent); Result <TerminalRkiTaskInfo> result = new Result <TerminalRkiTaskInfo>(terminalRkiTaskInfoPage); return(result); }
public Result <PushApkHistory> SearchPushApkHistory(int pageNo, int pageSize, SearchOrderBy orderBy, string terminalTid, string appPackageName, PushStatus status) { IList <string> validationErrs = ValidatePageSizeAndPageNo(pageSize, pageNo); if (string.IsNullOrWhiteSpace(terminalTid)) { validationErrs.Add(GetMsgByKey("parameterTerminalTidEmpty")); } if (validationErrs.Count > 0) { return(new Result <PushApkHistory>(validationErrs)); } RestRequest request = new RestRequest(SEARCH_TERMINAL_APK_LIST_URL, Method.GET); request.AddParameter(Constants.PAGINATION_PAGE_NO, pageNo.ToString()); request.AddParameter(Constants.PAGINATION_PAGE_LIMIT, pageSize.ToString()); request.AddParameter("terminalTid", terminalTid); request.AddParameter("appPackageName", appPackageName); request.AddParameter("orderBy", GetOrderValue(orderBy)); request.AddParameter("status", PushStatusHelper.GetPushStatusVal(status)); var responseContent = Execute(request); ApkPushHistoryPageResponse apkPushHistoryPageDTO = JsonConvert.DeserializeObject <ApkPushHistoryPageResponse>(responseContent); Result <PushApkHistory> result = new Result <PushApkHistory>(apkPushHistoryPageDTO); return(result); }