package cc.mrbird.febs.mall.controller;
|
|
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.entity.MallProductBuy;
|
import cc.mrbird.febs.mall.entity.MallProductNft;
|
import cc.mrbird.febs.mall.mapper.MallProductBuyMapper;
|
import cc.mrbird.febs.mall.mapper.MallProductNftMapper;
|
import cc.mrbird.febs.mall.service.IMallNewsInfoService;
|
import lombok.RequiredArgsConstructor;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.Model;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
/**
|
* @author wzy
|
* @date 2022-05-13
|
**/
|
@Controller("newView")
|
@RequestMapping(FebsConstant.VIEW_PREFIX + "modules/news")
|
@RequiredArgsConstructor
|
public class ViewNewsController {
|
|
private final IMallNewsInfoService mallNewsInfoService;
|
private final MallProductNftMapper mallProductNftMapper;
|
private final MallProductBuyMapper mallProductBuyMapper;
|
|
/**
|
* NFT预约产品
|
*/
|
@GetMapping("productNFTList")
|
@RequiresPermissions("productNFTList:view")
|
public String productNFTList() {
|
return FebsUtil.view("modules/news/productNFTList");
|
}
|
|
/**
|
* NFT预约产品-新增
|
*/
|
@GetMapping("productNFTAdd")
|
@RequiresPermissions("productNFTAdd:add")
|
public String productNFTAdd() {
|
return FebsUtil.view("modules/news/productNFTAdd");
|
}
|
|
/**
|
* NFT预约产品-详情
|
* @return
|
*/
|
@GetMapping("productNFTUpdate/{id}")
|
@RequiresPermissions("productNFTUpdate:update")
|
public String productNFTUpdate(@PathVariable long id, Model model) {
|
MallProductNft mallProductNft = mallProductNftMapper.selectById(id);
|
model.addAttribute("mallProductNft", mallProductNft);
|
return FebsUtil.view("modules/news/productNFTUpdate");
|
}
|
|
/**
|
* 用户NFT预约列表
|
*/
|
@GetMapping("productBuyList")
|
@RequiresPermissions("productBuyList:view")
|
public String productBuyList() {
|
return FebsUtil.view("modules/news/productBuyList");
|
}
|
|
/**
|
* 用户NFT提现列表
|
*/
|
@GetMapping("productSellList")
|
@RequiresPermissions("productSellList:view")
|
public String productSellList() {
|
return FebsUtil.view("modules/news/productSellList");
|
}
|
|
/**
|
* 用户NFT提现-手动分配
|
* @return
|
*/
|
@GetMapping("productSellPick/{id}")
|
@RequiresPermissions("productSellPick:update")
|
public String productSellPick(@PathVariable long id, Model model) {
|
MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(id);
|
model.addAttribute("mallProductBuy", mallProductBuy);
|
return FebsUtil.view("modules/news/productSellPick");
|
}
|
|
/**
|
* 新闻中心-列表
|
* @return
|
*/
|
@GetMapping("newsInfoList")
|
@RequiresPermissions("newsInfoList:view")
|
public String newsInfoList() {
|
return FebsUtil.view("modules/news/newsInfoList");
|
}
|
|
/**
|
* 新闻中心-新增
|
* @return
|
*/
|
@GetMapping("newsInfoAdd")
|
@RequiresPermissions("newsInfoAdd:add")
|
public String newsInfoAdd() {
|
return FebsUtil.view("modules/news/newsInfoAdd");
|
}
|
|
/**
|
* 新闻中心-详情
|
* @param id
|
* @param model
|
* @return
|
*/
|
@GetMapping("newsInfoUpdate/{id}")
|
@RequiresPermissions("newsInfoUpdate:update")
|
public String newsInfoUpdate(@PathVariable long id, Model model) {
|
MallNewsInfo data = mallNewsInfoService.getNewsInfoById(id);
|
model.addAttribute("newsInfo", data);
|
return FebsUtil.view("modules/news/newsInfoUpdate");
|
}
|
|
@GetMapping("newsCategory")
|
@RequiresPermissions("news:category:view")
|
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");
|
}
|
}
|