公告结构化

This commit is contained in:
zhangqinbin
2023-12-21 17:17:04 +08:00
parent 00d1b6c654
commit 5deb7dc484

View File

@ -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);