创建category类

This commit is contained in:
Bunny 2023-12-15 09:01:32 +08:00
parent 676e307624
commit bc29b1f58e
3 changed files with 53 additions and 0 deletions

View File

@ -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<Category> categoryList = categoryService.findCategoryList(id);
return Result.build(categoryList, ResultCodeEnum.SUCCESS);
}
}

View File

@ -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<Category> findCategoryList(Long id);
}

View File

@ -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<Category> findCategoryList(Long id) {
return null;
}
}