use of com.moon.admin.vo.LayuiFile in project moon by gentoo111.
the class FileController method uploadLayuiFile.
/**
* layui富文本文件自定义上传
*
* @param file
* @param domain
* @return
* @throws IOException
*/
@LogAnnotation
@PostMapping("/layui")
@ApiOperation(value = "layui富文本文件自定义上传")
public LayuiFile uploadLayuiFile(MultipartFile file, String domain) throws IOException {
FileInfo fileInfo = fileService.save(file);
LayuiFile layuiFile = new LayuiFile();
layuiFile.setCode(0);
LayuiFile.LayuiFileData data = new LayuiFile.LayuiFileData();
layuiFile.setData(data);
data.setSrc(domain + "/files" + fileInfo.getUrl());
data.setTitle(file.getOriginalFilename());
return layuiFile;
}
Aggregations