用能空调定时关机策略
This commit is contained in:
@@ -2,6 +2,7 @@ package com.njcn.energy.pojo.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.energy.pojo.api.fallback.EleAirStrategyFallbackFactory;
|
||||
import com.njcn.energy.pojo.api.fallback.EleOnlineRateFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -14,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
* @author cdf
|
||||
* @date 2022/4/22
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.ENERGY,path = "/air",fallbackFactory = EleOnlineRateFallbackFactory.class)
|
||||
@FeignClient(value = ServerInfo.ENERGY,path = "/air",fallbackFactory = EleAirStrategyFallbackFactory.class)
|
||||
public interface EleAirStrategyFeignClient {
|
||||
|
||||
/**
|
||||
@@ -23,6 +24,6 @@ public interface EleAirStrategyFeignClient {
|
||||
* @date 2022/4/22
|
||||
*/
|
||||
@GetMapping("dealAirStrategyId")
|
||||
HttpResult<Boolean> dealAirStrategyId(@RequestParam("id") String id,@RequestParam("operation") String operation);
|
||||
HttpResult<Boolean> dealAirStrategyId(@RequestParam("operation") String operation);
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class EleAirStrategyFallbackFactory implements FallbackFactory<EleAirStra
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new EleAirStrategyFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> dealAirStrategyId(String id,String operation) {
|
||||
public HttpResult<Boolean> dealAirStrategyId(String operation) {
|
||||
log.error("{}异常,降级处理,异常为:{}","空调控制策略数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user