Esempio n. 1
0
 public MpPayApiController(
     IWeChatPayNotifyClient client,
     IMQService mqService,
     ILogger <MpPayApiController> logger,
     IOptionsMonitor <MiniProgramOptions> options)
 {
     _client    = client;
     _mqService = mqService;
     _logger    = logger;
     _options   = options.CurrentValue;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
        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
            });
        }