This commit is contained in:
huangzj
2023-08-03 14:03:46 +08:00
parent ab360ed348
commit 448af492d6
29 changed files with 457 additions and 151 deletions

View File

@@ -3,6 +3,7 @@ package com.njcn.csdevice.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.fallback.CsLedgerFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.param.CsLedgerParam;
import com.njcn.csdevice.pojo.po.CsLedger;
import org.springframework.cloud.openfeign.FeignClient;
@@ -11,6 +12,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author xy
*/
@@ -23,4 +26,8 @@ public interface CsLedgerFeignClient {
@PostMapping("/add")
HttpResult<CsLedger> add(@RequestBody @Validated CsLedgerParam csLedgerParam);
}
@PostMapping("/queryLine")
HttpResult<List<CsLedger>> queryLine(@RequestBody @Validated LineParamDTO lineParamdto);
}

View File

@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.CsLedgerFeignClient;
import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.param.CsLedgerParam;
import com.njcn.csdevice.pojo.po.CsLedger;
import com.njcn.csdevice.utils.CsDeviceEnumUtil;
@@ -11,6 +12,8 @@ import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author xy
*/
@@ -39,6 +42,12 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
log.error("{}异常,降级处理,异常为:{}","新增台账数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<CsLedger>> queryLine(LineParamDTO lineParamdto) {
log.error("{}异常,降级处理,异常为:{}","查询监测点",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}