代码调整

This commit is contained in:
2023-08-04 11:20:36 +08:00
parent 448af492d6
commit 15d8494cac
21 changed files with 238 additions and 108 deletions

View File

@@ -19,9 +19,9 @@ import java.util.List;
public interface DataSetFeignClient {
@PostMapping("/getSetByModelId")
HttpResult<List<CsDataSet>> getSetByModelId(@RequestParam("modelId") String modelId);
HttpResult<List<CsDataSet>> getSetByModelId(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev);
@PostMapping("/getDataSet")
HttpResult<List<LineTargetVO>> getDataSet(@RequestParam("modelId") String modelId);
HttpResult<List<LineTargetVO>> getDataSet(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev);
}

View File

@@ -11,6 +11,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
*/
@@ -18,9 +20,12 @@ import org.springframework.web.bind.annotation.RequestParam;
public interface DevModelRelationFeignClient {
@PostMapping("/getModelByDevId")
HttpResult<CsDevModelRelationPO> getModelByDevId(@RequestParam("devId") String devId);
HttpResult<List<CsDevModelRelationPO>> getModelByDevId(@RequestParam("devId") String devId);
@PostMapping("/addDevModelRelation")
HttpResult<CsDevModelRelationPO> addDevModelRelation(@RequestBody @Validated CsDevModelRelationAddParm addParm);
@PostMapping("/getModelByType")
HttpResult<String> getModelByType(@RequestParam("devId") String devId, @RequestParam("type") Integer type);
}

View File

@@ -34,13 +34,13 @@ public class DataSetFeignClientFallbackFactory implements FallbackFactory<DataSe
Enum<?> finalExceptionEnum = exceptionEnum;
return new DataSetFeignClient() {
@Override
public HttpResult<List<CsDataSet>> getSetByModelId(String modelId) {
public HttpResult<List<CsDataSet>> getSetByModelId(String modelId,Integer clDev) {
log.error("{}异常,降级处理,异常为:{}","根据模板id获取数据集",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<LineTargetVO>> getDataSet(String modelId) {
public HttpResult<List<LineTargetVO>> getDataSet(String modelId,Integer clDev) {
log.error("{}异常,降级处理,异常为:{}","获取数据集",cause.toString());
throw new BusinessException(finalExceptionEnum);
}

View File

@@ -11,6 +11,8 @@ import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author xy
*/
@@ -28,7 +30,7 @@ public class DevModelRelationFeignClientFallbackFactory implements FallbackFacto
Enum<?> finalExceptionEnum = exceptionEnum;
return new DevModelRelationFeignClient() {
@Override
public HttpResult<CsDevModelRelationPO> getModelByDevId(String devId) {
public HttpResult<List<CsDevModelRelationPO>> getModelByDevId(String devId) {
log.error("{}异常,降级处理,异常为:{}","根据装置获取模板",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@@ -38,6 +40,12 @@ public class DevModelRelationFeignClientFallbackFactory implements FallbackFacto
log.error("{}异常,降级处理,异常为:{}","绑定设备与模板",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> getModelByType(String devId, Integer type) {
log.error("{}异常,降级处理,异常为:{}","根据装置类型查询模板",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}