use of com.qiwenshare.file.vo.file.FileListVo in project qiwen-file by qiwenshare.
the class CommonFileController method commonFileList.
@Operation(summary = "获取共享用户文件列表", description = "用来做前台列表展示", tags = { "file" })
@RequestMapping(value = "/commonFileList", method = RequestMethod.GET)
@ResponseBody
public RestResult<FileListVo> commonFileList(@Parameter(description = "用户id", required = true) Long commonFileId, @Parameter(description = "文件路径", required = true) String filePath, @Parameter(description = "当前页", required = true) long currentPage, @Parameter(description = "页面数量", required = true) long pageCount) {
CommonFile commonFile = commonFileService.getById(commonFileId);
UserFile userFile = userFileService.getById(commonFile.getUserFileId());
filePath = userFile.getFilePath() + filePath;
IPage<FileListVo> fileList = userFileService.userFileList(userFile.getUserId(), filePath, currentPage, pageCount);
return RestResult.success().data(fileList);
}
use of com.qiwenshare.file.vo.file.FileListVo in project qiwen-file by qiwenshare.
the class UserFileService method userFileList.
@Override
public IPage<FileListVo> userFileList(Long userId, String filePath, Long currentPage, Long pageCount) {
Page<FileListVo> page = new Page<>(currentPage, pageCount);
UserFile userFile = new UserFile();
JwtUser sessionUserBean = SessionUtil.getSession();
if (userId == null) {
userFile.setUserId(sessionUserBean.getUserId());
} else {
userFile.setUserId(userId);
}
userFile.setFilePath(UFOPUtils.urlDecode(filePath));
return userFileMapper.selectPageVo(page, userFile, null);
}
use of com.qiwenshare.file.vo.file.FileListVo in project qiwen-file by qiwenshare.
the class FileController method selectFileByFileType.
@Operation(summary = "通过文件类型选择文件", description = "该接口可以实现文件格式分类查看", tags = { "file" })
@RequestMapping(value = "/selectfilebyfiletype", method = RequestMethod.GET)
@ResponseBody
public RestResult<List<Map<String, Object>>> selectFileByFileType(@Parameter(description = "文件类型", required = true) int fileType, @Parameter(description = "当前页", required = true) @RequestParam(defaultValue = "1") long currentPage, @Parameter(description = "页面数量", required = true) @RequestParam(defaultValue = "10") long pageCount) {
JwtUser sessionUserBean = SessionUtil.getSession();
long userId = sessionUserBean.getUserId();
IPage<FileListVo> result = userFileService.getFileByFileType(fileType, currentPage, pageCount, userId);
Map<String, Object> map = new HashMap<>();
map.put("list", result.getRecords());
map.put("total", result.getTotal());
return RestResult.success().data(map);
}
use of com.qiwenshare.file.vo.file.FileListVo in project qiwen-file by qiwenshare.
the class UserFileService method getFileByFileType.
@Override
public IPage<FileListVo> getFileByFileType(Integer fileTypeId, Long currentPage, Long pageCount, long userId) {
Page<FileListVo> page = new Page<>(currentPage, pageCount);
UserFile userFile = new UserFile();
userFile.setUserId(userId);
return userFileMapper.selectPageVo(page, userFile, fileTypeId);
}
Aggregations