Beispiel #1
0
        /// <inheritdoc/>
        public async Task <Room> UpdateRoomAsync(string roomId, string title)
        {
            var props = new RoomParams {
                Title = title
            };

            return(await TeamsClient.PutResultAsync <Room, RoomParams>($"{WxTeamsConstants.RoomsUrl}/{roomId}", props));
        }
Beispiel #2
0
        public async Task <PagedList <Room> > GetRooms(RoomParams param)
        {
            var rooms = _context.Rooms.AsQueryable();
            var list  = await PagedList <Room>
                        .CreateAsync(rooms, param.PageNumber, param.PageSize);

            return(list);
        }
Beispiel #3
0
        /// <inheritdoc/>
        public async Task <Room> CreateRoomAsync(string title, string teamId = null)
        {
            var props = new RoomParams {
                Title = title, TeamId = teamId
            };

            return(await TeamsClient.PostResultAsync <Room, RoomParams>(WxTeamsConstants.RoomsUrl, props));
        }
Beispiel #4
0
        public async Task <IActionResult> GetRooms([FromQuery] RoomParams param)
        {
            var rooms = await _repo.GetRooms(param);

            Response.AddPagination(rooms.CurrentPage, rooms.PageSize, rooms.TotalCount, rooms.TotalPages);
            var roomToReturn = _mapper.Map <IEnumerable <RoomToReturn> >(rooms);

            return(Ok(roomToReturn));
        }
Beispiel #5
0
        //TODO: implement
        public static Result ValidateRoomParams(RoomParams roomParams, Player player)
        {
            var response = WebService.Post <dynamic, object>("http://35.195.58.247/api/mm", new { token = player.Token });

            if (response.info != null && roomParams.Bet < response.info.money.Value && roomParams.Rang == response.info.rank.Value &&
                ((IEnumerable <string>)(response.info.fractions.Value.Split(','))).Any(f => f == roomParams.Fraction))
            {
                return(Result.Ok);
            }
            return(new Result("Validation room params error"));
        }
Beispiel #6
0
 //TODO: implement
 public static Result ValidateRoomParams(RoomParams roomParams, Player player)
 {
     return(Result.Ok);
 }
Beispiel #7
0
 public Room(HBPlayer player, RoomParams roomParams)
 {
     Owner  = player;
     Params = roomParams;
 }