Ejemplo n.º 1
0
 public EventService(
     HTTPService http,
     ObserverLocator observerLocator)
 {
     _http            = http;
     _observerLocator = observerLocator;
 }
Ejemplo n.º 2
0
 public CoreApiService(
     GatewayLocator serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 3
0
 public PushMessageService(
     HTTPService httpService,
     ServiceLocation serviceLocation)
 {
     _httpService     = httpService;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 4
0
        private async Task AllCheck(StatusDbContext dbContext, HTTPService http)
        {
            var items = await dbContext.MonitorRules.ToListAsync();

            foreach (var item in items)
            {
                _logger.LogInformation($"Checking status for: {item.ProjectName}");
                try
                {
                    var content = await http.Get(new AiurUrl(item.CheckAddress));

                    var success = content.Contains(item.ExpectedContent);
                    if (!success)
                    {
                        var errorMessage = $"Status check for {item.ProjectName} did not pass. Expected: {item.ExpectedContent}. Got content: {content}";
                        _logger.LogError(errorMessage);
                    }
                    item.LastHealthStatus = success;
                    item.LastCheckTime    = DateTime.UtcNow;
                    dbContext.Update(item);
                }
                catch (Exception e)
                {
                    var errorMessage = $"Status check for {item.ProjectName} did not pass. Expected: {item.ExpectedContent}. Got error: {e.Message}";
                    _logger.LogError(errorMessage);
                    item.LastHealthStatus = false;
                    item.LastCheckTime    = DateTime.UtcNow;
                }
                finally
                {
                    await dbContext.SaveChangesAsync();
                }
            }
        }
 public ChannelService(
     ServiceLocation serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 6
0
 public void PerformConversion()
 {
     try
     {
         var task = Task.Run(async() =>
         {
             StatusInfo      = Resources.msgConverting;
             string from     = SelectedFromCurrency.Code;
             string to       = SelectedToCurrency.Code;
             var uriAPI      = $"https://api.ratesapi.io/api/latest?base={from}&symbols={to}";
             var apiResponse = await HTTPService.GET_CallAsync(uriAPI);
             if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 var rate    = apiResponse.Content.ReadAsStringAsync().Result.GetValue(to);
                 var output  = _inputValueExchange * (double)rate;
                 OutputValue = $"{_inputValueExchange} {from} <--> {Math.Round(output, 4)} {to}";
                 StatusInfo  = Resources.msgConverted;
             }
             else
             {
                 MessageBox.Show(Resources.msgFailedConversion, Resources.ttlMainWindow, MessageBoxButton.OK, MessageBoxImage.Error);
                 StatusInfo = Resources.msgFailedConversion;
             }
         });
     }
     catch (Exception)
     {
         StatusInfo = Resources.msgError;
         throw;
     }
 }
Ejemplo n.º 7
0
 public ArchonApiService(
     ArchonLocator serviceLocation,
     HTTPService http)
 {
     _archonLocator = serviceLocation;
     _http          = http;
 }
Ejemplo n.º 8
0
 public EventService(
     HTTPService http,
     ServiceLocation serviceLocation)
 {
     _http            = http;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 9
0
 public SitesService(
     HTTPService http,
     ServiceLocation serviceLocation)
 {
     _http            = http;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 10
0
 public SecretService(
     ServiceLocation serviceLocation,
     HTTPService http)
 {
     _serviceLoation = serviceLocation;
     _http           = http;
 }
Ejemplo n.º 11
0
 public AccountService(
     GatewayLocator serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 12
0
 public FoldersService(
     HTTPService http,
     ServiceLocation serviceLocation)
 {
     _http            = http;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 13
0
 public AccountService(
     ServiceLocation serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 14
0
 public RecordsService(
     HTTPService http,
     WrapgateLocator serviceLocation)
 {
     _http            = http;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 15
0
 public TokenService(
     HTTPService http,
     ServiceLocation serviceLocation)
 {
     _http            = http;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 16
0
 public ChannelService(
     StargateLocator serviceLocation,
     HTTPService http)
 {
     _stargateLocator = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 17
0
        public async Task HTTPRequestTest()
        {
            var uriAPI      = $"https://api.ratesapi.io/api/latest";
            var apiResponse = await HTTPService.GET_CallAsync(uriAPI);

            Assert.True(apiResponse.StatusCode == System.Net.HttpStatusCode.OK);
        }
Ejemplo n.º 18
0
 public DeveloperApiService(
     DeveloperLocator serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 19
0
 public TokenService(
     HTTPService http,
     ProbeLocator serviceLocation)
 {
     _http            = http;
     _serviceLocation = serviceLocation;
 }
Ejemplo n.º 20
0
 public PushMessageService(
     HTTPService httpService,
     StargateLocator serviceLocation)
 {
     _httpService     = httpService;
     _stargateLocator = serviceLocation;
 }
Ejemplo n.º 21
0
 public GitHubRenderer(
     HTTPService http,
     AiurCache cache)
 {
     _http  = http;
     _cache = cache;
 }
Ejemplo n.º 22
0
 public EventService(
     HTTPService http,
     StatusLocator serviceLocation)
 {
     _http           = http;
     _statusLocation = serviceLocation;
 }
Ejemplo n.º 23
0
 public UserService(
     ServiceLocation serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 24
0
 public OSSApiService(
     ServiceLocation serviceLocation,
     HTTPService http)
 {
     _serviceLocation = serviceLocation;
     _http            = http;
 }
Ejemplo n.º 25
0
 // Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Ejemplo n.º 26
0
 public VersionChecker(
     HTTPService http,
     IConfiguration configuration
     )
 {
     _http          = http;
     _configuration = configuration;
 }
Ejemplo n.º 27
0
 public ActionResult Save(Contact contact)
 {
     if (ModelState.IsValid)
     {
         HTTPService.UpdateBpmEntityByOdatetWcfExample(contact);
     }
     return(RedirectToAction("Index"));
 }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static WeatherEn WeatherSelete(string ID)
        {
            string    url   = "http://t.weather.sojson.com/api/weather/city/" + ID;
            var       list  = HTTPService.Get(url);
            WeatherEn model = JsonConvert.DeserializeObject <WeatherEn>(list);

            return(model);
        }
Ejemplo n.º 29
0
 public SamplesController(
     StorageService storageService,
     IConfiguration configuration,
     HTTPService http)
 {
     _storageService = storageService;
     _configuration  = configuration;
     _http           = http;
 }
Ejemplo n.º 30
0
 public ActionResult Delete(Guid contactId)
 {
     if (ModelState.IsValid)
     {
         HTTPService.DeleteBpmEntityByOdataWcfExample(contactId);
         return(RedirectToAction("Index"));
     }
     return(View());
 }