示例#1
0
        public async Task ManualTest()
        {
            var jwtTokenService = new JwtTokenService();

            var config = new Dictionary <string, string>
            {
                { "EC2Tags:Environment", "dev" },
                { "EC2Tags:Customer", "reddeer" },
                { "RefinitivTickPriceHistoryApiAddress", "https://localhost:8890" }
            };

            var configuration = new ConfigurationBuilder()
                                .AddInMemoryCollection(config)
                                .Build();

            var refinitivTickPriceHistoryApiConfig = new RefinitivTickPriceHistoryApiConfig
            {
                RefinitivTickPriceHistoryApiAddress = "https://localhost:8890",
                RefinitivTickPriceHistoryApiJwtBearerTokenSymetricSecurityKey = "nfPA%sowa62L9U$DxWyqD2xXRZrBvH7iWBtdqhWu!U^1qTklZS"
            };

            var factory = new TickPriceHistoryServiceClientFactory(refinitivTickPriceHistoryApiConfig, configuration, jwtTokenService);
            var refinitivTickPriceHistoryApi = new RefinitivTickPriceHistoryApi(factory);

            var response = await refinitivTickPriceHistoryApi.GetInterdayTimeBars(DateTime.UtcNow.Date.AddDays(-2), DateTime.UtcNow.Date);
        }
        public IRefinitivTickPriceHistoryApiConfig BuildRefinitivTickPriceHistoryApiConfig(IConfigurationRoot configurationBuilder)
        {
            lock (this._lock)
            {
                this.Ec2Check();

                var config = new RefinitivTickPriceHistoryApiConfig
                {
                    RefinitivTickPriceHistoryApiAddress = this.GetValue("RefinitivTickPriceHistoryApiAddress", configurationBuilder),
                    RefinitivTickPriceHistoryApiJwtBearerTokenSymetricSecurityKey = this.GetValue("RefinitivTickPriceHistoryApiJwtBearerTokenSymetricSecurityKey", configurationBuilder),
                    RefinitivTickPriceHistoryApiPollingSeconds         = this.GetSettingOrDefault("RefinitivTickPriceHistoryApiPollingSeconds", configurationBuilder, 60),
                    RefinitivTickPriceHistoryApiTimeOutDurationSeconds = this.GetSettingOrDefault("RefinitivTickPriceHistoryApiTimeOutDurationSeconds", configurationBuilder, 600)
                };

                return(config);
            }
        }