文件列表分页
This commit is contained in:
parent
7978a8892d
commit
be257c6ac0
@ -11,7 +11,7 @@ import java.util.Map;
|
||||
public interface IUserFileService extends IService<UserFile> {
|
||||
List<UserFile> selectUserFileByNameAndPath(String fileName, String filePath, Long userId);
|
||||
void replaceUserFilePath(String filePath, String oldFilePath, Long userId);
|
||||
List<Map<String, Object>> userFileList(UserFile userFile);
|
||||
List<Map<String, Object>> userFileList(UserFile userFile, Long beginCount, Long pageCount);
|
||||
void updateFilepathByFilepath(String oldfilePath, String newfilePath, String fileName, String extendName);
|
||||
|
||||
List<Map<String, Object>> selectFileByExtendName(List<String> fileNameList, long userId);
|
||||
|
@ -184,10 +184,16 @@ public class FileController {
|
||||
userFile.setUserId(sessionUserBean.getUserId());
|
||||
}
|
||||
|
||||
|
||||
List<Map<String, Object>> fileList = null;
|
||||
userFile.setFilePath(PathUtil.urlDecode(fileListDto.getFilePath()));
|
||||
if (fileListDto.getCurrentPage() == null || fileListDto.getPageCount() == null) {
|
||||
fileList = userFileService.userFileList(userFile, 0L, 10L);
|
||||
} else {
|
||||
Long beginCount = (fileListDto.getCurrentPage() - 1) * fileListDto.getPageCount();
|
||||
|
||||
List<Map<String, Object>> fileList = userFileService.userFileList(userFile); //fileService.selectFileListByPath(fileBean);
|
||||
fileList = userFileService.userFileList(userFile, beginCount, fileListDto.getPageCount()); //fileService.selectFileListByPath(fileBean);
|
||||
|
||||
}
|
||||
|
||||
restResult.setData(fileList);
|
||||
restResult.setSuccess(true);
|
||||
|
@ -5,4 +5,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class FileListDto {
|
||||
private String filePath;
|
||||
|
||||
private Long currentPage;
|
||||
private Long pageCount;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import java.util.Map;
|
||||
|
||||
public interface UserFileMapper extends BaseMapper<UserFile> {
|
||||
void replaceFilePath(@Param("filePath") String filePath, @Param("oldFilePath") String oldFilePath, @Param("userId") Long userId);
|
||||
List<Map<String, Object>> userFileList(UserFile userFile);
|
||||
List<Map<String, Object>> userFileList(UserFile userFile, Long beginCount, Long pageCount);
|
||||
|
||||
void updateFilepathByPathAndName(String oldfilePath, String newfilePath, String fileName, String extendName);
|
||||
void updateFilepathByFilepath(String oldfilePath, String newfilePath);
|
||||
|
@ -44,8 +44,8 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> userFileList(UserFile userFile) {
|
||||
return userFileMapper.userFileList(userFile);
|
||||
public List<Map<String, Object>> userFileList(UserFile userFile, Long beginCount, Long pageCount) {
|
||||
return userFileMapper.userFileList(userFile, beginCount, pageCount);
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
</if>
|
||||
and deleteFlag = 0
|
||||
</where>
|
||||
limit #{beginCount} #{pageCount}
|
||||
|
||||
</select>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user