Files
love-nav/src/main/java/com/lovenav/controller/BannersController.java
2023-12-28 21:42:26 +08:00

40 lines
1.2 KiB
Java

package com.lovenav.controller;
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
public class BannersController {
@Autowired
private BannersService bannersService;
// 跳转链接
@RequestMapping(method = RequestMethod.GET, value = "/banners/jump_url")
public String jump(int id) {
return bannersService.Jump_url(id);
}
// 添加banner
@RequestMapping( "/banners/add_banner")
public String add(Banners banners) {
return bannersService.Add_banner(banners);
}
// 删除banner
@RequestMapping(method = RequestMethod.GET, value = "/banners/delete_url")
public String delete(int id) {
return bannersService.Delete_banner(id);
}
// 首页显示banner
@RequestMapping(method = RequestMethod.GET, value = "/banners/view_banner")
public String view() {
return bannersService.View_banner();
}
}