예제 #1
0
        public async Task <ExcutedResult> Query(string key)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(key))
                {
                    if (await _accountServiceModel.AccountExist(key))
                    {
                        return(ExcutedResult.SuccessResult(new SearchResultModel
                        {
                            ResultType = (int)EnumSearchType.Account,
                            SearchKey = key
                        }));
                    }

                    if (_blockInfoRepository.Search(key))
                    {
                        return(ExcutedResult.SuccessResult(new SearchResultModel
                        {
                            ResultType = (int)EnumSearchType.Block,
                            SearchKey = key
                        }));
                    }

                    if (_transactionServiceModel.Search(key))
                    {
                        return(ExcutedResult.SuccessResult(new SearchResultModel
                        {
                            ResultType = (int)EnumSearchType.Transaction,
                            SearchKey = key
                        }));
                    }
                }
            }
            catch (Exception e)
            {
            }

            return(ExcutedResult.FailedResult(SysResultCode.DataNotExist, string.Empty));
        }