From e2b1424555889b1cec71c9d52f0799dfdee9d927 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Fri, 22 Dec 2023 15:51:23 +0800
Subject: [PATCH] 富文本框输入版本变化
---
src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 94 insertions(+), 5 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java b/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
index 62faa84..333b3fa 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
@@ -4,17 +4,20 @@
import cc.mrbird.febs.common.controller.BaseController;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.entity.QueryRequest;
+import cc.mrbird.febs.common.utils.AppContants;
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;
@Slf4j
@@ -25,6 +28,7 @@
public class AdminMallGoodsCategoryController extends BaseController {
private final IAdminMallGoodsCategoryService goodsCategoryService;
+ private final IApiMallGoodsCategoryService mallGoodsCategoryService;
/**
* 商品分类列表
@@ -43,12 +47,97 @@
return new FebsResponse().success().data(goodsCategoryService.getCategorys(mallGoodsCategory));
}
+ @GetMapping(value = "/categoryTree")
+ public FebsResponse categoryTree() {
+ return new FebsResponse().success().data(mallGoodsCategoryService.findAllCategoryList());
+ }
+
+ @GetMapping(value = "/categoryAppTree")
+ public FebsResponse categoryAppTree() {
+ return new FebsResponse().success().data(mallGoodsCategoryService.findAllAppCategoryList());
+ }
+
+ /**
+ * 商品分类-选择
+ */
+ @GetMapping("categorys/tree")
+ @ControllerEndpoint(exceptionMessage = "获取分类失败")
+ public List<AdminMallGoodsCategoryTreeVo> getParentCategorys(){
+ return goodsCategoryService.getParentCategorys();
+ }
+
+ /**
+ * 商品分类-全部选择
+ */
+ @GetMapping("categorys/allTree")
+ @ControllerEndpoint(exceptionMessage = "获取分类失败")
+ public List<AdminMallGoodsCategoryTreeVo> getAllCategorys(){
+ return goodsCategoryService.getAllCategorys();
+ }
+
/**
* 商品分类-新增
*/
@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);
+ }
+
+ /**
+ * 商品分类-删除
+ */
+ @GetMapping("delCategary/{id}")
+ @ControllerEndpoint(operation = " 商品分类-删除", exceptionMessage = "操作失败")
+ public FebsResponse delCategary(@NotNull(message = "{required}") @PathVariable Long id) {
+ return goodsCategoryService.delCategary(id);
+ }
+
+ /**
+ * APP商品分类列表
+ * @param mallGoodsCategory
+ * @param request
+ * @return
+ */
+ @GetMapping("categoryAppList")
+ public FebsResponse categoryAppList(MallGoodsCategory mallGoodsCategory, QueryRequest request) {
+ mallGoodsCategory.setIsApp(AppContants.IS_APP_CATEGORY);
+ Map<String, Object> data = getDataTable(goodsCategoryService.getCategoryList(mallGoodsCategory, request));
+ return new FebsResponse().success().data(data);
+ }
+ /**
+ * 商品分类-新增
+ */
+ @PostMapping("addAppCategory")
+ @ControllerEndpoint(operation = " 商品分类-新增", exceptionMessage = "操作失败")
+ public FebsResponse addAppCategory(@Valid MallGoodsCategory mallGoodsCategory) {
+ return goodsCategoryService.addAppCategory(mallGoodsCategory);
+ }
+ /**
+ * 商品分类-编辑
+ */
+ @PostMapping("updateAppCategory")
+ @ControllerEndpoint(operation = " 商品分类-编辑", exceptionMessage = "操作失败")
+ public FebsResponse updateAppCategory(@Valid MallGoodsCategory mallGoodsCategory) {
+ return goodsCategoryService.updateAppCategory(mallGoodsCategory);
+ }
+ /**
+ * 商品分类-删除
+ */
+ @GetMapping("delAppCategary/{id}")
+ @ControllerEndpoint(operation = " 商品分类-删除", exceptionMessage = "操作失败")
+ public FebsResponse delAppCategary(@NotNull(message = "{required}") @PathVariable Long id) {
+ return goodsCategoryService.delAppCategary(id);
+ }
+
+
}
--
Gitblit v1.9.1