Commit 9c6b03fd authored by 刘基明's avatar 刘基明

压缩图片

parent c0360c0a
......@@ -24,6 +24,7 @@ import com.tanpu.community.api.beans.req.theme.ThemeListReq;
import com.tanpu.community.api.beans.resp.CreateThemeResp;
import com.tanpu.community.api.beans.resp.ThemeFullSearchResp;
import com.tanpu.community.api.beans.resp.ThemeListResp;
import com.tanpu.community.api.beans.vo.ImagesDTO;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp;
import com.tanpu.community.api.enums.BlockTypeEnum;
import com.tanpu.community.api.enums.OperationTypeEnum;
......@@ -343,6 +344,17 @@ public class ThemeManager {
FormerThemeQo former = redisCache.getObject(StringUtils.joinWith("_", CACHE_FORMER_THEME_ID, themeId), 60,
() -> this.getFormerTheme(themeQo.getFormerThemeId()), FormerThemeQo.class);
themeQo.setFormerTheme(former);
//压缩图片
themeQo.getContent().stream().forEach(o-> {
if (o.getImgList() != null) {
for (ImagesDTO imagesDTO : o.getImgList()) {
if (StringUtils.isNotBlank(imagesDTO.getRemark()))
imagesDTO.setRemark(imagesDTO.getRemark()+"?x-oss-process=image/resize,p_10");
}
}
});
// 点赞,收藏,转发
Integer likeCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.LIKE_THEME);
Integer commentCount = commentService.getCommentCountByThemeId(themeId);
......
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