暂降事件

This commit is contained in:
huangzj
2023-09-06 14:21:47 +08:00
parent 61a9a99e47
commit 61ebd8830e
25 changed files with 478 additions and 64 deletions

View File

@@ -3,9 +3,12 @@ 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.DevDetailDTO;
import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.param.CsLedgerParam;
import com.njcn.csdevice.pojo.po.CsLedger;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@@ -29,5 +32,7 @@ public interface CsLedgerFeignClient {
@PostMapping("/queryLine")
HttpResult<List<CsLedger>> queryLine(@RequestBody @Validated LineParamDTO lineParamdto);
@PostMapping("/queryDevDetail")
HttpResult<DevDetailDTO> queryDevDetail(@RequestParam("devId") String devId);
}

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.DevDetailDTO;
import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.param.CsLedgerParam;
import com.njcn.csdevice.pojo.po.CsLedger;
@@ -48,6 +49,12 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
log.error("{}异常,降级处理,异常为:{}","查询监测点",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<DevDetailDTO> queryDevDetail(String devId) {
log.error("{}异常,降级处理,异常为:{}","查询设备详情",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,34 @@
package com.njcn.csdevice.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Description:
* Date: 2023/9/6 13:59【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class DevDetailDTO {
@ApiModelProperty(value = "工程id")
private String engineeringid;
/**
* 工程名称
*/
@ApiModelProperty(value = "工程名称")
private String engineeringName;
@ApiModelProperty(value = "项目id")
private String projectId;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "设备id")
private String equipmentId;
@ApiModelProperty(value = "设备名称")
private String equipmentName;
}