Пример #1
0
        public async Task <IActionResult> GetByClientId(Guid clientId)
        {
            var response = await _mediator.Send(new RentQueryRequest(id : clientId, isClientId : true));

            return(CustomResponse.GetResponse(response));
        }
Пример #2
0
        public async Task <IActionResult> GetAllFinished()
        {
            var response = await _mediator.Send(new RentQueryRequest(isActive : false));

            return(CustomResponse.GetResponse(response));
        }
Пример #3
0
        public async Task <IActionResult> GetById(Guid id)
        {
            var response = await _mediator.Send(new RentQueryRequest(id : id));

            return(CustomResponse.GetResponse(response));
        }
Пример #4
0
        public async Task <IActionResult> Post([FromBody] CreateRentCommandRequest createRentCommand)
        {
            var response = await _mediator.Send(createRentCommand);

            return(CustomResponse.GetResponse(response));
        }
Пример #5
0
        public async Task <IActionResult> Put(Guid id)
        {
            var response = await _mediator.Send(new FinishRentCommandRequest(id : id));

            return(CustomResponse.GetResponse(response));
        }
Пример #6
0
        public async Task <IActionResult> GetAll()
        {
            var response = await _mediator.Send(new GameQueryRequest());

            return(CustomResponse.GetResponse(response));
        }
Пример #7
0
        public async Task <IActionResult> GetAllRented()
        {
            var response = await _mediator.Send(new GameQueryRequest(isAvailable : false));

            return(CustomResponse.GetResponse(response));
        }
Пример #8
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var response = await _mediator.Send(new DeleteGameCommandRequest(id : id));

            return(CustomResponse.GetResponse(response));
        }
Пример #9
0
        public async Task <IActionResult> Put([FromBody] UpdateGameCommandRequest updateGameCommand)
        {
            var response = await _mediator.Send(updateGameCommand);

            return(CustomResponse.GetResponse(response));
        }
Пример #10
0
        public async Task <IActionResult> GetByRole(UserRoleType role)
        {
            var response = await _mediator.Send(new ClientQueryRequest(role : role));

            return(CustomResponse.GetResponse(response));
        }
Пример #11
0
        public async Task <IActionResult> GetAll(string username)
        {
            var response = await _mediator.Send(new ClientQueryRequest(username : username));

            return(CustomResponse.GetResponse(response));
        }
Пример #12
0
        public async Task <IActionResult> Authenticate([FromBody] LoginCommandRequest login)
        {
            var response = await _mediator.Send(login);

            return(CustomResponse.GetResponse(response));
        }