package com.dsk.cscec.controller;


import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.TreeSelect;
import com.dsk.cscec.domain.bo.BizDictDataBo;
import com.dsk.cscec.service.IBizDictDataService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 字典相关
 *
 * @author
 * @since 2023-12-10
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/bizDictData")
public class BizDictDataController extends BaseController {
    /**
     * 服务对象
     */
    private final IBizDictDataService iBizDictDataService;

    /**
     * 查询业务数据字典树形列表
     *
     * @return
     */
    @GetMapping("/tree")
    public R<List<TreeSelect>> tree(@Validated BizDictDataBo bo) {
        return R.ok(iBizDictDataService.buildDeptTreeSelect(bo));
    }

}

