package com.njcn.product.terminal.event.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.event.file.pojo.dto.WaveDataDTO;
import com.njcn.product.terminal.event.pojo.param.MonitorTerminalParam;
import com.njcn.product.terminal.event.service.EventGateService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: cdf
 * @CreateTime: 2025-09-03
 * @Description:
 */
@Api(tags = "暂降接收")
@RequestMapping("accept")
@RestController
@RequiredArgsConstructor
@Slf4j
public class EventGateController extends BaseController {

    private final EventGateService eventGateService;


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getTransientAnalyseWave")
    @ApiOperation("暂态事件波形分析")
    public HttpResult<WaveDataDTO> getTransientAnalyseWave(@RequestBody @Validated MonitorTerminalParam param) {
        String methodDescribe = getMethodDescribe("getTransientAnalyseWave");
        WaveDataDTO wave = eventGateService.getTransientAnalyseWave(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, wave, methodDescribe);
    }
}
