diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/controller/TemplateWarehouseController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/controller/TemplateWarehouseController.java index 503e433..b560d19 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/controller/TemplateWarehouseController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/controller/TemplateWarehouseController.java @@ -79,6 +79,20 @@ public class TemplateWarehouseController { return BaseResponse.success(clientVersion); } + /** + * 获得客户端配置文件相关信息 + * + * @return + */ + @ApiOperation("获得客户端配置文件文件id") + @GetMapping("/client/filess") + public BaseResponse getClientFiless() throws IOException { + String type = "ipassConfigFile"; + BizBidTemplateWarehouse templateWarehouse = templateWarehouseService.getTemplateByType(type); + FileOutputStream clientVersion = bizBidClientVersionService.downloadFileByObjectIdss(templateWarehouse.getDocumentCenterId()); + return BaseResponse.success(clientVersion); + } + /** * 通过版本号获得对应客户端文件id * diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/BizBidClientVersionService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/BizBidClientVersionService.java index a6d021e..2fb8124 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/BizBidClientVersionService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/BizBidClientVersionService.java @@ -24,4 +24,6 @@ public interface BizBidClientVersionService extends IBaseService optionalBytes = modelConvertor.toByteArray(objectInfo); + log.info("文档中心s文件下载返回数据转为byte[]数据:"+ JsonUtils.objectToJson(optionalBytes)); + FileOutputStream fileOutputStream = null; + if(optionalBytes.isPresent()){ + ByteArrayOutputStream fileStream = new ByteArrayOutputStream(); + fileStream.write(optionalBytes.get()); + log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据:"+ JsonUtils.objectToJson(fileStream)); + fileOutputStream = new FileOutputStream("C:\\test.txt"); + fileOutputStream.write(fileStream.toByteArray()); + log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据:"+ JsonUtils.objectToJson(fileOutputStream)); + } + return fileOutputStream; + } }