Beispiel #1
0
 public PreCheckHostedService(
     ILogger <PreCheckHostedService> logger
     , IConfiguration configuration
     , IOptionsMonitor <SecurityOptions> securityOptions
     , CookieStrFactory cookieStrFactory
     )
 {
     _logger           = logger;
     _configuration    = configuration;
     _securityOptions  = securityOptions.CurrentValue;
     _cookieStrFactory = cookieStrFactory;
 }
 public BiliBiliToolHostedService(
     IHostApplicationLifetime applicationLifetime
     , IServiceProvider serviceProvider
     , IConfiguration configuration
     , ILogger <BiliBiliToolHostedService> logger
     , CookieStrFactory cookieStrFactory
     )
 {
     _applicationLifetime = applicationLifetime;
     _serviceProvider     = serviceProvider;
     _configuration       = configuration;
     _logger           = logger;
     _cookieStrFactory = cookieStrFactory;
 }
Beispiel #3
0
 public BiliBiliToolConsoleService(
     IServiceProvider serviceProvider,
     IHostApplicationLifetime applicationLifetime,
     ILogger <BiliBiliToolConsoleService> logger,
     IConfiguration configuration,
     IOptionsMonitor <SecurityOptions> securityOptions,
     CookieStrFactory cookieStrFactory
     )
 {
     _serviceProvider     = serviceProvider;
     _applicationLifetime = applicationLifetime;
     _logger           = logger;
     _configuration    = configuration;
     _securityOptions  = securityOptions.CurrentValue;
     _cookieStrFactory = cookieStrFactory;
 }
Beispiel #4
0
        public BiliCookie(ILogger <BiliCookie> logger,
                          CookieStrFactory cookieStrFactory)
            : base(cookieStrFactory.GetCurrentCookieStr())
        {
            _logger = logger;

            if (CookieItemDictionary.TryGetValue(GetPropertyDescription(nameof(UserId)), out string userId))
            {
                UserId = userId;
            }
            if (CookieItemDictionary.TryGetValue(GetPropertyDescription(nameof(BiliJct)), out string jct))
            {
                BiliJct = jct;
            }
            if (CookieItemDictionary.TryGetValue(GetPropertyDescription(nameof(SessData)), out string sess))
            {
                SessData = sess;
            }

            this.Check();
        }