From 085d9e0481170a4a757bd687409648027b680932 Mon Sep 17 00:00:00 2001 From: felix-zhaolei Date: Wed, 25 Dec 2024 17:55:43 +0800 Subject: [PATCH 1/2] modify: token list image url. --- .../CAServerApplicationAutoMapperProfile.cs | 4 +++- src/CAServer.Application/UserAssets/UserAssetsAppService.cs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CAServer.Application/CAServerApplicationAutoMapperProfile.cs b/src/CAServer.Application/CAServerApplicationAutoMapperProfile.cs index 3a2132706..8c4e42c8c 100644 --- a/src/CAServer.Application/CAServerApplicationAutoMapperProfile.cs +++ b/src/CAServer.Application/CAServerApplicationAutoMapperProfile.cs @@ -359,7 +359,9 @@ public CAServerApplicationAutoMapperProfile() .ForMember(t => t.Decimals, m => m.MapFrom(f => f.TokenInfo == null ? new decimal() : f.TokenInfo.Decimals)) .ForMember(t => t.TokenContractAddress, - m => m.MapFrom(f => f.TokenInfo == null ? null : f.TokenInfo.TokenContractAddress)); + m => m.MapFrom(f => f.TokenInfo == null ? null : f.TokenInfo.TokenContractAddress)) + .ForMember(t => t.ImageUrl, + m => m.MapFrom(f => f.TokenInfo == null ? null : f.TokenInfo.ImageUrl)); CreateMap() .ForMember(t => t.ImageUrl, diff --git a/src/CAServer.Application/UserAssets/UserAssetsAppService.cs b/src/CAServer.Application/UserAssets/UserAssetsAppService.cs index 5a9910b51..3b9b592ec 100644 --- a/src/CAServer.Application/UserAssets/UserAssetsAppService.cs +++ b/src/CAServer.Application/UserAssets/UserAssetsAppService.cs @@ -1022,7 +1022,7 @@ public async Task SearchUserAssetsAsync(SearchUserAssetsReq tokenInfo.BalanceInUsd = tokenInfo.BalanceInUsd = CalculationHelper .GetBalanceInUsd(price, searchItem.Balance, Convert.ToInt32(tokenInfo.Decimals)).ToString(); - tokenInfo.ImageUrl = _assetsLibraryProvider.buildSymbolImageUrl(item.Symbol); + tokenInfo.ImageUrl = _assetsLibraryProvider.buildSymbolImageUrl(item.Symbol, tokenInfo.ImageUrl); item.TokenInfo = tokenInfo; } @@ -1056,7 +1056,8 @@ await _imageProcessProvider.GetResizeImageAsync(searchItem.NftInfo.ImageUrl, req dto.Data = dto.Data.Where(t => t.TokenInfo != null).OrderBy(t => t.Symbol != CommonConstant.DefaultSymbol) .ThenBy(t => t.Symbol).ThenByDescending(t => t.ChainId) - .Union(dto.Data.Where(f => f.NftInfo != null).OrderBy(e => e.Symbol).ThenByDescending(t => t.ChainId)).ToList(); + .Union(dto.Data.Where(f => f.NftInfo != null).OrderBy(e => e.Symbol).ThenByDescending(t => t.ChainId)) + .ToList(); SetSeedStatusAndTypeForUserAssets(dto.Data); From b9dbd548a665afce49d2e301832c262d910813d8 Mon Sep 17 00:00:00 2001 From: felix-zhaolei Date: Wed, 25 Dec 2024 18:09:42 +0800 Subject: [PATCH 2/2] modify: add token image url. --- .../CAServerEventHandlerAutoMapperProfile.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CAServer.EntityEventHandler.Core/CAServerEventHandlerAutoMapperProfile.cs b/src/CAServer.EntityEventHandler.Core/CAServerEventHandlerAutoMapperProfile.cs index 14fcbe74c..df6d0187a 100644 --- a/src/CAServer.EntityEventHandler.Core/CAServerEventHandlerAutoMapperProfile.cs +++ b/src/CAServer.EntityEventHandler.Core/CAServerEventHandlerAutoMapperProfile.cs @@ -55,14 +55,16 @@ public CAServerEventHandlerAutoMapperProfile() .ForPath(t => t.Token.Symbol, m => m.MapFrom(u => u.Token.Symbol)) .ForPath(t => t.Token.ChainId, m => m.MapFrom(u => u.Token.ChainId)) .ForPath(t => t.Token.Decimals, m => m.MapFrom(u => u.Token.Decimals)) - .ForPath(t => t.Token.Address, m => m.MapFrom(u => u.Token.Address)); + .ForPath(t => t.Token.Address, m => m.MapFrom(u => u.Token.Address)) + .ForPath(t => t.Token.ImageUrl, m => m.MapFrom(u => u.Token.ImageUrl)); CreateMap() .ForPath(t => t.Token.Id, m => m.MapFrom(u => u.Token.Id)) .ForPath(t => t.Token.Symbol, m => m.MapFrom(u => u.Token.Symbol)) .ForPath(t => t.Token.ChainId, m => m.MapFrom(u => u.Token.ChainId)) .ForPath(t => t.Token.Decimals, m => m.MapFrom(u => u.Token.Decimals)) - .ForPath(t => t.Token.Address, m => m.MapFrom(u => u.Token.Address)); + .ForPath(t => t.Token.Address, m => m.MapFrom(u => u.Token.Address)) + .ForPath(t => t.Token.ImageUrl, m => m.MapFrom(u => u.Token.ImageUrl)); CreateMap(); CreateMap(); CreateMap();