1.移植程序软件接口;

2.返回文件上传、下载进度信息
This commit is contained in:
xy
2024-09-19 14:26:29 +08:00
parent 32520907d2
commit b59c85e791
11 changed files with 57 additions and 233 deletions

View File

@@ -1,20 +0,0 @@
package com.njcn.access.api;
import com.njcn.access.api.fallback.CsSoftInfoClientFallbackFactory;
import com.njcn.access.pojo.po.CsSoftInfoPO;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author xy
*/
@FeignClient(value = ServerInfo.ACCESS_BOOT, path = "/csSoftInfo", fallbackFactory = CsSoftInfoClientFallbackFactory.class,contextId = "csSoftInfo")
public interface CsSoftInfoFeignClient {
@PostMapping("/findSoftInfo")
HttpResult<CsSoftInfoPO> findSoftInfo(@RequestParam("id") String id);
}

View File

@@ -1,34 +0,0 @@
package com.njcn.access.api.fallback;
import com.njcn.access.api.CsSoftInfoFeignClient;
import com.njcn.access.pojo.po.CsSoftInfoPO;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author xy
*/
@Slf4j
@Component
public class CsSoftInfoClientFallbackFactory implements FallbackFactory<CsSoftInfoFeignClient> {
@Override
public CsSoftInfoFeignClient create(Throwable cause) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (cause.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) cause.getCause();
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new CsSoftInfoFeignClient() {
@Override
public HttpResult<CsSoftInfoPO> findSoftInfo(String id) {
log.error("{}异常,降级处理,异常为:{}","获取装置软件信息",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -1,61 +0,0 @@
package com.njcn.access.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
/**
* <p>
* 系统软件表
* </p>
*
* @author xuyang
* @since 2023-05-17
*/
@Data
@TableName("cs_soft_info")
public class CsSoftInfoPO {
private static final long serialVersionUID = 1L;
private String id;
/**
* 读写操作属性“r”
*/
private String opAttr;
/**
* 操作系统名称裸机系统填Null
*/
private String osName;
/**
* 操作系统版本裸机系统填Null
*/
private String osVersion;
/**
* 应用程序版本号
*/
private String appVersion;
/**
* 应用程序发布日期
*/
private LocalDateTime appDate;
/**
* 应用程序校验码
*/
private String appCheck;
/**
* 是否支持远程升级程序
*/
private String softUpdate;
}