diff --git a/spzx-manager/src/main/java/cn/bunny/controller/CategoryController.java b/spzx-manager/src/main/java/cn/bunny/controller/CategoryController.java new file mode 100644 index 0000000..fd306ed --- /dev/null +++ b/spzx-manager/src/main/java/cn/bunny/controller/CategoryController.java @@ -0,0 +1,28 @@ +package cn.bunny.controller; + + +import cn.bunny.common.spzx.model.entity.product.Category; +import cn.bunny.common.spzx.model.vo.common.Result; +import cn.bunny.common.spzx.model.vo.common.ResultCodeEnum; +import cn.bunny.service.CategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/admin/product/category") +public class CategoryController { + @Autowired + CategoryService categoryService; + + @GetMapping("/findCategoryList/{id}") + public Result findCategoryList(@PathVariable("id") Long id) { + List categoryList = categoryService.findCategoryList(id); + + return Result.build(categoryList, ResultCodeEnum.SUCCESS); + } +} diff --git a/spzx-manager/src/main/java/cn/bunny/service/CategoryService.java b/spzx-manager/src/main/java/cn/bunny/service/CategoryService.java new file mode 100644 index 0000000..735fa96 --- /dev/null +++ b/spzx-manager/src/main/java/cn/bunny/service/CategoryService.java @@ -0,0 +1,10 @@ +package cn.bunny.service; + +import cn.bunny.common.spzx.model.entity.product.Category; + +import java.util.List; + +public interface CategoryService { + // 根据id查询分类列表 + List findCategoryList(Long id); +} diff --git a/spzx-manager/src/main/java/cn/bunny/service/impl/CategoryServiceImpl.java b/spzx-manager/src/main/java/cn/bunny/service/impl/CategoryServiceImpl.java new file mode 100644 index 0000000..c941891 --- /dev/null +++ b/spzx-manager/src/main/java/cn/bunny/service/impl/CategoryServiceImpl.java @@ -0,0 +1,15 @@ +package cn.bunny.service.impl; + +import cn.bunny.common.spzx.model.entity.product.Category; +import cn.bunny.service.CategoryService; + +import java.util.List; + +public class CategoryServiceImpl implements CategoryService { + + // 根据id查询分类列表 + @Override + public List findCategoryList(Long id) { + return null; + } +}