评论
This commit is contained in:
@@ -39,13 +39,6 @@ public class CommentController {
|
||||
return commentService.AddLikeCount(id);
|
||||
}
|
||||
|
||||
// 显示评论
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/view_comment")
|
||||
public ResponseEntity<List<CommentNode>> queryObserveByBlogId (
|
||||
@ApiParam(name = "url_id", value = "id", required = true) @PathVariable Integer url_id
|
||||
) {
|
||||
return ResponseEntity.ok(commentService.queryCommentByUrlId(url_id));
|
||||
}
|
||||
|
||||
// 显示回复
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/view_reply")
|
||||
@@ -59,10 +52,8 @@ public ResponseEntity<List<CommentNode>> queryObserveByBlogId (
|
||||
* @param UrlId 博客id
|
||||
* @return 博客的评论信息
|
||||
*/
|
||||
@GetMapping("/UrlId")
|
||||
public ResponseEntity<List<CommentNode>> queryCommentByUrlId (
|
||||
@ApiParam(name = "UrlId", value = "urlid", required = true) @PathVariable Integer UrlId
|
||||
) {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/UrlId")
|
||||
public ResponseEntity<List<CommentNode>> queryCommentByUrlId (Integer UrlId) {
|
||||
return ResponseEntity.ok(commentService.queryCommentByUrlId(UrlId));
|
||||
}
|
||||
|
||||
@@ -71,10 +62,8 @@ public ResponseEntity<List<CommentNode>> queryObserveByBlogId (
|
||||
* @param Id 评论id
|
||||
* @return 评论信息,携带用户信息
|
||||
*/
|
||||
@GetMapping("/Id")
|
||||
public ResponseEntity<CommentUser> queryObserveUserById (
|
||||
@ApiParam(name = "Id", value = "评论id", required = true)@PathVariable Integer Id
|
||||
) {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/Id")
|
||||
public ResponseEntity<CommentUser> queryObserveUserById (Integer Id) {
|
||||
return ResponseEntity.ok(commentService.queryCommentUserById(Id));
|
||||
}
|
||||
}
|
||||
|
@@ -29,26 +29,8 @@ public interface CommentDao {
|
||||
|
||||
List<Comment> selectByAllReply(int id);
|
||||
|
||||
@Select("SELECT * FROM ln_comment o LEFT JOIN ln_user u"+
|
||||
"ON o.user_id=u.id"+
|
||||
"WHERE o.user_id = #{userId,jdbcType=INTEGER} AND o.root_comment_id = 0")
|
||||
@Results({
|
||||
@Result(id = true, column = "id", property = "id"),
|
||||
@Result(column = "url_id", property = "urlId"),
|
||||
@Result(column = "user_id", property = "userId"),
|
||||
@Result(column = "content", property = "content"),
|
||||
@Result(column = "content", property = "user",
|
||||
one = @One(select = "com.lovenav.dao.UserDao.queryUserForComment",
|
||||
fetchType = FetchType.EAGER)),
|
||||
@Result(column = "root_comment_id", property = "rootCommentId"),
|
||||
@Result(column = "comment_status", property = "commentStatus"),
|
||||
@Result(column = "comment_time", property = "commentTime"),
|
||||
@Result(column = "update_time", property = "updateTime"),
|
||||
@Result(column = "like_count", property = "likeCount"),
|
||||
@Result(column = "rating", property = "rating")
|
||||
|
||||
})
|
||||
List<CommentNode> queryFirstCommentList (@Param("urlId") Integer UrlId);
|
||||
List<CommentNode> queryFirstCommentList (Integer UrlId);
|
||||
|
||||
|
||||
|
||||
@@ -59,24 +41,6 @@ public interface CommentDao {
|
||||
* @author RenShiWei
|
||||
* Date: 2020/4/16 10:37
|
||||
*/
|
||||
@Select("SELECT * FROM ln_comment o LEFT JOIN ln_user u " +
|
||||
"ON o.user_id=u.id " +
|
||||
"WHERE o.user_id = #{userId,jdbcType=INTEGER} AND o.last_id != 0 ")
|
||||
@Results({
|
||||
@Result(id = true, column = "id", property = "id"),
|
||||
@Result(column = "url_id", property = "urlId"),
|
||||
@Result(column = "user_id", property = "userId"),
|
||||
@Result(column = "content", property = "content"),
|
||||
@Result(column = "content", property = "user",
|
||||
one = @One(select = "com.lovenav.dao.UserDao.queryUserForComment",
|
||||
fetchType = FetchType.EAGER)),
|
||||
@Result(column = "root_comment_id", property = "rootCommentId"),
|
||||
@Result(column = "comment_status", property = "commentStatus"),
|
||||
@Result(column = "comment_time", property = "commentTime"),
|
||||
@Result(column = "update_time", property = "updateTime"),
|
||||
@Result(column = "like_count", property = "likeCount"),
|
||||
@Result(column = "rating", property = "rating")
|
||||
|
||||
})
|
||||
List<CommentNode> querySecondCommentList(@Param("urlId")Integer UrlId);
|
||||
List<CommentNode> querySecondCommentList(Integer UrlId);
|
||||
}
|
@@ -143,7 +143,14 @@ public class Comment implements Serializable {
|
||||
*/
|
||||
private Integer rating;
|
||||
|
||||
public interface UpdateGroup {
|
||||
private User user;
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@@ -3,7 +3,7 @@ package com.lovenav.entity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
Reference in New Issue
Block a user