package com.njcn.product.terminal.mysqlTerminal.controller;


import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.product.terminal.mysqlTerminal.pojo.dto.LedgerTreeDTO;
import com.njcn.product.terminal.mysqlTerminal.service.LineService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author denghuajun
 * @date 2022/2/23
 * 监测点相关
 */
@Slf4j
@Api(tags = "监测点管理")
@RestController
@RequestMapping("/line")
@RequiredArgsConstructor
public class LineController extends BaseController {

    private final LineService lineService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取台账树")
    @GetMapping(value = "/tree")
    public HttpResult<Object> tree() {
        String methodDescribe = getMethodDescribe("tree");
        List<LedgerTreeDTO> treeDTOList = lineService.getTree();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, treeDTOList, methodDescribe);
    }



}
