xiaoyong931011
2021-09-26 7ebf766e3a037d10d30c569437288c230e83d9a8
src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
@@ -6,6 +6,8 @@
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.vo.AdminAddAddressTreeVo;
import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -15,6 +17,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
@Slf4j
@@ -44,11 +47,29 @@
    }
    /**
     * 商品分类-选择
     */
    @GetMapping("categorys/tree")
    @ControllerEndpoint(exceptionMessage = "获取分类失败")
    public List<AdminMallGoodsCategoryTreeVo> getParentCategorys(){
        return goodsCategoryService.getParentCategorys();
    }
    /**
     * 商品分类-新增
     */
    @PostMapping("addCategory")
    @ControllerEndpoint(operation = " 商品分类-新增", exceptionMessage = "新增失败")
    @ControllerEndpoint(operation = " 商品分类-新增", exceptionMessage = "操作失败")
    public FebsResponse addCategory(@Valid MallGoodsCategory mallGoodsCategory) {
        return goodsCategoryService.addCategory(mallGoodsCategory);
    }
    /**
     * 商品分类-编辑
     */
    @PostMapping("updateCategory")
    @ControllerEndpoint(operation = " 商品分类-编辑", exceptionMessage = "操作失败")
    public FebsResponse updateCategory(@Valid MallGoodsCategory mallGoodsCategory) {
        return goodsCategoryService.updateCategory(mallGoodsCategory);
    }
}