xiaoyong931011
2022-09-24 aa2885980b4b6aeb309aab9762a6220e903b498a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package cc.mrbird.febs.mall.controller;
 
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.mall.service.IApiMallGoodsCategoryService;
import cc.mrbird.febs.mall.vo.MallGoodsCategoryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;
 
/**
 * @author wzy
 * @date 2021-09-16
 **/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/api/category")
@Api(value = "ApiMallGoodsCategoryController", tags = "商品分类参数接收类")
public class ApiMallGoodsCategoryController {
 
    private final IApiMallGoodsCategoryService mallGoodsCategoryService;
 
    @ApiOperation(value = "获取商品分类列表", notes = "获取商品分类列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "success", response = MallGoodsCategoryVo.class)
    })
    @GetMapping(value = "/findAllCategoryList")
    public FebsResponse findAllCategoryList() {
        return new FebsResponse().success().data(mallGoodsCategoryService.findAllCategoryList());
    }
 
    @ApiOperation(value = "获取父分类下分类", notes = "获取父分类下分类")
    @GetMapping(value = "/findChildCategoryListById/{id}")
    public FebsResponse findChildCategoryListById(@PathVariable("id") Long id) {
        return new FebsResponse().success().data(mallGoodsCategoryService.findChildCategoryListById(id));
    }
 
    @ApiOperation(value = "获取推荐分类", notes = "获取推荐分类")
    @GetMapping(value = "/findRecommendCategory")
    public FebsResponse findRecommendCategory() {
        return new FebsResponse().success().data(mallGoodsCategoryService.findRecommendCategory());
    }
 
}