package com.bonus.zlpt.home.controller;

import cn.hutool.core.lang.tree.Tree;
import com.bonus.zlpt.common.core.web.controller.BaseController;
import com.bonus.zlpt.common.core.web.page.TableDataInfo;
import com.bonus.zlpt.home.service.MaTypeInfoSevice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 搜索分类
 */
@Api(value = "搜索分类",tags = {"搜索分类"})
@RestController
@RequestMapping("/maType")
public class MaTypeInfoController extends BaseController {

    @Resource
    private MaTypeInfoSevice maTypeInfoSevice;

    /**
     * 搜索分类
     * @return
     */
    @ApiOperation("搜索分类树")
    @GetMapping("/getEquipmentType")
    public TableDataInfo getEquipmentType() {
        List<Tree<Long>> list = maTypeInfoSevice.getMaTypeInfoList();
        return getDataTable(list);
    }

}
