package cn.iocoder.yudao.module.basic.controller.admin.goodscategory;

import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;

import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;

import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;

import cn.iocoder.yudao.module.basic.controller.admin.goodscategory.vo.*;
import cn.iocoder.yudao.module.basic.dal.dataobject.goodscategory.GoodsCategoryDO;
import cn.iocoder.yudao.module.basic.convert.goodscategory.GoodsCategoryConvert;
import cn.iocoder.yudao.module.basic.service.goodscategory.GoodsCategoryService;

@Api(tags = "管理后台 - 商品分类表")
@RestController
@RequestMapping("/basic/goods-category")
@Validated
public class GoodsCategoryController {

    @Resource
    private GoodsCategoryService goodsCategoryService;

    @GetMapping("/levelList")
    @ApiOperation("获得商品分类表")
    @PreAuthorize("@ss.hasPermission('basic:goods-category:query')")
    public CommonResult<List<GoodsCategoryVO>> getGoodsCategoryPage() {
        List<GoodsCategoryVO> levelList = goodsCategoryService.getGoodsCategoryThreeLevelList();
        return success(levelList);
    }
}
