public QueryContainer Create <TRequest>(TRequest request, QueryContainerDescriptor <QueryableAccount> q) { GetAccountListRequest accountListRequest = request as GetAccountListRequest; if (accountListRequest == null) { throw new ArgumentNullException($"{nameof(request).ToString()} shouldn't be null."); } if (!string.IsNullOrEmpty(accountListRequest.SearchText)) { _queryBuilder .WithWildstarQuery(accountListRequest.SearchText, new List <string> { "paymentReference", "tenure.fullAddress", "tenure.primaryTenants.fullName" }) .WithExactQuery(accountListRequest.SearchText, new List <string> { "paymentReference", "tenure.fullAddress", "tenure.primaryTenants.fullName" }); } return(_queryBuilder.Build(q)); }
public override async Task <GetAccountListResponse> GetAccountList(GetAccountListRequest getAccountListRequest, ServerCallContext context) { Log.Information("GetAccountListRequest called via gRPC remote service {@getAccountListRequest}", getAccountListRequest); // We don't use the GetAccountListQuery in the controller method otherwise Swagger tries to use a POST on our GET call var accountListQuery = _mapper.Map <GetAccountListQuery>(getAccountListRequest); var result = await _mediator.Send(accountListQuery); var getAccountListResponse = new GetAccountListResponse { Count = result.Count, HasMoreResults = result.HasMoreResults, ContinuationToken = result.ContinuationToken }; foreach (var account in result.Accounts) { getAccountListResponse.Accounts.Add(_mapper.Map <GetAccountListResponse.Types.Account>(account)); } return(getAccountListResponse); //----------------------------------------------------- // TODO: DocumentDB will soon have skip/take // For now we use continuation token to get next batch from list // For even more robust query capabilities you should use the 'search' route //----------------------------------------------------- }
public async Task <GetAccountListResponse> GetListOfAccounts(GetAccountListRequest query) { var searchResponse = await _elasticSearchWrapper.Search <QueryableAccount, GetAccountListRequest>(query).ConfigureAwait(false); var accountListResponse = GetAccountListResponse.Create(searchResponse.Documents.Select(queryableAccount => queryableAccount.ToAccount())?.ToList()); accountListResponse.SetTotal(searchResponse.Total); return(accountListResponse); }
public async Task <IActionResult> GetAccountList([FromQuery] GetAccountListRequest request) { try { var accountSearchResult = await _getAccountListUseCase.ExecuteAsync(request).ConfigureAwait(false); var apiResponse = new APIResponse <GetAccountListResponse>(accountSearchResult) { Total = accountSearchResult.Total() }; return(new OkObjectResult(apiResponse)); } catch (Exception e) { LambdaLogger.Log(e.Message + e.StackTrace); return(new BadRequestObjectResult(e.Message)); } }
public GetAccountListResponse Post([FromBody] GetAccountListRequest value) { var responseobject = new GetAccountListResponse() { status = "S", AccountMasterLists = new Files().GetAccounts() }; // GetBankListResponse response = new GetBankListResponse( ); getaccountlist data = new getaccountlist(); data.datestamp = DateTime.Now; data.androidId = value.Deviceinfo.androidid; data.appName = value.Deviceinfo.appName; data.appVersionCode = value.Deviceinfo.appVersionCode; data.appVersionName = value.Deviceinfo.AppVersionName; data.bluetoothMac = value.Deviceinfo.bluetoothMac; data.capability = value.Deviceinfo.capability; data.deviceId = value.Deviceinfo.deviceId; data.deviceType = value.Deviceinfo.deviceType; data.geoCode = value.Deviceinfo.geoCode; data.ip = value.Deviceinfo.ip; data.location = value.Deviceinfo.location; data.mobileNo = value.Deviceinfo.mobileNo; data.os = value.Deviceinfo.os; data.regId = value.Deviceinfo.regId; data.selectedSimSlot = value.Deviceinfo.selectedSimSlot; data.simId = value.Deviceinfo.simId; data.wifiMac = value.Deviceinfo.WifiMac; data.pspId = value.RequestInfo.pspid; data.pspRefNo = value.RequestInfo.pspRefNo; data.profileId = value.RequestInfo.profileId; data.bankCode = value.bankCode; data.name = value.UserInfo.name; data.virtualAddress = value.UserInfo.virtualAddress; data.requestType = value.requestType; data.request = "POST"; data.apiname = ControllerContext.RouteData.Values["controller"].ToString(); string strcon = "Server=DESKTOP-N5AIHVF\\SRSSQL;Database=WEBAPI;Trusted_Connection=True;"; SqlConnection con = new SqlConnection(strcon); con.Open(); SqlCommand cmd = new SqlCommand("Insert into getaccountlist ( data.datestamp , data.apiname, data.request, data.androidId, data.appName, data.appVersionCode, data.appVersionName, data.bluetoothMac, data.capability, data.deviceId, data.deviceType, data.geoCode, data.ip, data.location, data.mobileNo, data.os, data.regId, data.selectedSimSlot, data.simId, data.wifiMac, data.pspId, data.pspRefNo, data.profileId,data.bankCode, data.name, data.virtualAddress, data.requestType) values('" + data.datestamp + "', '" + data.apiname + "', '" + data.request + "','" + data.androidId + "', '" + data.appName + "', '" + data.appVersionCode + "', '" + data.appVersionName + "', '" + data.bluetoothMac + "', '" + data.capability + "', '" + data.deviceId + "', '" + data.deviceType + "', '" + data.geoCode + "', '" + data.ip + "', '" + data.location + "', '" + data.mobileNo + "', '" + data.os + "', '" + data.regId + "', '" + data.selectedSimSlot + "', '" + data.simId + "', '" + data.wifiMac + "', '" + data.pspId + "', '" + data.pspRefNo + "', '" + data.profileId + "', '" + data.bankCode + "', '" + data.name + "', '" + data.virtualAddress + "', '" + data.requestType + "')", con); cmd.ExecuteNonQuery(); con.Close(); return(responseobject); }
public async Task <GetAccountListResponse> ExecuteAsync(GetAccountListRequest getAccountListRequest) { return(await _getAccountGateway.Search(getAccountListRequest).ConfigureAwait(false)); }
public async Task <GetAccountListResponse> Search(GetAccountListRequest parameters) { _logger.LogInformation("Housing search api for getting account list called."); return(await _searchGateway.GetListOfAccounts(parameters).ConfigureAwait(false)); }