/// <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)); }
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); }
/// <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)); }
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)); }
//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")); }
//TODO: implement public static Result ValidateRoomParams(RoomParams roomParams, Player player) { return(Result.Ok); }
public Room(HBPlayer player, RoomParams roomParams) { Owner = player; Params = roomParams; }