|
|
@@ -1,5 +1,6 @@
|
|
|
package cn.reghao.oss.store.rpc;
|
|
|
|
|
|
+import cn.reghao.jutil.jdk.db.PageList;
|
|
|
import cn.reghao.jutil.jdk.security.RandomString;
|
|
|
import cn.reghao.oss.api.constant.ChannelAction;
|
|
|
import cn.reghao.oss.api.constant.ObjectScope;
|
|
|
@@ -193,8 +194,7 @@ public class StoreServiceImpl implements StoreService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<FileInfo> getFiles(String pid, int pageSize, String nextObjectId) {
|
|
|
+ List<FileInfo> getFiles(String pid, int pageSize, String nextObjectId) {
|
|
|
String objectId = pid;
|
|
|
if (!objectId.isBlank()) {
|
|
|
FileMeta fileMeta = objectRepository.getByObjectName(pid);
|
|
|
@@ -207,6 +207,22 @@ public class StoreServiceImpl implements StoreService {
|
|
|
objectId = "0";
|
|
|
}
|
|
|
|
|
|
+ objectRepository.getObjectsByPage(pid, 1, 10);
|
|
|
return objectRepository.getFiles(objectId, pageSize, nextObjectId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageList<FileInfo> getByPrefix(String objectName, int pn, int ps) {
|
|
|
+ String pid = "0";
|
|
|
+ if (!objectName.isBlank()) {
|
|
|
+ FileMeta fileMeta = objectRepository.getByObjectName(objectName);
|
|
|
+ if (fileMeta != null) {
|
|
|
+ pid = fileMeta.getObjectId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int total = objectRepository.countByPid(pid);
|
|
|
+ List<FileInfo> list = objectRepository.getObjectsByPage(pid, pn, ps);
|
|
|
+ return PageList.pageList(pn, ps, total, list);
|
|
|
+ }
|
|
|
}
|