Authored by 张帅

更该字段类型

... ... @@ -61,9 +61,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
logger.info("enter publishArticle, req is {}", req);
publishCheck(req);
long now = System.currentTimeMillis();
GrassArticle article = new GrassArticle();
article.setAuthorUid(req.getAuthorUid());
article.setCreateTime(DateUtil.getCurrentTimeSeconds());
article.setCreateTime(now);
article.setTopicId(req.getTopicId());
try{
grassArticleDao.insertArticleSeletive(article);
... ... @@ -81,7 +82,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(article.getId());
content.setContentData(getBlock(BLOCK_IMAGE,url));
content.setCreateTime(DateUtil.getCurrentTimeSeconds());
content.setCreateTime(now);
content.setTemplateKey("image");
content.setOrderBy(contentOrder);
contentOrder++;
... ... @@ -91,7 +92,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(article.getId());
content.setContentData(getBlock(BLOCK_TEXT, req.getContent()));
content.setCreateTime(DateUtil.getCurrentTimeSeconds());
content.setCreateTime(now);
content.setTemplateKey("text");
content.setOrderBy(contentOrder);
contentList.add(content);
... ... @@ -111,7 +112,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticleProduct grassArticleSkn = new GrassArticleProduct();
grassArticleSkn.setArticleId(article.getId());
grassArticleSkn.setProductSkn(Integer.valueOf(skn));
grassArticleSkn.setCreateTime(DateUtil.getCurrentTimeSeconds());
grassArticleSkn.setCreateTime(now);
grassArticleSkn.setOrderBy(orderby);
orderby++;
sknList.add(grassArticleSkn);
... ... @@ -189,16 +190,16 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
String authName = req.getPublisher();
String startTime = req.getStartTimeStr();
String endTime = req.getEndTimeStr();
Integer startTimeInt = null;
Integer endTimeInt = null;
Long startTimeInt = null;
Long endTimeInt = null;
if(StringUtils.isNumeric(authName)){
authorUid = Integer.valueOf(authName);
};
if(StringUtils.isNotEmpty(startTime)){
startTimeInt = Integer.valueOf(startTime);
startTimeInt = Long.valueOf(startTime);
}
if(StringUtils.isNotEmpty(endTime)){
endTimeInt = Integer.valueOf(endTime);
endTimeInt = Long.valueOf(endTime);
}
int page = req.getPage();
int size = req.getSize();
... ... @@ -230,11 +231,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
grassArticle.setId(req.getArticleId());
if(isRecommend !=null){
grassArticle.setIsRecommend(isRecommend);
grassArticle.setRecommendTime(DateUtil.getCurrentTimeSeconds());
grassArticle.setRecommendTime(System.currentTimeMillis());
}
if(isTop !=null){
grassArticle.setIsTop(isTop);
grassArticle.setTopTime(DateUtil.getCurrentTimeSeconds());
grassArticle.setTopTime(System.currentTimeMillis());
}
grassArticleDao.updateByPrimaryKeySelective(grassArticle);
}
... ... @@ -249,7 +250,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticle grassArticle = new GrassArticle();
grassArticle.setId(articleId);
grassArticle.setTopicId(req.getTopicId());
grassArticle.setUpdateTime(DateUtil.getCurrentTimeSeconds());
grassArticle.setUpdateTime(System.currentTimeMillis());
grassArticleDao.updateByPrimaryKeySelective(grassArticle);
}
... ... @@ -265,7 +266,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_IMAGE,src));
content.setCreateTime(DateUtil.getCurrentTimeSeconds());
content.setCreateTime(System.currentTimeMillis());
content.setTemplateKey("image");
content.setOrderBy(contentOrder);
contentOrder++;
... ... @@ -276,7 +277,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_TEXT,req.getContent()));
content.setCreateTime(DateUtil.getCurrentTimeSeconds());
content.setCreateTime(System.currentTimeMillis());
content.setTemplateKey("text");
content.setOrderBy(contentOrder);
addList.add(content);
... ... @@ -296,7 +297,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
GrassArticleProduct grassArticleSkn = new GrassArticleProduct();
grassArticleSkn.setArticleId(articleId);
grassArticleSkn.setProductSkn(Integer.valueOf(skn));
grassArticleSkn.setCreateTime(DateUtil.getCurrentTimeSeconds());
grassArticleSkn.setCreateTime(System.currentTimeMillis());
grassArticleSkn.setOrderBy(orderBy);
orderBy++;
addSknList.add(grassArticleSkn);
... ... @@ -314,7 +315,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
grassArticle.setId(req.getArticleId());
grassArticle.setAuthStatus(authStatus);
grassArticle.setAuthorizeAccount(req.getAuthorizeAccount());
grassArticle.setUpdateTime(DateUtil.getCurrentTimeSeconds());
grassArticle.setUpdateTime(System.currentTimeMillis());
grassArticleDao.updateByPrimaryKeySelective(grassArticle);
logger.info("updateArticle changeAuthStatus success! req={}",req);
}
... ... @@ -374,7 +375,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
rspBo.setShareCount(article.getShareCount());
rspBo.setFavorCount(article.getFavoriteCount());
rspBo.setPraiseCount(article.getPraiseCount());
rspBo.setPublishTime(DateUtil.int2DateStr(article.getCreateTime(),DateUtil.DATE_TIME_FORMAT));
rspBo.setPublishTime(DateUtil.long2DateStr(article.getCreateTime(),DateUtil.DATE_TIME_FORMAT));
rspBo.setAuthStatus(article.getAuthStatus());
rspBo.setSource(article.getArticleType());
rspBo.setImgList(imgMap.get(article.getId()));
... ...