package com.nokia.hb.controller;

import com.nokia.common.R;
import com.nokia.hb.pojo.TreeNode;
import com.nokia.hb.service.IndicatorService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "指标")
@RestController
public class IndicatorController {
    private final IndicatorService indicatorService;

    public IndicatorController(IndicatorService indicatorService) {
        this.indicatorService = indicatorService;
    }

    /**
     * 查询指标树形结构
     */
    @Operation(summary = "查询指标树形结构")
    @PostMapping("/api/initTreeIndicator")
    public R<List<TreeNode>> initTreeIndicator() {
        return indicatorService.initTreeIndicator();
    }
}
