|
|
@@ -5,9 +5,7 @@ import com.izouma.nineth.config.Constants;
|
|
|
import com.izouma.nineth.domain.Asset;
|
|
|
import com.izouma.nineth.domain.MetaItem;
|
|
|
import com.izouma.nineth.domain.MetaShowRoomAsset;
|
|
|
-import com.izouma.nineth.dto.MetaRestResult;
|
|
|
-import com.izouma.nineth.dto.MetaServiceResult;
|
|
|
-import com.izouma.nineth.dto.PageQuery;
|
|
|
+import com.izouma.nineth.dto.*;
|
|
|
import com.izouma.nineth.enums.MetaItemEnum;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.AssetRepo;
|
|
|
@@ -83,7 +81,7 @@ public class MetaShowRoomAssetService {
|
|
|
metaShowRoomAssetRepo.deleteByAssetId(asset.getId());
|
|
|
} else {
|
|
|
metaShowRoomAsset.setUrl(whetherTest ? URL_PREFIX_TEST.concat(String.valueOf(asset.getId())) : URL_PREFIX.concat(String.valueOf(asset.getId())));
|
|
|
- metaShowRoomAsset.setAsset(asset);
|
|
|
+ metaShowRoomAsset.setMetaAssetDTO(MetaAssetDTO.create(asset));
|
|
|
newMetaShowRoomAsset.add(metaShowRoomAsset);
|
|
|
}
|
|
|
});
|
|
|
@@ -91,7 +89,7 @@ public class MetaShowRoomAssetService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public MetaRestResult<List<Asset>> noShowRoomAndBlindBox(Long userId) {
|
|
|
+ public MetaRestResult<List<MetaAssetDTO>> noShowRoomAndBlindBox(Long userId) {
|
|
|
// 查询已上架藏品
|
|
|
List<Long> assetIds = metaShowRoomAssetRepo.findAssetIdAllByUserId(userId);
|
|
|
List<MetaItem> metaItems = metaItemRepo.findAllByTypeAndDel(MetaItemEnum.META_SHOW_ROOM, false);
|
|
|
@@ -106,19 +104,21 @@ public class MetaShowRoomAssetService {
|
|
|
}
|
|
|
});
|
|
|
List<Asset> assets;
|
|
|
+ List<MetaAssetDTO> metaAssetDTOS = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(ids)) {
|
|
|
assets = assetRepo.findAllByIdNotInAndUserIdAndStatusInAndOpened(ids, userId, Constants.META_NORMAL_STATUS, true);
|
|
|
} else {
|
|
|
assets = assetRepo.findAllByUserIdAndStatusInAndOpened(userId, Constants.META_NORMAL_STATUS, true);
|
|
|
}
|
|
|
if (CollectionUtils.isEmpty(assets) || CollectionUtils.isEmpty(assetIds)) {
|
|
|
- return MetaRestResult.returnSuccess(assets);
|
|
|
+ return MetaRestResult.returnSuccess(metaAssetDTOS);
|
|
|
}
|
|
|
// 查询用户拥有的非展厅非未开启盲盒藏品
|
|
|
assets.forEach(asset -> {
|
|
|
asset.setMetaPutOn(assetIds.contains(asset.getId()));
|
|
|
+ metaAssetDTOS.add(MetaAssetDTO.create(asset));
|
|
|
});
|
|
|
- return MetaRestResult.returnSuccess(assets);
|
|
|
+ return MetaRestResult.returnSuccess(metaAssetDTOS);
|
|
|
}
|
|
|
|
|
|
public MetaRestResult<List<Asset>> noBlindBox(Long userId) {
|