@xuda.io/drive_module 1.1.881 → 1.1.883
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +36 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -83,21 +83,29 @@ const get_studio_path = function (raw_path, ref, file_name) {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
exports.get_drive_files = async function (req) {
|
|
86
|
-
const {
|
|
86
|
+
const {
|
|
87
|
+
from = 0,
|
|
88
|
+
to = 100,
|
|
89
|
+
drive_type,
|
|
90
|
+
app_id,
|
|
91
|
+
uid,
|
|
92
|
+
type,
|
|
93
|
+
date,
|
|
94
|
+
sort_by = "name",
|
|
95
|
+
sort_dir = "desc",
|
|
96
|
+
} = req;
|
|
87
97
|
try {
|
|
88
98
|
let opt = {
|
|
89
99
|
selector: {
|
|
90
|
-
docType: "workspace_drive",
|
|
91
100
|
stat: 3,
|
|
92
101
|
type,
|
|
93
|
-
file_path: req.path,
|
|
94
102
|
},
|
|
95
103
|
limit: to - from,
|
|
96
104
|
skip: from,
|
|
97
105
|
};
|
|
98
106
|
|
|
99
|
-
if (
|
|
100
|
-
opt.selector.
|
|
107
|
+
if (req.path) {
|
|
108
|
+
opt.selector.file_path = req.path;
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
validate_drive_type(drive_type);
|
|
@@ -113,16 +121,16 @@ exports.get_drive_files = async function (req) {
|
|
|
113
121
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
114
122
|
opt.selector = "workspace_drive";
|
|
115
123
|
|
|
116
|
-
var opt = {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
124
|
+
// var opt = {
|
|
125
|
+
// selector: {
|
|
126
|
+
// docType: "workspace_drive",
|
|
127
|
+
// stat: 3,
|
|
128
|
+
// type,
|
|
129
|
+
// file_path: req.path,
|
|
130
|
+
// },
|
|
131
|
+
// limit: to - from,
|
|
132
|
+
// skip: from,
|
|
133
|
+
// };
|
|
126
134
|
|
|
127
135
|
if (date) {
|
|
128
136
|
opt.sort = [{ date_created: "desc" }];
|
|
@@ -193,17 +201,19 @@ exports.get_drive_files = async function (req) {
|
|
|
193
201
|
return { code: 1, data: files };
|
|
194
202
|
};
|
|
195
203
|
const get_user_files = async function () {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
opt.selector = "user_drive";
|
|
205
|
+
opt.uid = uid;
|
|
206
|
+
// var opt = {
|
|
207
|
+
// selector: {
|
|
208
|
+
// docType: "user_drive",
|
|
209
|
+
// stat: 3,
|
|
210
|
+
// uid,
|
|
211
|
+
// type,
|
|
212
|
+
// file_path: req.path,
|
|
213
|
+
// },
|
|
214
|
+
// limit: to - from,
|
|
215
|
+
// skip: from,
|
|
216
|
+
// };
|
|
207
217
|
|
|
208
218
|
if (date) {
|
|
209
219
|
opt.sort = [{ date_created: "desc" }];
|