package com.hdkj.lt.si.controller.psrdevice;

import com.hdkj.lt.feign.IPsrDeviceApiClient;
import com.hdkj.lt.modle.dto.psrdevice.JoinEcTransformerDTO;
import com.hdkj.lt.modle.dto.psrdevice.PsrDeviceQueryDTO;
import com.hdkj.lt.modle.po.JoinEcTransformerPO;
import com.hdkj.lt.modle.vo.psrdevice.PsrDeviceResponseVO;
import com.hdkj.lt.si.service.psrdevice.IPsrDeviceService;
import com.hdkj.hussar.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @Description
 * @Author wcx
 * @Date 2025/7/30 10:26
 * @Version 1.0
 */
@RestController
@RequiredArgsConstructor
public class PsrDeviceController {

    private final IPsrDeviceService psrDeviceService;

    @PostMapping(IPsrDeviceApiClient.API_SERVICE_DEVICE_COMMON_GET)
    public ApiResponse<PsrDeviceResponseVO> getPsrDeviceByCommonInterface(@Valid @RequestBody PsrDeviceQueryDTO psrDeviceQuery) {
        return psrDeviceService.getPsrDeviceByCommonInterface(psrDeviceQuery);
    }

    @PostMapping(IPsrDeviceApiClient.API_SERVICE_JOINEC_TRANSFORMER_GET)
    public ApiResponse<List<JoinEcTransformerPO>> getJoinEcTransformerInfo(@Valid @RequestBody JoinEcTransformerDTO joinEcTransformer) {
        return psrDeviceService.getJoinEcTransformerInfo(joinEcTransformer);
    }
}
