点赞++2
This commit is contained in:
@@ -1,23 +1,26 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.lovenav.entity.Comment;
|
||||
import com.lovenav.service.CommentService;
|
||||
import com.lovenav.service.serviceImpl.CommentServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/comment")
|
||||
public class CommentController {
|
||||
@Autowired
|
||||
private CommentServiceImpl commentServiceImpl;
|
||||
@PostMapping(value= "/AddLikeCount",produces="application/json;charset=UTF-8")
|
||||
public String AddLikeCount(@RequestBody Comment comment) {
|
||||
return commentServiceImpl.AddLikeCount(comment);
|
||||
}
|
||||
private CommentService commentService;
|
||||
|
||||
@GetMapping("/hello")
|
||||
public String he(){
|
||||
System.out.println("hello world");
|
||||
return "Hello world!";
|
||||
// @GetMapping(value= "/AddLikeCount")
|
||||
// public String AddLikeCount_Controller(HttpSession session){
|
||||
// int id = (int) session.getAttribute("id");
|
||||
// return commentService.AddLikeCount(id);
|
||||
// }
|
||||
@GetMapping(value= "/AddLikeCount")
|
||||
public String AddLikeCount(int id){
|
||||
return commentService.AddLikeCount(id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user