Ejemplo n.º 1
0
 /// <summary>
 ///     创建 <see cref="UserController" />
 /// </summary>
 /// <param name="coupon">
 ///     <see cref="CouponProvider" />
 /// </param>
 /// <param name="owinContextProvider">
 ///     <see cref="OwinContextProvider" />
 /// </param>
 /// <param name="dbContext">
 ///     <see cref="KeylolDbContext" />
 /// </param>
 /// <param name="userManager">
 ///     <see cref="KeylolUserManager" />
 /// </param>
 /// <param name="oneTimeToken">
 ///     <see cref="OneTimeTokenProvider" />
 /// </param>
 /// <param name="roleManager"><see cref="KeylolRoleManager"/></param>
 public UserController(CouponProvider coupon, OwinContextProvider owinContextProvider, KeylolDbContext dbContext,
                       KeylolUserManager userManager, OneTimeTokenProvider oneTimeToken, KeylolRoleManager roleManager)
 {
     _coupon       = coupon;
     _owinContext  = owinContextProvider.Current;
     _dbContext    = dbContext;
     _userManager  = userManager;
     _oneTimeToken = oneTimeToken;
     _roleManager  = roleManager;
 }
        /// <summary>
        ///     创建 <see cref="SteamBotCoordinator" />
        /// </summary>
        public SteamBotCoordinator(RetryPolicy retryPolicy, MqClientProvider mqClient, OneTimeTokenProvider oneTimeToken)
        {
            _retryPolicy  = retryPolicy;
            _mqChannel    = mqClient.CreateModel();
            _oneTimeToken = oneTimeToken;

            Sessions[SessionId] = this;
            OperationContext.Current.InstanceContext.Closing += OnSessionEnd;
            OnSessionBegin();
        }