示例#1
0
        public async Task <IActionResult> GetUser(long id)
        {
            if (!_customAuth.IsUserAllowedAccess(id, HttpContext))
            {
                return(StatusCode(401, new ApiResponseDto <UserDto>(401, "Unauthorized", "Authorization error", null)));
            }

            var response = await _userService.GetUserById(id);

            return(StatusCode(response.Status, response));
        }
            public async Task <ActionResult> GetTransaction(long userId, long transactionId)
            {
                if (!_customAuth.IsUserAllowedAccess(userId, HttpContext))
                {
                    return(StatusCode(401));
                }

                var response = await _tranService.GetTransaction(transactionId);

                return(StatusCode(response.Status, response));
            }
        public async Task <IActionResult> SaveBankingDetails(long userId,
                                                             [FromBody] BankingDetailsRegistrationDto bankingDetailsRegistrationDto)
        {
            if (!_customAuth.IsUserAllowedAccess(userId, HttpContext))
            {
                return(StatusCode(401));
            }
            var response = await _bankingDetailsServices.SaveBankingDetails(userId, bankingDetailsRegistrationDto);

            return(StatusCode(response.Status, response));
        }