parent
f84f7047c4
commit
fd9a0d2929
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
package com.luoo.music.dao;
|
||||
|
||||
import com.luoo.music.pojo.Comment;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CommentDao extends MongoRepository<Comment,String> {
|
||||
|
||||
public Page<Comment> findByParentId(String parentId, Pageable pageable);
|
||||
public Page<Comment> findByJournalId(String journalId, Pageable pageable);
|
||||
|
||||
public List<Comment> findTop5ByJournalIdOrderByThumbupCountDesc(String journalId);
|
||||
|
||||
public List<Comment> findByJournalId(String journalId);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.luoo.music.dto.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TotalCommentVo {
|
||||
|
||||
|
||||
|
||||
private Integer totalComment;
|
||||
|
||||
private String journalId;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.luoo.music.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class Comment implements Serializable {
|
||||
|
||||
@Id
|
||||
private String _id;
|
||||
// 评论内容
|
||||
private String content;
|
||||
// 发布时间
|
||||
private Date publishTime;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private String avatar;
|
||||
|
||||
// 点赞数
|
||||
private Integer thumbupCount;
|
||||
// 转发数
|
||||
// private Integer share;
|
||||
// 评论数量
|
||||
private Integer commentCount;
|
||||
|
||||
// 状态
|
||||
private Integer state;
|
||||
|
||||
|
||||
private String location; //归属地
|
||||
/**
|
||||
* 父节点 ID
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
private String journalId;
|
||||
}
|
Loading…
Reference in new issue