public MpPayApiController( IWeChatPayNotifyClient client, IMQService mqService, ILogger <MpPayApiController> logger, IOptionsMonitor <MiniProgramOptions> options) { _client = client; _mqService = mqService; _logger = logger; _options = options.CurrentValue; }
public MPApiController( IAppSettingService appSettingService, IAccountService accountService, IRepository <UserLogin> userLoginRepository, UserManager <User> userManager, SignInManager <User> signInManager, ILoggerFactory loggerFactory, IConfiguration configuration, IRepository <User> userRepository, ITokenService tokenService) { _option = appSettingService.Get <MiniProgramOptions>().Result; _userLoginRepository = userLoginRepository; _userManager = userManager; _signInManager = signInManager; _userRepository = userRepository; _tokenService = tokenService; }
public MPApiController( IAppSettingService appSettingService, IAccountService accountService, IRepository <UserLogin> userLoginRepository, UserManager <User> userManager, SignInManager <User> signInManager, ILoggerFactory loggerFactory, IConfiguration configuration, IRepository <User> userRepository, ITokenService tokenService, IOptionsMonitor <MiniProgramOptions> options) { _option = options.CurrentValue; _userLoginRepository = userLoginRepository; _userManager = userManager; _signInManager = signInManager; _userRepository = userRepository; _tokenService = tokenService; }
public void Build(ModelBuilder modelBuilder) { var cfg = GlobalConfiguration.Configuration; var miniProgramOptions = new MiniProgramOptions() { AppId = cfg[$"{nameof(MiniProgramOptions)}:{nameof(MiniProgramOptions.AppId)}"], AppSecret = cfg[$"{nameof(MiniProgramOptions)}:{nameof(MiniProgramOptions.AppSecret)}"], MchId = cfg[$"{nameof(MiniProgramOptions)}:{nameof(MiniProgramOptions.MchId)}"], Key = cfg[$"{nameof(MiniProgramOptions)}:{nameof(MiniProgramOptions.Key)}"] }; modelBuilder.Entity <AppSetting>().HasData( new AppSetting(nameof(MiniProgramOptions)) { Module = "MiniProgram", IsVisibleInCommonSettingPage = true, Value = JsonConvert.SerializeObject(miniProgramOptions), FormatType = AppSettingFormatType.Json, Type = typeof(MiniProgramOptions).AssemblyQualifiedName }); }