修正comment,banner接口
This commit is contained in:
40
src/main/java/com/lovenav/controller/BannersController.java
Normal file
40
src/main/java/com/lovenav/controller/BannersController.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lovenav.entity.Banners;
|
||||
import com.lovenav.service.BannersService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/banners")
|
||||
public class BannersController {
|
||||
@Autowired
|
||||
private BannersService bannersService;
|
||||
// 跳转链接
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/jump_url")
|
||||
public String jump(int id){
|
||||
return bannersService.Jump_url(id);
|
||||
}
|
||||
|
||||
// 添加banner
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/add_banner")
|
||||
public String add(@RequestBody Banners banners){
|
||||
return bannersService.Add_banner(banners);
|
||||
}
|
||||
|
||||
// 删除banner
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/delete_url")
|
||||
public String delete(int id){
|
||||
return bannersService.Delete_banner(id);
|
||||
}
|
||||
|
||||
// 首页显示banner
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/view_banner")
|
||||
public String view(){
|
||||
return bannersService.View_banner();
|
||||
}
|
||||
}
|
@@ -21,15 +21,15 @@ public class CommentController {
|
||||
@Autowired
|
||||
private CommentService commentService;
|
||||
// 评论功能
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/reply_comment")
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/comment")
|
||||
public String Reply1(@RequestBody Comment comment){
|
||||
return commentService.Reply1(comment);
|
||||
}
|
||||
|
||||
// 回复功能
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/comment")
|
||||
public String Reply2(@RequestBody Comment comment){
|
||||
return commentService.Reply2(comment);
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/reply_comment")
|
||||
public String Reply2(@RequestBody Comment comment,int id){
|
||||
return commentService.Reply2(comment,id);
|
||||
}
|
||||
// 删除功能
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/delete_comment")
|
||||
@@ -40,4 +40,10 @@ public class CommentController {
|
||||
public String addLikeCount(int id){
|
||||
return commentService.AddLikeCount(id);
|
||||
}
|
||||
|
||||
// 显示评论
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/view_comment")
|
||||
public String View_comment(){
|
||||
return commentService.View_comment();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user