评论
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.lovenav.entity.Comment;
|
||||
import com.lovenav.entity.CommentNode;
|
||||
import com.lovenav.entity.CommentUser;
|
||||
import com.lovenav.service.CommentService;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/comment")
|
||||
@@ -34,13 +41,40 @@ public class CommentController {
|
||||
|
||||
// 显示评论
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/view_comment")
|
||||
public String View_comment(){
|
||||
return commentService.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")
|
||||
public String View_reply(int id){
|
||||
return commentService.View_Reply(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 功能描述:根据博客id,查询此博客的所有评论信息(链表类型的数据)
|
||||
* @param UrlId 博客id
|
||||
* @return 博客的评论信息
|
||||
*/
|
||||
@GetMapping("/UrlId")
|
||||
public ResponseEntity<List<CommentNode>> queryCommentByUrlId (
|
||||
@ApiParam(name = "UrlId", value = "urlid", required = true) @PathVariable Integer UrlId
|
||||
) {
|
||||
return ResponseEntity.ok(commentService.queryCommentByUrlId(UrlId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:根据评论id查询用户信息(评论信息,携带用户信息)
|
||||
* @param Id 评论id
|
||||
* @return 评论信息,携带用户信息
|
||||
*/
|
||||
@GetMapping("/Id")
|
||||
public ResponseEntity<CommentUser> queryObserveUserById (
|
||||
@ApiParam(name = "Id", value = "评论id", required = true)@PathVariable Integer Id
|
||||
) {
|
||||
return ResponseEntity.ok(commentService.queryCommentUserById(Id));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user