コード例 #1
0
        /// <summary>
        /// Starts app-chain
        /// </summary>
        /// <param name="appCode">code of app-chain</param>
        /// <param name="pars">app-chain parameters</param>
        /// <returns></returns>
        public StartAppRs StartAppChain(string appCode, Dictionary <string, string> pars)
        {
            var _restClient     = CreateClient();
            var _restRequest    = CreateRq("StartApp", Method.POST);
            var _appStartParams = new AppStartParams
            {
                AppCode = appCode,
                Pars    = new List <NewJobParameter>()
            };

            foreach (var _par in pars)
            {
                _appStartParams.Pars.Add(new NewJobParameter(_par.Key, _par.Value));
            }
            _restRequest.AddParameter(new Parameter
            {
                Name  = "application/json",
                Value = JsonConvert.SerializeObject(_appStartParams),
                Type  = ParameterType.RequestBody
            });
            var _restResponse = RunRq(_restClient, _restRequest);

            return(JsonConvert.DeserializeObject <StartAppRs>(_restResponse.Content));
        }
コード例 #2
0
 /// <summary>
 /// Starts app-chain
 /// </summary>
 /// <param name="appCode">code of app-chain</param>
 /// <param name="pars">app-chain parameters</param>
 /// <returns></returns>
 public StartAppRs StartAppChain(string appCode, Dictionary<string, string> pars)
 {
     var _restClient = CreateClient();
     var _restRequest = CreateRq("StartApp", Method.POST);
     var _appStartParams = new AppStartParams
                           {
                               AppCode = appCode,
                               Pars = new List<NewJobParameter>()
                           };
     foreach (var _par in pars)
         _appStartParams.Pars.Add(new NewJobParameter(_par.Key, _par.Value));
     _restRequest.AddParameter(new Parameter
                               {
                                   Name = "application/json",
                                   Value = JsonConvert.SerializeObject(_appStartParams),
                                   Type = ParameterType.RequestBody
                               });
     var _restResponse = RunRq(_restClient, _restRequest);
     return JsonConvert.DeserializeObject<StartAppRs>(_restResponse.Content);
 }