Ejemplo n.º 1
0
 // /Api/Admin/{action}
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="tokenValidationSettings"></param>
 /// <param name="frontendSettingsOptions"></param>
 /// <param name="userService"></param>
 /// <param name="adminUserService"></param>
 /// <param name="notificationService"></param>
 /// <param name="permissionService"></param>
 /// <param name="groupService"></param>
 /// <param name="roleService"></param>
 /// <param name="bulletinService"></param>
 /// <param name="permissionProviders"></param>
 /// <param name="menuProviders"></param>
 public AdminController(
     TokenValidationSettings tokenValidationSettings,
     IOptions <FrontendSettings> frontendSettingsOptions,
     IUserService userService,
     IAdminUserService adminUserService,
     INotificationService notificationService,
     IPermissionService permissionService,
     IGroupService groupService,
     IRoleService roleService,
     IBulletinService bulletinService,
     IEnumerable <IPermissionProvider> permissionProviders,
     IEnumerable <IMenuProvider> menuProviders)
 {
     _tokenValidationSettings = tokenValidationSettings;
     _frontendSettings        = frontendSettingsOptions.Value;
     _userService             = userService;
     _adminUserService        = adminUserService;
     _notificationService     = notificationService;
     _permissionService       = permissionService;
     _groupService            = groupService;
     _roleService             = roleService;
     _bulletinService         = bulletinService;
     _permissionProviders     = permissionProviders;
     _menuProviders           = menuProviders;
 }
Ejemplo n.º 2
0
 // /Api/Admin/{action}
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="environment"></param>
 /// <param name="tokenValidationSettings"></param>
 /// <param name="tokenService"></param>
 /// <param name="frontendSettingsOptions"></param>
 /// <param name="avatarSettingsOptions"></param>
 /// <param name="userService"></param>
 /// <param name="adminUserService"></param>
 /// <param name="notificationService"></param>
 /// <param name="permissionService"></param>
 /// <param name="groupService"></param>
 /// <param name="roleService"></param>
 /// <param name="bulletinService"></param>
 /// <param name="userActionLogService"></param>
 /// <param name="moduleMetaDataProviders"></param>
 /// <param name="menuProviders"></param>
 /// <param name="logger"></param>
 public AdminController(
     IHostingEnvironment environment,
     TokenValidationSettings tokenValidationSettings,
     ITokenService tokenService,
     IOptions <FrontendSettings> frontendSettingsOptions,
     IOptions <AvatarSettings> avatarSettingsOptions,
     IUserService userService,
     IAdminUserService adminUserService,
     INotificationService notificationService,
     IPermissionService permissionService,
     IGroupService groupService,
     IRoleService roleService,
     IBulletinService bulletinService,
     IUserActionLogService userActionLogService,
     IEnumerable <IModuleMetaDataProvider> moduleMetaDataProviders,
     IEnumerable <IMenuProvider> menuProviders,
     ILogger <AdminController> logger)
 {
     _environment             = environment;
     _tokenValidationSettings = tokenValidationSettings;
     _tokenService            = tokenService;
     _frontendSettings        = frontendSettingsOptions.Value;
     _avatarSettings          = avatarSettingsOptions.Value;
     _userService             = userService;
     _adminUserService        = adminUserService;
     _notificationService     = notificationService;
     _permissionService       = permissionService;
     _groupService            = groupService;
     _roleService             = roleService;
     _bulletinService         = bulletinService;
     _userActionLogService    = userActionLogService;
     _moduleMetaDataProviders = moduleMetaDataProviders;
     _menuProviders           = menuProviders;
     _logger = logger;
 }
Ejemplo n.º 3
0
        public AppSettingsController(IOptions <FrontendSettings> options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _settings = options.Value;
        }
        public IActionResult Get()
        {
            IActionResult result  = this.StatusCode(500);
            string        message = string.Empty;

            var model = new FrontendSettings();

            try
            {
                this._configuration.GetSection("AzureAd").Bind(model);

                result = this.Ok(model);
            }
            catch (Exception ex)
            {
                message = $"Failed. Error in Settings.Get. {ex.Message}";
                result  = this.StatusCode(500, message);
            }

            return(result);
        }
Ejemplo n.º 5
0
 public abstract void PutSettingsBeforeInit(FrontendSettings s);
Ejemplo n.º 6
0
 public AppSettingsController(IOptions <FrontendSettings> options)
 {
     _settings = options is null
         ? throw new ArgumentNullException(nameof(options))
         : options.Value;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="frontendSettingsOptions"></param>
 public ViewController(IOptions <FrontendSettings> frontendSettingsOptions)
 {
     _frontendSettings = frontendSettingsOptions.Value;
 }