package com.hdkj.lt.mq.controller;

import cn.hutool.json.JSONObject;
import com.hdkj.lt.core.mvc.BaseController;
import com.hdkj.lt.mq.entity.dto.AnalyzeDecudeParamDTO;
import com.hdkj.lt.mq.service.fault.FaultFhzgReasoningPlatformService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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 zhuzhe
 * @since 2025-05-12
 */
@Slf4j
@RestController
@RequestMapping("/fhzgFaultReasoningPlatform")
@RequiredArgsConstructor
public class FaultFhzgReasoningPlatformController extends BaseController {

    private final FaultFhzgReasoningPlatformService planReasoningPlatform;

    /**
     * 获取停电区域列表
     * @param message
     * @return
     */
    @PostMapping("/getAnalyzeParam")
    @ApiOperation(value = "查询故障调用推演平台参数")
    public AnalyzeDecudeParamDTO getAnalyzeParam(@RequestBody String message) {
        JSONObject jsonObject = new JSONObject(message);
        Long faultId = jsonObject.getLong("faultId");
        AnalyzeDecudeParamDTO paramDTO = planReasoningPlatform.getAnalyzeParam(faultId);
        return paramDTO;
    }

}
