示例#1
0
        private void ExecuteGetJobsDto(OrchestartorModel model)
        {
            string url  = $"https://{model.HostName}/odata/Jobs";
            var    task = HttpClientManager.ExecuteGetAsync <OrcJobsDto>(url);

            ConsoleUtil.PrintLoadingString <OrcJobsDto>(task);

            foreach (var item in task.Result.value)
            {
                CommandManager.ResultList.Add(DateTime.Now.ToString("ddss.ffffff").ToString(),
                                              $"{item.Id},{item.Key},{item.Source},{item.Info},{item.StartTime}");
                System.Threading.Thread.Sleep(100);
            }


            ConsoleUtil.PrintTable <OrcJobsDto.Value>(task.Result.value.ToList(),
                                                      new List <string>()
            {
                nameof(OrcJobsDto.Value.Id),
                nameof(OrcJobsDto.Value.Key),
                nameof(OrcJobsDto.Value.Source),
                nameof(OrcJobsDto.Value.Info),
                nameof(OrcJobsDto.Value.StartTime)
            });
            CommandManager.ResultList = new Dictionary <string, string>();
        }
示例#2
0
        private void ExecuteGetRobotsDto(OrchestartorModel model)
        {
            string url  = $"https://{model.HostName}/odata/Robots";
            var    task = HttpClientManager.ExecuteGetAsync <OrcRobotDto>(url);

            ConsoleUtil.PrintLoadingString <OrcRobotDto>(task);

            foreach (var item in task.Result.value)
            {
                CommandManager.ResultList.Add(DateTime.Now.ToString("ddss.ffffff").ToString(),
                                              $"{item.Id},{item.Name},{item.MachineName},{item.Password},{item.RobotEnvironments},{item.Username}");
                System.Threading.Thread.Sleep(100);
            }


            ConsoleUtil.PrintTable <OrcRobotDto.Value>(task.Result.value.ToList(),
                                                       new List <string>()
            {
                nameof(OrcRobotDto.Value.Id),
                nameof(OrcRobotDto.Value.Name),
                nameof(OrcRobotDto.Value.MachineName),
                nameof(OrcRobotDto.Value.Password),
                nameof(OrcRobotDto.Value.RobotEnvironments),
                nameof(OrcRobotDto.Value.Username)
            });
            CommandManager.ResultList = new Dictionary <string, string>();
        }
示例#3
0
        private async Task <Response <List <ShiftTemplate> > > CallGetTemplates(string employerId)
        {
            var parameters = new Dictionary <string, string>
            {
                {
                    "employerId", employerId
                }
            };

            return(await HttpClientManager.ExecuteGetAsync <List <ShiftTemplate> >("ShiftTemplate/GetTemplates", parameters).ConfigureAwait(false));
        }
        private async Task <Response <List <Employee> > > ChoosePeople(string skillId, string employerId,
                                                                       string areaId, DateTime localStartDateTime, DateTime localEndDateTime)
        {
            var parameters = new Dictionary <string, string>
            {
                { "skillId", skillId },
                { "employerId", employerId },
                { "areaId", areaId },
                { "localStartDateTime", localStartDateTime.ToString(DATETIME_PARSE_FORMAT, CultureInfo.InvariantCulture) },
                { "localEndDateTime", localEndDateTime.ToString(DATETIME_PARSE_FORMAT, CultureInfo.InvariantCulture) }
            };

            return(await HttpClientManager.ExecuteGetAsync <List <Employee> >(
                       "Shift/ChoosePeople", parameters).ConfigureAwait(false));
        }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private void ExecuteGetReleaseDto(OrchestartorModel model)
        {
            string url  = $"https://{model.HostName}/odata/Releases";
            var    task = HttpClientManager.ExecuteGetAsync <OrcReleaseDtoModel>(url);

            ConsoleUtil.PrintLoadingString <OrcReleaseDtoModel>(task);

            foreach (var item in task.Result.value)
            {
                CommandManager.ResultList.Add(DateTime.Now.ToString("ddss.ffffff").ToString(), $"{item.Name},{item.Key},{item.ProcessVersion}");
                System.Threading.Thread.Sleep(100);
            }

            ConsoleUtil.PrintTable <OrcReleaseDtoModel.Value>(task.Result.value.ToList(), new List <string>()
            {
                "Name", "Key", "ProcessVersion"
            });
            CommandManager.ResultList = new Dictionary <string, string>();
        }