1.app远程接口添加
This commit is contained in:
@@ -4,11 +4,15 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.harmonic.api.fallback.HarmDataFeignClientFallbackFactory;
|
||||
import com.njcn.harmonic.pojo.param.HistoryHarmParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(
|
||||
value = ServerInfo.HARMONIC,
|
||||
path = "/harmonic",
|
||||
@@ -25,4 +29,19 @@ public interface HarmDataFeignClient {
|
||||
@PostMapping("/getHistoryHarmData")
|
||||
HttpResult<HarmHistoryDataDTO> getHistoryHarmData(@RequestBody HistoryHarmParam historyHarmParam);
|
||||
|
||||
/**
|
||||
* 获取越线监测点
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getLinesTarget")
|
||||
HttpResult<List<String>> getLinesTarget(@RequestBody StatSubstationBizBaseParam param);
|
||||
|
||||
/**
|
||||
* 获取越线监测点越线次数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getLinesRate")
|
||||
HttpResult<List<RStatLimitRateDPO>> getLinesRate(@RequestBody StatSubstationBizBaseParam param);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,15 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.harmonic.api.HarmDataFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.HistoryHarmParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
@@ -34,6 +38,18 @@ public class HarmDataFeignClientFallbackFactory implements FallbackFactory<HarmD
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取谐波历史数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getLinesTarget(StatSubstationBizBaseParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取越线监测点", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatLimitRateDPO>> getLinesRate(StatSubstationBizBaseParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取越线监测点越线次数", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user