diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java index 9a02d4c..08fa78e 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java @@ -256,6 +256,26 @@ public class WpsController { * @return */ @ApiOperation("(金山)沃文档回调-查询文档") + @GetMapping("/kingSoft/word") + public void getWord() { + try { + URL crt = WpsController.class.getClassLoader().getResource("text.doc"); + File file = new File(crt.getPath()); + BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); + byte buf[] = IOUtils.toByteArray(bis); + }catch (Exception e){ + log.error("读取异常",e); + CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("模板文件读取异常",true); + } + } + /** + * (金山)沃文档回调-查询文档 + * 编辑 permission=write + * 预览 permission=read + * @param + * @return + */ + @ApiOperation("(金山)沃文档回调-查询文档") @GetMapping("/kingSoft/file2") public boolean getKSFile2(HttpServletRequest request,HttpServletResponse response, @RequestParam("key") String key) { //带后缀 @@ -273,15 +293,15 @@ public class WpsController { String fileName = fileIdName; String text = " "; byte buf[] = text.getBytes(); - try { - URL crt = test.class.getClassLoader().getResource("text.doc"); - File file = new File(crt.getPath()); - BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); - buf = IOUtils.toByteArray(bis); - }catch (Exception e){ - log.error("读取异常",e); - CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("模板文件读取异常",true); - } +// try { +//// URL crt = test.class.getClassLoader().getResource("text.doc"); +//// File file = new File(crt.getPath()); +//// BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); +//// buf = IOUtils.toByteArray(bis); +// }catch (Exception e){ +// log.error("读取异常",e); +// CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("模板文件读取异常",true); +// } String fileLength = String.valueOf(buf.length);