コード例 #1
0
 public GroupUserService(
     IAuthorizedUserHelper authorizedUserHelper,
     IGroupUserRepository groupUserRepository,
     IGroupUserStore groupUserStore,
     IGroupEventService groupEventService,
     IGroupRepository groupRepository,
     IChannelEventService channelEventService,
     IChannelUserRepository channelUserRepository,
     IChannelUserStore channelUserStore,
     IChatEventService chatEventService,
     IChatUserRepository chatUserRepository,
     IChatUserStore chatUserStore,
     IChatService chatService,
     IUserRepository userRepository,
     IMailService mailService,
     IMapper mapper
     )
 {
     _groupUserRepository   = groupUserRepository;
     _groupUserStore        = groupUserStore;
     _groupEventService     = groupEventService;
     _groupRepository       = groupRepository;
     _channelEventService   = channelEventService;
     _channelUserRepository = channelUserRepository;
     _channelUserStore      = channelUserStore;
     _chatUserRepository    = chatUserRepository;
     _chatUserStore         = chatUserStore;
     _chatEventService      = chatEventService;
     _chatService           = chatService;
     _userRepository        = userRepository;
     _mailService           = mailService;
     _mapper         = mapper;
     _authorizedUser = authorizedUserHelper.GetAuthorizedUser();
 }
コード例 #2
0
ファイル: GroupService.cs プロジェクト: orzech123123/callgate
        public GroupResponse Create(string name, string description)
        {
            var group = new Models.Group
            {
                Id          = Guid.NewGuid(),
                Name        = name,
                Description = description
            };

            var user              = _authorizedUserHelper.GetAuthorizedUser();
            var groupUser         = new GroupUser(user, group, Role.Admin);
            var documentGroupUser = new Documents.GroupUser(user.Id, group.Id);

            _groupUserRepository.Add(groupUser);
            _groupUserStore.AddToBus(documentGroupUser);

            _groupEventService.AddGroupCreatedEvent(group, _user);
            _groupEventService.AddUserAddedToGroupEvent(group, _user, _user);

            _mailService.SendMail(
                user.Email,
                "CallGate - New group created successfully",
                $"Congratz! You created a new group '{name}'."
                );

            return(_mapper.Map <GroupResponse>(group));
        }
コード例 #3
0
        public void RequireValidPasswordForAuthorizedUser(string password)
        {
            var authorizedUser = _authorizedUserHelper.GetAuthorizedUser();
            var user           = _authenticationService.GetUserByUserNameAndPassword(authorizedUser.Username, password);

            if (user == null)
            {
                throw new ParseApiException("Invalid password");
            }
        }
コード例 #4
0
 public GroupValidationService(
     IAuthorizedUserHelper authorizedUserHelper,
     IGroupUserRepository groupUserRepository,
     IUserValidationService userValidationService
     )
 {
     _groupUserRepository   = groupUserRepository;
     _authorizedUser        = authorizedUserHelper.GetAuthorizedUser();
     _userValidationService = userValidationService;
 }
コード例 #5
0
 public UserService(
     IAuthorizedUserHelper authorizedUserHelper,
     IUserRepository userRepository,
     IMailService mailService,
     IMapper mapper
     )
 {
     _userRepository = userRepository;
     _mailService    = mailService;
     _mapper         = mapper;
     _authorizedUser = authorizedUserHelper.GetAuthorizedUser();
 }
コード例 #6
0
 public ChatValidationService(
     IAuthorizedUserHelper authorizedUserHelper,
     IChatUserRepository chatUserRepository,
     IChatRepository chatRepository,
     IGroupValidationService groupValidationService,
     IUserValidationService userValidationService
     )
 {
     _chatUserRepository     = chatUserRepository;
     _groupValidationService = groupValidationService;
     _chatRepository         = chatRepository;
     _userValidationService  = userValidationService;
     _authorizedUser         = authorizedUserHelper.GetAuthorizedUser();
 }
コード例 #7
0
 public ChannelService(
     IAuthorizedUserHelper authorizedUserHelper,
     IGroupRepository groupRepository,
     IChannelUserRepository channelUserRepository,
     IChannelEventService channelEventService,
     IChannelUserStore channelUserStore,
     IChannelRepository channelRepository,
     IMapper mapper
     )
 {
     _groupRepository       = groupRepository;
     _channelUserRepository = channelUserRepository;
     _channelEventService   = channelEventService;
     _authorizedUser        = authorizedUserHelper.GetAuthorizedUser();
     _channelUserStore      = channelUserStore;
     _channelRepository     = channelRepository;
     _mapper = mapper;
 }
コード例 #8
0
ファイル: GroupService.cs プロジェクト: orzech123123/callgate
 public GroupService(
     IAuthorizedUserHelper authorizedUserHelper,
     IGroupUserRepository groupUserRepository,
     IGroupUserStore groupUserStore,
     IGroupRepository groupRepository,
     IGroupEventService groupEventService,
     IMailService mailService,
     IMapper mapper
     )
 {
     _authorizedUserHelper = authorizedUserHelper;
     _groupUserRepository  = groupUserRepository;
     _groupUserStore       = groupUserStore;
     _groupRepository      = groupRepository;
     _groupEventService    = groupEventService;
     _mailService          = mailService;
     _mapper = mapper;
     _user   = authorizedUserHelper.GetAuthorizedUser();
 }