| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsConstant; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | 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 |
| | |
| | | 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"); |
| | | } |
| | | |
| | |
| | | * @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"); |
| | | } |
| | |
| | | public String newsCategory() { |
| | | return FebsUtil.view("modules/news/newsCategory"); |
| | | } |
| | | |
| | | @GetMapping("addCategory") |
| | | @RequiresPermissions("news:category:add") |
| | | public String addCategory(Long id, Model model) { |
| | | if (id != null) { |
| | | MallNewsCategory obj = mallNewsInfoService.findNewsCategoryById(id); |
| | | model.addAttribute("obj", obj); |
| | | } |
| | | return FebsUtil.view("modules/news/newsCategoryAdd"); |
| | | } |
| | | |
| | | @GetMapping("updateCategory/{id}") |
| | | @RequiresPermissions("news:category:update") |
| | | public String updateCategory(@PathVariable Long id, Model model) { |
| | | if (id != null) { |
| | | MallNewsCategory obj = mallNewsInfoService.findNewsCategoryById(id); |
| | | model.addAttribute("obj", obj); |
| | | } |
| | | return FebsUtil.view("modules/news/newsCategoryAdd"); |
| | | } |
| | | } |