Jelajahi Sumber

测试交易记录

liaijie 4 tahun lalu
induk
melakukan
598e206a90
1 mengubah file dengan 1 tambahan dan 26 penghapusan
  1. 1 26
      src/main/java/com/izouma/nineth/service/AssetService.java

+ 1 - 26
src/main/java/com/izouma/nineth/service/AssetService.java

@@ -15,12 +15,10 @@ import com.izouma.nineth.event.TransferAssetEvent;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.utils.JpaUtils;
-import com.izouma.nineth.utils.PageUtil;
 import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.TokenUtils;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import net.coobird.thumbnailator.filters.Pipeline;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.spring.core.RocketMQTemplate;
@@ -28,8 +26,6 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.context.ApplicationContext;
 import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageImpl;
-import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -460,7 +456,7 @@ public class AssetService {
         Set<String> tokenIds = page.stream().map(TokenHistory::getTokenId).collect(Collectors.toSet());
         List<Asset> assets = tokenIds.isEmpty() ? new ArrayList<>() : assetRepo.findByTokenIdIn(tokenIds);
 
-        Page<UserHistory> map = page.map(tokenHistory -> {
+        return page.map(tokenHistory -> {
             UserHistory userHistory = new UserHistory();
             BeanUtils.copyProperties(tokenHistory, userHistory);
             Optional<Asset> asset = assets.stream().filter(a -> a.getTokenId().equals(tokenHistory.getTokenId()))
@@ -480,29 +476,8 @@ public class AssetService {
                     userHistory.setDescription("赠送");
                     break;
             }
-
             return userHistory;
         });
-       /* Object operation1 = query.get("operation");
-        boolean b = null != operation1;
-        log.error("是否进入"+b);
-        if (null!=operation1){
-            String operation =  operation1.toString();
-            List<UserHistory> content = map.getContent();
-            log.error("总长度为"+content.size());
-            for (int i = 0; i < content.size(); i++) {
-                log.error("传过来的值为:"+operation);
-                log.error("原来的的值为:"+content.get(i).getDescription());
-                log.error("=================");
-                if (!content.get(i).getDescription().equals(operation)){
-                    content.remove(i);
-                    i--;
-                }
-            }
-            Pageable pageable = PageRequest.of(pageQuery.getPage(), pageQuery.getSize());
-            map = PageUtil.createPageFromList(content, pageable);
-        }*/
-        return map;
     }
 
     public String mint(LocalDateTime time) {