xiaoyong931011
2022-09-15 1f7383c5e295f11a66fdfa9b75e596f72b35b4a8
src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
@@ -6,17 +6,16 @@
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.mall.entity.MallGoodsCategory;
import cc.mrbird.febs.mall.service.IAdminMallGoodsCategoryService;
import cc.mrbird.febs.mall.service.IApiMallGoodsCategoryService;
import cc.mrbird.febs.mall.vo.AdminAddAddressTreeVo;
import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
@@ -28,6 +27,7 @@
public class AdminMallGoodsCategoryController extends BaseController {
    private final IAdminMallGoodsCategoryService goodsCategoryService;
    private final IApiMallGoodsCategoryService mallGoodsCategoryService;
    /**
     * 商品分类列表
@@ -46,6 +46,11 @@
        return new FebsResponse().success().data(goodsCategoryService.getCategorys(mallGoodsCategory));
    }
    @GetMapping(value = "/categoryTree")
    public FebsResponse categoryTree() {
        return new FebsResponse().success().data(mallGoodsCategoryService.findAllCategoryList());
    }
    /**
     * 商品分类-选择
     */
@@ -53,6 +58,15 @@
    @ControllerEndpoint(exceptionMessage = "获取分类失败")
    public List<AdminMallGoodsCategoryTreeVo> getParentCategorys(){
        return goodsCategoryService.getParentCategorys();
    }
    /**
     * 商品分类-全部选择
     */
    @GetMapping("categorys/allTree")
    @ControllerEndpoint(exceptionMessage = "获取分类失败")
    public List<AdminMallGoodsCategoryTreeVo> getAllCategorys(){
        return goodsCategoryService.getAllCategorys();
    }
    /**
@@ -72,4 +86,15 @@
    public FebsResponse updateCategory(@Valid MallGoodsCategory mallGoodsCategory) {
        return goodsCategoryService.updateCategory(mallGoodsCategory);
    }
    /**
     * 商品分类-删除
     */
    @GetMapping("delCategary/{id}")
    @ControllerEndpoint(operation = " 商品分类-删除", exceptionMessage = "操作失败")
    public FebsResponse delCategary(@NotNull(message = "{required}") @PathVariable Long id) {
        return goodsCategoryService.delCategary(id);
    }
}