Пример #1
0
 public UserDomainService(IDapperRepository <UserInfo, long> userRepository,
                          IDapperRepository <Role, long> roleRepository,
                          IDapperRepository <UserRole, long> userRoleRepository,
                          IDapperRepository <UserUserGroupRelation, long> userUserGroupRelationRoleRepository,
                          IDapperRepository <Menu, long> menuRepository,
                          IRoleDomainService roleDomainService,
                          IUserGroupDomainService userGroupDomainService,
                          IPasswordHelper passwordHelper,
                          IMenuDomainService menuDomainService,
                          ILockerProvider lockerProvider,
                          IDapperRepository <UserGroup, long> userGroupRepository,
                          IDapperRepository <UserGroupPermission, long> userGroupPermissionRepository,
                          IDapperRepository <UserGroupOrganization, long> userGroupOrganizationDapperRepository)
 {
     _userRepository     = userRepository;
     _roleRepository     = roleRepository;
     _userRoleRepository = userRoleRepository;
     _userUserGroupRelationRepository = userUserGroupRelationRoleRepository;
     _menuRepository                        = menuRepository;
     _roleDomainService                     = roleDomainService;
     _userGroupDomainService                = userGroupDomainService;
     _passwordHelper                        = passwordHelper;
     _menuDomainService                     = menuDomainService;
     _lockerProvider                        = lockerProvider;
     _userGroupRepository                   = userGroupRepository;
     _userGroupPermissionRepository         = userGroupPermissionRepository;
     _userGroupOrganizationDapperRepository = userGroupOrganizationDapperRepository;
     _session = NullSurgingSession.Instance;
 }
Пример #2
0
 public UserGroupDomainService(IDapperRepository <UserGroup, long> userGroupRepository,
                               IDapperRepository <UserGroupRole, long> userGroupRoleRepository,
                               IDapperRepository <UserUserGroupRelation, long> userUserGroupRelationRepository,
                               IDapperRepository <UserInfo, long> userRepository,
                               IDapperRepository <Role, long> roleRepository,
                               IRoleDomainService roleDomainService,
                               ILockerProvider lockerProvider,
                               IDapperRepository <Permission, long> permissionRepository,
                               IDapperRepository <UserGroupPermission, long> userGroupPermissionRepository,
                               IOperationDomainService operationDomainService,
                               IDapperRepository <UserGroupDataPermissionOrgRelation, long> userGroupDataPermissionOrgRelationRepository,
                               IDapperRepository <UserGroupOrganization, long> userGroupOrganizationRepository)
 {
     _userGroupRepository             = userGroupRepository;
     _userGroupRoleRepository         = userGroupRoleRepository;
     _userUserGroupRelationRepository = userUserGroupRelationRepository;
     _userRepository                = userRepository;
     _roleRepository                = roleRepository;
     _roleDomainService             = roleDomainService;
     _lockerProvider                = lockerProvider;
     _permissionRepository          = permissionRepository;
     _userGroupPermissionRepository = userGroupPermissionRepository;
     _operationDomainService        = operationDomainService;
     _userGroupDataPermissionOrgRelationRepository = userGroupDataPermissionOrgRelationRepository;
     _userGroupOrganizationRepository = userGroupOrganizationRepository;
     _session       = NullSurgingSession.Instance;
     _cacheProvider = CacheContainer.GetService <ICacheProvider>(HeroConstants.CacheProviderKey);
 }
Пример #3
0
        public DeltaModelManager(Dictionary <Type, TypeConfiguration> configurations, IDeltaServiceProvider deltaServiceProvider, ILockerProvider lockerProvider)
        {
            _configurations      = configurations;
            DeltaServiceProvider = deltaServiceProvider;
            _lockerProvider      = lockerProvider;
            foreach (var type in configurations.Values)
            {
                if (!type.IsExternalType)
                {
                    if (type.ValueType != null)
                    {
                        type.Creator = (parent, property) =>
                        {
                            var t = typeof(DeltaModelDictionary <,>).MakeGenericType(type.KeyType.Type, type.ValueType.Type);
                            return(Activator.CreateInstance(t, parent, property, this, type));
                        };
                    }
                    else
                    {
                        type.Creator = (parent, property) => Create(type.Type, parent, property);
                    }
                }
            }

            Subscriptions = new SubscriptionManager(this);
        }
Пример #4
0
 public ActionDomainService(IDapperRepository <Action, long> actionRepository,
                            IDapperRepository <OperationActionRelation, long> operationActionRelationRepository,
                            ILockerProvider lockProvider)
 {
     _actionRepository = actionRepository;
     _operationActionRelationRepository = operationActionRelationRepository;
     _lockerProvider = lockProvider;
 }
Пример #5
0
 public MenuDomainService(IDapperRepository <Menu, long> menuRepository,
                          IDapperRepository <Permission, long> permissionRepository,
                          IDapperRepository <Operation, long> operationRepository,
                          IDapperRepository <OperationActionRelation, long> operationActionRepository,
                          ILockerProvider lockerProvider)
 {
     _menuRepository            = menuRepository;
     _permissionRepository      = permissionRepository;
     _operationRepository       = operationRepository;
     _operationActionRepository = operationActionRepository;
     _lockerProvider            = lockerProvider;
 }
Пример #6
0
 public ZooKeeperMqttServiceRouteManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                         ISerializer <string> stringSerializer, IMqttServiceFactory mqttServiceFactory,
                                         ILogger <ZooKeeperMqttServiceRouteManager> logger, IZookeeperClientProvider zookeeperClientProvider,
                                         ILockerProvider lockerProvider) : base(stringSerializer)
 {
     _configInfo              = configInfo;
     _serializer              = serializer;
     _mqttServiceFactory      = mqttServiceFactory;
     _logger                  = logger;
     _zookeeperClientProvider = zookeeperClientProvider;
     _lockerProvider          = lockerProvider;
     EnterRoutes().Wait();
 }
Пример #7
0
 public RoleDomainService(IDapperRepository <Role, long> roleRepository,
                          IDapperRepository <RolePermission, long> rolePermissionRepository,
                          IDapperRepository <Permission, long> permissionRepository,
                          IDapperRepository <UserRole, long> userRoleRepository,
                          IDapperRepository <UserGroupRole, long> userGroupRoleRepository,
                          IDapperRepository <Operation, long> operationRepository,
                          ILockerProvider lockerProvider,
                          IDapperRepository <RoleDataPermissionOrgRelation, long> roleDataPermissionOrgRelationRepository,
                          IDapperRepository <RoleOrganization, long> roleOrganizationRepository,
                          IDapperRepository <Permissions.Actions.Action, long> actionRepository)
 {
     _roleRepository           = roleRepository;
     _rolePermissionRepository = rolePermissionRepository;
     _permissionRepository     = permissionRepository;
     _userRoleRepository       = userRoleRepository;
     _userGroupRoleRepository  = userGroupRoleRepository;
     _operationRepository      = operationRepository;
     _lockerProvider           = lockerProvider;
     _roleDataPermissionOrgRelationRepository = roleDataPermissionOrgRelationRepository;
     _roleOrganizationRepository = roleOrganizationRepository;
     _actionRepository           = actionRepository;
     _session       = NullSurgingSession.Instance;
     _cacheProvider = CacheContainer.GetService <ICacheProvider>(HeroConstants.CacheProviderKey);
 }
Пример #8
0
 protected ServiceRouteManagerBase(ServiceRouteCache serviceRouteCache,
                                   IServiceEntryManager serviceEntryManager,
                                   ILockerProvider lockerProvider,
                                   IOptions <RegistryCenterOptions> registryCenterOptions,
                                   IOptions <RpcOptions> rpcOptions)
 {
     _serviceRouteCache     = serviceRouteCache;
     _serviceEntryManager   = serviceEntryManager;
     _lockerProvider        = lockerProvider;
     _registryCenterOptions = registryCenterOptions.Value;
     _rpcOptions            = rpcOptions.Value;
     Check.NotNullOrEmpty(_registryCenterOptions.RoutePath, nameof(_registryCenterOptions.RoutePath));
     Check.NotNullOrEmpty(_rpcOptions.Token, nameof(_rpcOptions.Token));
     _serviceRouteCache.OnRemoveServiceRoutes += async descriptors =>
     {
         if (_rpcOptions.RemoveUnhealthServer)
         {
             foreach (var descriptor in descriptors)
             {
                 await RegisterRouteWithLockAsync(descriptor);
             }
         }
     };
 }
Пример #9
0
        public DeltaModelManager <T> Build <T>(IDeltaServiceProvider deltaServiceProvider = null, ILockerProvider locker = null)
        {
            BuildModel(typeof(T));

            if (locker == null)
            {
                locker = new MultiThreadLockerProvider();
            }
            var manager = new DeltaModelManager <T>(_configurations, deltaServiceProvider, locker);

            locker.SetManager(manager);
            return(manager);
        }