...
|
...
|
@@ -7,13 +7,11 @@ import com.google.common.collect.Maps; |
|
|
import com.yoho.core.dal.datasource.annotation.Database;
|
|
|
import com.yohobuy.platform.common.exception.PlatformException;
|
|
|
import com.yohobuy.platform.common.util.DateUtil;
|
|
|
import com.yohobuy.platform.dal.grass.IGrassArticleBlockDao;
|
|
|
import com.yohobuy.platform.dal.grass.IGrassArticleDao;
|
|
|
import com.yohobuy.platform.dal.grass.IGrassArticleProductDao;
|
|
|
import com.yohobuy.platform.dal.grass.IGrassVirtualUserDao;
|
|
|
import com.yohobuy.platform.dal.grass.*;
|
|
|
import com.yohobuy.platform.dal.grass.model.GrassArticle;
|
|
|
import com.yohobuy.platform.dal.grass.model.GrassArticleBlock;
|
|
|
import com.yohobuy.platform.dal.grass.model.GrassArticleProduct;
|
|
|
import com.yohobuy.platform.dal.grass.model.GrassTopic;
|
|
|
import com.yohobuy.platform.grass.service.IGrassArticleService;
|
|
|
import com.yohobuy.platform.model.common.PageResponseVO;
|
|
|
import com.yohobuy.platform.model.grass.request.GrassArticleReq;
|
...
|
...
|
@@ -46,6 +44,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
@Resource
|
|
|
private IGrassVirtualUserDao grassVirtualUserDao;
|
|
|
|
|
|
@Resource
|
|
|
private IGrassTopicDAO grassTopicDAO;
|
|
|
|
|
|
private final static String BLOCK_TEXT = "text";
|
|
|
private final static String BLOCK_IMAGE = "image";
|
|
|
|
...
|
...
|
@@ -287,13 +288,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
List<Integer> ids = articleList.stream().map(GrassArticle::getId).collect(Collectors.toList());
|
|
|
List<Integer> topicIds = articleList.stream().map(GrassArticle::getTopicId).collect(Collectors.toList());
|
|
|
List<GrassArticleBlock> grassArticleContentList = grassArticleBlockDao.selectByArticleIds(ids);
|
|
|
List<GrassArticleProduct> grassArticlePoductList = grassArticleProductDao.selectByArticleIds(ids);
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(topicIds)){
|
|
|
List<String> topics = Lists.newArrayList();
|
|
|
}
|
|
|
Map<Integer, List<String>> imgMap = Maps.newHashMap();
|
|
|
Map<Integer,String> textMap = Maps.newHashMap();
|
|
|
Map<Integer, List<Integer>> sknMap = Maps.newHashMap();
|
...
|
...
|
@@ -331,6 +328,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
rspBo.setArticleContent(textMap.get(article.getId()));
|
|
|
rspBo.setAuthorUid(article.getAuthorUid());
|
|
|
rspBo.setTopicId(article.getTopicId());
|
|
|
rspBo.setTopicName(getArticleName(article.getTopicId()));
|
|
|
rspBo.setNickName("");
|
|
|
rspBo.setCommentCount(article.getCommentCount());
|
|
|
rspBo.setShareCount(article.getShareCount());
|
...
|
...
|
@@ -347,6 +345,13 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
return rspBoList;
|
|
|
}
|
|
|
|
|
|
private String getArticleName(int id){
|
|
|
GrassTopic topic = grassTopicDAO.selectByPrimaryKey(id);
|
|
|
if(topic != null){
|
|
|
return topic.getTopicName();
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
|
private void publishCheck(GrassArticleReq req) throws PlatformException {
|
|
|
if(req.getAuthorUid() ==null){
|
|
|
logger.info("publishCheck uid is null");
|
...
|
...
|
|