package com.bonus.canteen.core.menu.controller.sys;

import com.bonus.canteen.core.menu.service.impl.sys.SysMenuMaterialCategoryServiceImpl;
import com.bonus.canteen.core.menu.vo.MenuCategoryTreeVO;
import com.bonus.common.core.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping({"/api/v1/system/sysMenuMaterialCategory"})
public class SysMenuMaterialCategoryController {
   private static final Logger log = LoggerFactory.getLogger(SysMenuMaterialCategoryController.class);
   @Autowired
   private SysMenuMaterialCategoryServiceImpl sysMenuMaterialCategoryService;

   @PostMapping({"/tree/list"})
   @ApiOperation("获取所有类别的树形结构")
   public AjaxResult getCategoryTreeList() {
      List<MenuCategoryTreeVO> resultList = this.sysMenuMaterialCategoryService.getCategoryTreeList();
      return AjaxResult.success(resultList);
   }
}
