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

import com.alibaba.fastjson.JSONObject;
import com.hdkj.lt.feign.ISimulationPlatformApiClient;
import com.hdkj.lt.modle.dto.simulation.ElectricalModelRequest;
import com.hdkj.lt.modle.dto.simulation.ElectricalModelResponse;
import com.hdkj.lt.modle.dto.simulation.FaultTransferSchemeDTO;
import com.hdkj.lt.modle.dto.simulation.OperationSchemeDTO;
import com.hdkj.lt.modle.dto.simulation.PlanTransferSchemeDTO;
import com.hdkj.lt.si.service.simulation.ISimulationService;
import com.hdkj.hussar.ApiResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rj
 * @date 2025/5/26 下午4:19
 * @description
 */
@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/simulation")
public class SimulationController implements ISimulationPlatformApiClient {

    private final ISimulationService simulationService;

    @Override
    public String getPlanTransferScheme(PlanTransferSchemeDTO planTransferSchemeDTO) {
        String success = simulationService.getPlanTransferScheme(planTransferSchemeDTO);
        log.info("计划方案最终结果: " + JSONObject.toJSONString(success));
        return success;
    }

    @Override
    public String getFaultTransferScheme(FaultTransferSchemeDTO faultTransferSchemeDTO) {
        return simulationService.getFaultTransferScheme(faultTransferSchemeDTO);
    }

    @Override
    public String getOperationScheme(OperationSchemeDTO operationSchemeDTO) {
        return simulationService.getOperationScheme(operationSchemeDTO);
    }

    @Override
    public String getElectricalModel(ElectricalModelRequest request) {
        return simulationService.getElectricalModel(request);
    }
}
