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.service.IMallShopService;
|
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;
|
|
@Controller("shopView")
|
@RequestMapping(FebsConstant.VIEW_PREFIX + "modules/shop")
|
@RequiredArgsConstructor
|
public class ViewMallShopController {
|
|
|
private final IMallShopService mallShopService;
|
|
@GetMapping("/shopList")
|
@RequiresPermissions("shop:view")
|
public String shopList() {
|
return FebsUtil.view("modules/shop/shopList");
|
}
|
|
|
@RequiresPermissions("shop:add")
|
@GetMapping("add")
|
public String add() {
|
return FebsUtil.view("modules/shop/add");
|
}
|
|
|
@RequiresPermissions("shop:update")
|
@GetMapping("update/{id}")
|
public String update(@PathVariable("id") Long id, Model model) {
|
model.addAttribute("shopInfo", mallShopService.getById(id));
|
return FebsUtil.view("modules/shop/update");
|
}
|
|
}
|