|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package com.community.pocket.repository.android; |
|
|
|
|
|
|
|
|
|
import com.community.pocket.entity.po.Forum; |
|
|
|
|
import com.community.pocket.entity.po.ForumContent; |
|
|
|
|
import com.community.pocket.entity.po.android.Complain; |
|
|
|
|
import com.community.pocket.entity.po.android.MyInfo; |
|
|
|
|
import com.community.pocket.entity.vo.ForumQuery; |
|
|
|
@ -17,6 +18,7 @@ import org.apache.commons.lang3.ObjectUtils; |
|
|
|
|
import org.bson.types.ObjectId; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.data.domain.Sort; |
|
|
|
|
import org.springframework.data.mongodb.core.aggregation.Aggregation; |
|
|
|
@ -42,6 +44,7 @@ public class ForumDao extends BaseDao<Forum> { |
|
|
|
|
@Value("${forum.content-length}") |
|
|
|
|
private int contentLength; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加回复数
|
|
|
|
|
public boolean update(ForumReplyForm forumReplyForm) { |
|
|
|
|
return mongoTemplate.updateFirst(new Query(Criteria.where("id").is(new ObjectId(forumReplyForm.getForumId()))), |
|
|
|
@ -116,6 +119,7 @@ public class ForumDao extends BaseDao<Forum> { |
|
|
|
|
if (forumDto.getComplainDto() != null) { |
|
|
|
|
loadComplain(forumDto); |
|
|
|
|
} |
|
|
|
|
loadDetailContent(forumDto); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
page.setList(forumDtos); |
|
|
|
@ -128,6 +132,10 @@ public class ForumDao extends BaseDao<Forum> { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void loadDetailContent(ForumDto forumDto) { |
|
|
|
|
forumDto.setDetailContent(mongoTemplate.findOne(new Query(Criteria.where("forumId").is(forumDto.getId()).and("tower").is(1)), ForumContent.class)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存动态
|
|
|
|
|
public Forum save(ForumVo forumVo) { |
|
|
|
|
try { |
|
|
|
|