package com.hdkj.lt.feign;

import com.hdkj.lt.base.constants.SystemGlobalConstant;
import com.hdkj.lt.core.bizms.modle.dto.StateEstimation;
import com.hdkj.lt.core.bizms.modle.request.StateEstimationEquipRequest;
import com.hdkj.lt.feign.fallback.MeasurementApiClientFallBack;
import com.hdkj.lt.modle.dto.measurement.*;
import com.hdkj.lt.modle.vo.measurement.*;
import com.hdkj.hussar.ApiResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author rj
 * @date 2025/5/24 下午3:23
 * @description
 */
@FeignClient(path = "/measurement", value = SystemGlobalConstant.SERVICE_NAME_LOAD_TRANSFER_SI,contextId = "IMeasurementApiClient", fallbackFactory = MeasurementApiClientFallBack.class)
public interface IMeasurementApiClient {

    @ApiOperation(value = "获取token")
    @PostMapping("/getAccessToken")
    ApiResponse<MeasurementTokenVO> getAccessToken(MeasurementTokenDTO measurementTokenDTO);

    @ApiOperation(value = "遥信通用查询")
    @PostMapping("/getTelesignalCommonQuery")
    ApiResponse<ContainDeviceMeasurementVO> getTelesignalCommonQuery(ContainDeviceMeasurementDTO containDeviceMeasurementDTO);

    @ApiOperation(value = "遥测通用查询")
    @PostMapping("/getTelemetryCommonQuery")
    ApiResponse<DistributionTransformerVO> getTelemetryCommonQuery(@RequestBody DistributionTransformerDTO distributionTransformerDTO);

    @ApiOperation(value = "获取七天最大电流")
    @PostMapping("/queryPeriodByCommonQuery")
    ApiResponse<Map<String, BigDecimal>> queryPeriodByCommonQuery(StateEstimationEquipRequest request);

    @ApiOperation(value = "获取线路开关量测数据")
    @PostMapping("/queryByFeederSaveCommonQuery")
    ApiResponse<StateEstimation> queryByFeederSaveCommonQuery(StateEstimationEquipRequest request);

    @ApiOperation(value = "缓存开关量测数据")
    @PostMapping("/saveQuery")
    ApiResponse saveQuery(DistributionReceiveVO request);

    @PostMapping("/queryCommonQueryByDay")
    @ApiOperation(value = "按日期获取曲线图信息")
    ApiResponse<RecordsVO> queryCommonQueryByDay(@RequestBody DistributionTransformerDTO distributionTransformerDTO);

}
