Search in sources :

Example 1 with LayuiFile

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;
}
Also used : LayuiFile(com.moon.admin.vo.LayuiFile) FileInfo(com.moon.admin.domain.FileInfo) LogAnnotation(com.moon.admin.common.utils.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

LogAnnotation (com.moon.admin.common.utils.LogAnnotation)1 FileInfo (com.moon.admin.domain.FileInfo)1 LayuiFile (com.moon.admin.vo.LayuiFile)1 ApiOperation (io.swagger.annotations.ApiOperation)1