代码调整

This commit is contained in:
2023-04-18 11:42:16 +08:00
parent 41af9bb765
commit 728a03afde
10 changed files with 50 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ package com.njcn.algorithm.api;
import com.njcn.algorithm.api.fallback.DevModelFeignClientFallbackFactory;
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryListParm;
import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
@@ -19,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
public interface DevModelFeignClient {
@PostMapping("/addDevModel")
HttpResult<Boolean> addDevModel(@RequestBody @Validated CsDevModelAddParm csDevModelAddParm);
HttpResult<CsDevModelPO> addDevModel(@RequestBody @Validated CsDevModelAddParm csDevModelAddParm);
@PostMapping("/queryDevModelOne")
HttpResult<CsDevModelPageVO> queryDevModelOne(@RequestBody CsDevModelQueryListParm csDevModelQueryListParm);

View File

@@ -18,4 +18,7 @@ public interface EquipmentFeignClient {
@PostMapping("/queryEquipmentByndid")
HttpResult<CsEquipmentDeliveryVO> queryEquipmentByndid(@RequestParam("ndid") String ndid);
@PostMapping("/updateStatusBynDid")
HttpResult<Boolean> updateStatusBynDid(@RequestParam("nDId") String nDid,@RequestParam("status") Integer status);
}

View File

@@ -3,6 +3,7 @@ package com.njcn.algorithm.api.fallback;
import com.njcn.algorithm.api.DevModelFeignClient;
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryListParm;
import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
@@ -35,7 +36,7 @@ public class DevModelFeignClientFallbackFactory implements FallbackFactory<DevMo
return new DevModelFeignClient() {
@Override
public HttpResult<Boolean> addDevModel(CsDevModelAddParm csDevModelAddParm) {
public HttpResult<CsDevModelPO> addDevModel(CsDevModelAddParm csDevModelAddParm) {
log.error("{}异常,降级处理,异常为:{}","新增装置模板版本信息",cause.toString());
throw new BusinessException(finalExceptionEnum);
}

View File

@@ -8,6 +8,7 @@ import com.njcn.common.pojo.response.HttpResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author xy
@@ -31,6 +32,12 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
log.error("{}异常,降级处理,异常为:{}","通过ndid查询出厂设备异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<Boolean> updateStatusBynDid(String nDid, Integer status) {
log.error("{}异常,降级处理,异常为:{}","通过ndid修改装置的状态",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}