package com.njcn.product.cnzutai.zutai.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.common.utils.HttpResultUtil;
import com.njcn.product.cnzutai.zutai.pojo.vo.CsRtDataVO;
import com.njcn.product.cnzutai.zutai.pojo.vo.RealTimeDataVo;
import com.njcn.product.cnzutai.zutai.service.ILineTargetService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Description:
 * Date: 2025/09/10  下午 7:46【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/data")
@Api(tags = "装置数据")
@AllArgsConstructor
public class RealTimeDataController extends BaseController {
    private final ILineTargetService lineTargetService;
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/realTimeData")
    @ApiOperation("设备监控-》准实时数据")
    public HttpResult<List<CsRtDataVO>> realTimeData(@RequestParam String pageId) {
        String methodDescribe = getMethodDescribe("realTimeData");
        List<CsRtDataVO> lineData = lineTargetService.getLineData(pageId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineData, methodDescribe);
    }
}
