1、新增控制器
@NotFilter
@ApiOperation("根据课件转化PPT再返回图片数组")
@PostMapping("/reviewPPt/{fileId}")
public Map<String, Object> reviewPPt(@PathVariable("fileId") Integer fileId) {
//根据文件uri 得到文件
//转换的文件图片的保存地址
//返回文件的url和图片文件名
return courseFileService.reviewPPt(fileId);
}
2、通过文件id,查询文件记录,拿到文件url,uri。
@Override
public Map<String, Object> reviewPPt(Integer fileId) {
//根据文件uri 得到文件
//转换的文件图片的保存地址
//返回文件的url和图片文件名
Map<String, Object> resultMap = new HashMap<>();
CourseFile file = courseFileRepository.findById(fileId).orElse(null);
if(file==null){
throw new ContsException(ResultEnum.FILE_ID_NOT);
}
File ppt = new File(file.getUri());
if(!ppt.exists(