Hentua
2023-06-15 bfa4d0fc1ce8d297fb2bea1c467ec335def8fa89
src/main/java/cc/mrbird/febs/mall/controller/ViewNewsController.java
@@ -12,6 +12,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
 * @author wzy
@@ -34,13 +35,21 @@
        return FebsUtil.view("modules/news/newsInfoList");
    }
    @GetMapping("knowledge")
    @RequiresPermissions("newsInfoList:view")
    public String knowledge() {
        return FebsUtil.view("modules/news/knowledgeList");
    }
    /**
     * 新闻中心-新增
     * @return
     */
    @GetMapping("newsInfoAdd")
    @GetMapping("newsInfoAdd/{code}")
    @RequiresPermissions("newsInfoAdd:add")
    public String newsInfoAdd() {
    public String newsInfoAdd(@PathVariable("code") String code, Model model) {
        model.addAttribute("code", code);
        return FebsUtil.view("modules/news/newsInfoAdd");
    }
@@ -50,10 +59,11 @@
     * @param model
     * @return
     */
    @GetMapping("newsInfoUpdate/{id}")
    @GetMapping("newsInfoUpdate/{id}/{code}")
    @RequiresPermissions("newsInfoUpdate:update")
    public String newsInfoUpdate(@PathVariable long id, Model model) {
    public String newsInfoUpdate(@PathVariable("id") long id, @PathVariable("code") String code, Model model) {
        MallNewsInfo data = mallNewsInfoService.getNewsInfoById(id);
        model.addAttribute("code", code);
        model.addAttribute("newsInfo", data);
        return FebsUtil.view("modules/news/newsInfoUpdate");
    }