package jnpf.authority.controller;

import io.swagger.v3.oas.annotations.Operation;
import jnpf.authority.service.FtbPermissionGradesService;
import jnpf.base.ActionResult;
import jnpf.permission.vo.v2.grades.GradeNodeVO;
import jnpf.util.NoDataSourceBind;
import lombok.extern.slf4j.Slf4j;
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;

/**
 * 带权限的职级
 *
 * @author Flynn Chan
 * @create 2025-05-07
 */
@RestController
@RequestMapping("/permission/grades")
@Slf4j
public class FtbPermissionGradesController {
    @Resource
    private FtbPermissionGradesService gradesService;

    @Operation(summary = "[树]权限过滤职级树(职类,职级别,职级)")
    @GetMapping(value = "/tree")
    @NoDataSourceBind
    public ActionResult<List<GradeNodeVO>> gradeTree() {
        return ActionResult.success(gradesService.gradeTree());
    }
}
