Exemplo n.º 1
0
 public async Task <ResultDto> Set(
     [FromQuery, ArgValid("str-input", "name")] string name,
     [FromQuery, ArgValid("str-input", "stats")] string stats)
 {
     _statsService.AddStat(name, Int32.Parse(stats));
     return(ResultDto.Create(null));
 }
Exemplo n.º 2
0
 public async Task <ResultDto> GetMessages(
     [BindNever] User user,
     [FromQuery, ArgValid("str-input", "str-guid")] string chatId,
     [FromQuery, ArgValid("str-guid")] string last)
 {
     return(ResultDto.Create(await _directMessagesService.GetDirectMessagesAsync(user.Id, chatId, last)));
 }
Exemplo n.º 3
0
 public async Task <ResultDto> SendFirstMessage(
     [BindNever] JwtSecurityToken token,
     [FromQuery, ArgValid("str-input", "str-guid")] string userId,
     [FromQuery, ArgValid("str-input", "dr-text-message")] string text)
 {
     return(ResultDto.Create(await _directMessagesService.SendFirstMessageAsync(token, userId, "text", new TextMessage {
         Text = text
     })));
 }
Exemplo n.º 4
0
        public async Task <ResultDto> AddOrUpdate([FromBody, MyValidation] SubjectDto entity, [BindNever] User user)
        {
            var mm = await _subjectService.AddUpdateSubjectAsync(entity, user);

            var kk = new PupilSubjectDto();

            kk.Day         = mm.DayNumber;
            kk.Lesson      = mm.DayNumber;
            kk.LessonName  = mm.SubjectName;
            kk.Description = mm.Comment;
            return(ResultDto.Create(kk));
        }
Exemplo n.º 5
0
 public async Task <ResultDto> GetAll([BindNever] JwtSecurityToken token)
 {
     return(ResultDto.Create((await _usersGR.GetAllIncludeAsync(
                                  x => true,
                                  x => x.Role)).Select(x => new UserDto {
         Id = x.Id,
         Login = x.Login,
         Role = x.Role.Name,
         OnlineStatus = _onlineService.GetOnlineStatus(x.Id),
         OnlineStatusSubscriptionToken = _onlineService.CreateOnlineStatusSubscriptionToken(token.Id, x.Id),
         Banned = x.Banned != null
     })
                             ));
 }
Exemplo n.º 6
0
 public async Task <ResultDto> GetAll([BindNever] User user)
 {
     return(ResultDto.Create(await _subjectService.GetAllAsync(user)));
 }
Exemplo n.º 7
0
 public async Task <ResultDto> UpdateBaseUpdateId()
 {
     _languageStringService.UpdateBaseUpdateId();
     return(ResultDto.Create(_languageStringService.GetGlobalizationInfo()));
 }
Exemplo n.º 8
0
 public async Task <ResultDto> End([FromBody, MyValidation] EndRegisterDto entity, [BindNever] string uuid)
 {
     return(ResultDto.Create(await _registrationService.EndRegister(entity, uuid)));
 }
Exemplo n.º 9
0
 public async Task <ResultDto> GetMany([FromBody, MyValidation] GetManyUsersDto dto, [BindNever] JwtSecurityToken token)
 {
     return(ResultDto.Create(dto.GetTokens.Select(x => _userService.GetFullDtoByGetToken(token.Id, x))));
 }
Exemplo n.º 10
0
 public async Task <ResultDto> Get([FromQuery, ArgValid("str-input")] string getToken, [BindNever] JwtSecurityToken token)
 {
     return(ResultDto.Create(await _userService.GetFullDtoByGetTokenAsync(token.Id, getToken)));
 }
Exemplo n.º 11
0
 public async Task <ResultDto> RemoveLanguage([ArgValid("str-input", "lss-lng-name")] string abbName)
 {
     _languageStringService.RemoveLanguage(abbName);
     return(ResultDto.Create(null));
 }
Exemplo n.º 12
0
 public async Task <ResultDto> AddLanguage([FromBody, MyValidation] AddLanguageDto entity)
 {
     _languageStringService.AddLanguage(entity.AbbName, entity.FullName);
     return(ResultDto.Create(entity));
 }
Exemplo n.º 13
0
 public async Task <ResultDto> GetChats([BindNever] JwtSecurityToken token)
 {
     return(ResultDto.Create(await _directMessagesService.GetChatsAsync(token.Id, token.Subject)));
 }
Exemplo n.º 14
0
 public async Task <ResultDto> EndChangePassword([FromBody, MyValidation] EndChangePasswordEmailDto entity, [BindNever] string uuid)
 {
     return(ResultDto.Create(await _registrationService.EndChangePasswordEmail(entity, uuid)));
 }
Exemplo n.º 15
0
 public async Task <ResultDto> ChangePassword([FromQuery, ArgValid("str-input", "str-email")] string email)
 {
     return(ResultDto.Create(_registrationService.ChangePasswordEmail(email)));
 }
Exemplo n.º 16
0
 public async Task <ResultDto> EditLanguage([FromBody, MyValidation] GetLanguageEditDto entity)
 {
     _languageStringService.EditLanguage(entity.AbbName, entity.FullName);
     return(ResultDto.Create(null));
 }
Exemplo n.º 17
0
 public async Task <ResultDto> GetAllShort()
 {
     return(ResultDto.Create((await _usersGR.GetAllAsync()).Select(x => _userService.GetShortDto(x.Id))));
 }
Exemplo n.º 18
0
 public async Task <ResultDto> StringsByType([FromBody, MyValidation] GetLanguageStringsDto entity)
 {
     return(ResultDto.Create(_languageStringService.GetByTypeCurrent(entity.Strings)));
 }
Exemplo n.º 19
0
        public async Task <ResultDto> Unban([FromBody, MyValidation] UnbanUserDto entity)
        {
            await _banUsserService.UnbanAsync(entity.UserId);

            return(ResultDto.Create(null));
        }
Exemplo n.º 20
0
 public async Task <ResultDto> Info()
 {
     return(ResultDto.Create(_languageStringService.GetGlobalizationInfo()));
 }
Exemplo n.º 21
0
 public async Task <ResultDto> Get()
 {
     return(ResultDto.Create(_statsService.GetStats().Select(x => new StatDto {
         Name = x.Name, Points = x.Points
     })));
 }
Exemplo n.º 22
0
 public async Task <ResultDto> StringAddOrUpdate([FromBody, MyValidation] AddOrUpdateStringDto entity)
 {
     _languageStringService.AddOrUpdateString(entity.Name, _languageStringService.GetCurrentLanguage(), entity.String);
     return(ResultDto.Create(null));
 }
Exemplo n.º 23
0
 public async Task <ResultDto> Name(
     [FromQuery, ArgValid("str-input", "name")] string name)
 {
     return(ResultDto.Create(null));
 }
Exemplo n.º 24
0
 public async Task <ResultDto> Start([FromQuery, MyValidation] StartRegisterDto entity)
 {
     return(ResultDto.Create(_registrationService.StartRegister(entity.Email, new Role {
         Name = "Pupil"
     })));
 }