目录数据库设计
ftp上传文件时,想上传到book_id = 1 and directory_id = 9 的目录下面,
目录结构应该为
1/9/
天官赐福/第四卷/
//得到绝对地址
public ServerResponse<String> getAbsoluteAddress(Integer bookId,Integer directoryId){
List<BookDirectory> bookDirectoryList = Lists.newArrayList();
BookDirectory bookDirectory = bookDirectoryMapper.getDirByBookIdAndDirectoryId(bookId,directoryId);
if(bookDirectory == null){
return ServerResponse.createByErrorMessage("参数错误");
}
bookDirectoryList = getParentById(bookDirectoryList,bookId,bookDirectory.getDirectoryId());
String absoluteAddressStr = "";
for(int i = bookDirectoryList.size()-1;i >= 0;i--){
Boo