Commit f10e9a35 by songyinghui

feat: 素材列表缩略图

parent 55fa6a25
...@@ -26,8 +26,10 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -26,8 +26,10 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @Author MUSI * @Author MUSI
...@@ -92,7 +94,23 @@ public class ContentMaterialController { ...@@ -92,7 +94,23 @@ public class ContentMaterialController {
Page<ContentMaterialFrontDTO> responseResult = serviceResponse.getResult(); Page<ContentMaterialFrontDTO> responseResult = serviceResponse.getResult();
Page<ContentMaterialInfoVO> result = new Page<>(); Page<ContentMaterialInfoVO> result = new Page<>();
result.setTotalCount(responseResult.getTotalCount()); result.setTotalCount(responseResult.getTotalCount());
List<ContentMaterialInfoVO> contentMaterialInfos = EntityUtil.changeEntityListByJSON(ContentMaterialInfoVO.class, responseResult.getResult()); List<ContentMaterialInfoVO> contentMaterialInfos = responseResult.getResult().stream()
.map(item -> {
ContentMaterialInfoVO contentMaterialInfoVO = new ContentMaterialInfoVO();
BeanUtils.copyProperties(item, contentMaterialInfoVO);
contentMaterialInfoVO.setPublishTime(item.getPublishBeginTime());
if (StringUtils.isNotBlank(item.getMaterialImageUrls())) {
String[] split = StringUtils.split(item.getMaterialImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialImageUrls(imageUrls);
}
if (StringUtils.isNotBlank(item.getMaterialThumbnailImageUrls())) {
String[] split = StringUtils.split(item.getMaterialThumbnailImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialThumbnailImageUrls(imageUrls);
}
return contentMaterialInfoVO;
}).collect(Collectors.toList());
result.setResult(contentMaterialInfos); result.setResult(contentMaterialInfos);
return RestResponse.successResult(result); return RestResponse.successResult(result);
} }
...@@ -106,7 +124,7 @@ public class ContentMaterialController { ...@@ -106,7 +124,7 @@ public class ContentMaterialController {
public RestResponse<ContentMaterialShareInfoVO> shareContentMaterial(ContentMaterialShareQO contentMaterialShareQO){ public RestResponse<ContentMaterialShareInfoVO> shareContentMaterial(ContentMaterialShareQO contentMaterialShareQO){
if (StringUtils.isAnyBlank(contentMaterialShareQO.getEnterpriseId())){ if (StringUtils.isBlank(contentMaterialShareQO.getEnterpriseId())){
return RestResponse.failure("-777", "企业参数异常"); return RestResponse.failure("-777", "企业参数异常");
} }
if (StringUtils.isBlank(contentMaterialShareQO.getGoodsId())){ if (StringUtils.isBlank(contentMaterialShareQO.getGoodsId())){
......
...@@ -48,6 +48,11 @@ public class ContentMaterialInfoVO implements Serializable { ...@@ -48,6 +48,11 @@ public class ContentMaterialInfoVO implements Serializable {
private List<String> materialImageUrls; private List<String> materialImageUrls;
/** /**
* 缩略图
*/
private List<String> materialThumbnailImageUrls;
/**
* 素材视频链接 * 素材视频链接
*/ */
private String materialVideoUrl; private String materialVideoUrl;
...@@ -200,4 +205,12 @@ public class ContentMaterialInfoVO implements Serializable { ...@@ -200,4 +205,12 @@ public class ContentMaterialInfoVO implements Serializable {
public void setContentGoodsList(List<SimpleGoodsInfoVO> contentGoodsList) { public void setContentGoodsList(List<SimpleGoodsInfoVO> contentGoodsList) {
this.contentGoodsList = contentGoodsList; this.contentGoodsList = contentGoodsList;
} }
public List<String> getMaterialThumbnailImageUrls() {
return materialThumbnailImageUrls;
}
public void setMaterialThumbnailImageUrls(List<String> materialThumbnailImageUrls) {
this.materialThumbnailImageUrls = materialThumbnailImageUrls;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment