From 8ab8112829e9ea7a86982efccc91d89597f14b3b Mon Sep 17 00:00:00 2001 From: zhangyx <1254353766@qq.com> Date: Thu, 25 Mar 2021 15:48:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TemplateWarehouseController.java | 14 +++++++++++++ .../sevice/BizBidClientVersionService.java | 2 ++ .../impl/BizBidClientVersionServiceImpl.java | 21 ++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) 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 d312c2d..503e433 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 @@ -65,6 +65,20 @@ public class TemplateWarehouseController { return BaseResponse.success(clientVersion); } + /** + * 获得客户端配置文件相关信息 + * + * @return + */ + @ApiOperation("获得客户端配置文件文件id") + @GetMapping("/client/files") + public BaseResponse getClientFiles() throws IOException { + String type = "ipassConfigFile"; + BizBidTemplateWarehouse templateWarehouse = templateWarehouseService.getTemplateByType(type); + FileOutputStream clientVersion = bizBidClientVersionService.downloadFileByObjectIds(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 b640327..a6d021e 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 @@ -22,4 +22,6 @@ public interface BizBidClientVersionService extends IBaseService optionalBytes = modelConvertor.toByteArray(objectInfo); log.info("文档中心文件下载返回数据转为byte[]数据:"+ JsonUtils.objectToJson(optionalBytes)); @@ -58,4 +58,23 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl 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.write(fileStream.toByteArray()); + log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据:"+ JsonUtils.objectToJson(fileOutputStream)); + } + return fileOutputStream; + } }