From bc29b1f58e5c1936b8b2317c23baee2ecc4d5ff0 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Fri, 15 Dec 2023 09:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAcategory=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bunny/controller/CategoryController.java | 28 +++++++++++++++++++ .../cn/bunny/service/CategoryService.java | 10 +++++++ .../service/impl/CategoryServiceImpl.java | 15 ++++++++++ 3 files changed, 53 insertions(+) create mode 100644 spzx-manager/src/main/java/cn/bunny/controller/CategoryController.java create mode 100644 spzx-manager/src/main/java/cn/bunny/service/CategoryService.java create mode 100644 spzx-manager/src/main/java/cn/bunny/service/impl/CategoryServiceImpl.java 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; + } +}