Exemple #1
0
        public GenericListResponse <RoomResponse> GetOwnerRooms()
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericListResponse <RoomResponse>(""));
            }

            RoomQueryService queryService = new RoomQueryService();

            return(queryService.GetRoomsByOwner(userId.Value));
        }
        public GenericListResponse <RoomResponse> GetNearbyCity([FromQuery] string city, [FromQuery] string name, [FromQuery] int skip = 0, [FromQuery] int take = 10)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner, UserRole.Coach);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericListResponse <RoomResponse>(""));
            }

            RoomQueryService queryService = new RoomQueryService();

            return(queryService.GetRoomsByNameOrCity(userId, city, name, skip, take));
        }
        public GenericListResponse <RoomResponse> GetNearbyRooms([FromQuery] decimal lat, [FromQuery] decimal lon, [FromQuery] int radius,
                                                                 [FromQuery] int skip = 0, [FromQuery] int take = 10)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner, UserRole.Coach);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericListResponse <RoomResponse>(""));
            }

            RoomQueryService queryService = new RoomQueryService();

            return(queryService.GetRoomsByLatLonAndRadius(userId, lat, lon, radius, skip, take));
        }
        public GenericObjectResponse <RoomResponse> GetRoomById(long roomId, [FromQuery] bool expand = false)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner, UserRole.Coach);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericObjectResponse <RoomResponse>(""));
            }

            RoomQueryService queryService = new RoomQueryService();
            var room = queryService.GetRoomById(roomId, userId, expand);

            if (!room.Status.Success)
            {
                Response.StatusCode = 404;
            }

            return(room);
        }
        public GenericListResponse <AvailableReservationTime> GetRoomAvailableTimes(long roomId, [FromQuery] DateTime?startDate, [FromQuery] int duration, int take = 10)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner, UserRole.Coach);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericListResponse <AvailableReservationTime>(""));
            }

            RoomQueryService queryService = new RoomQueryService();
            var availableTimes            = queryService.GetRoomAvailableTimes(roomId, startDate, duration, take);

            if (!availableTimes.Status.Success)
            {
                Response.StatusCode = 404;
            }

            return(availableTimes);
        }
 /// <inheritdoc />
 public Task StopMovementAsync(Vector3 position, Quaternion rotation)
 {
     return(SendService.SendMessage(new Sub60FinishedMovingCommand(PlayerSlotModel.SlotSelected,
                                                                   UnitScaler.ScaleYRotation(rotation.eulerAngles.y),
                                                                   UnitScaler.UnScale(position).ToNetworkVector3(), RoomQueryService.RoomIdForPlayerById(PlayerSlotModel.SlotSelected), ZoneData.ZoneId).ToPayload()));
 }