|
| 1 | +## 以分页方式列出所有文件 |
| 2 | + |
| 3 | +* 路径: ```/v2/files/pageAll``` |
| 4 | +* 方法: ```POST``` |
| 5 | +* 登录: 需要 |
| 6 | + |
| 7 | +#### 需要提交的字段 |
| 8 | + |
| 9 | +| 字段 | 类型 | 默认值 | 必填 | 说明 | 备注 | |
| 10 | +|--------------- |--------- |-------- |------ |-------------------- |------------------------------ | |
| 11 | +| page | long | | 是 | 页码 | 默认为1 | |
| 12 | +| pageSize | long | | 是 | 单页显示的数量 | 默认为20 | |
| 13 | +| orderBy | int | | 否 | 排序 | 默认为 0 | |
| 14 | +| filter | int | | 否 | 过滤文件夹 | 设置为1只显示文件夹 | |
| 15 | +| type | int | | 否 | 只显示某一类文件 | 参见type说明 | |
| 16 | +| share | bool | | 否 | 只显示分享的文件 | true为显示分享文件列表 | |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +* orderBy 解释 |
| 26 | + |
| 27 | +```javascript |
| 28 | +switch order { |
| 29 | + case 1: //time desc |
| 30 | + return {"directory desc","name asc","ctime asc"} |
| 31 | + case 2: //time desc |
| 32 | + return {"directory desc","name desc","ctime asc"} |
| 33 | + case 3: |
| 34 | + return {"directory desc","name desc","ctime desc"} |
| 35 | + case 4: //time desc |
| 36 | + return {"directory desc","name asc","ctime asc"} |
| 37 | + case 5: //time desc |
| 38 | + return {"directory asc","name desc","ctime asc"} |
| 39 | + case 6: |
| 40 | + return {"directory asc","name desc","ctime desc"} |
| 41 | + case 7: |
| 42 | + return {"directory asc","name asc","ctime desc"} |
| 43 | + default: |
| 44 | + return {"directory desc","name asc","ctime desc"} |
| 45 | + } |
| 46 | +``` |
| 47 | + |
| 48 | +#### 示范 |
| 49 | + |
| 50 | +1. 以 ```path``` 的方式获取文件夹信息 |
| 51 | + |
| 52 | +* 发送 |
| 53 | + |
| 54 | +```POST``` ```/v2/files/pageAll``` |
| 55 | + |
| 56 | +```json |
| 57 | +{ |
| 58 | + "path":"/film-download2", |
| 59 | + "page": 1, |
| 60 | + "pageSize": 10 |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +* 接收: |
| 65 | + |
| 66 | +```json |
| 67 | +{ |
| 68 | + "status": 0, |
| 69 | + "result": { |
| 70 | + "list": [ |
| 71 | + { |
| 72 | + "identity": "ee171501456aa827dc8c942521e457c3", |
| 73 | + "hash": "lrkL2FvEG0ZOF_YKxVNqeRkmHjgx", |
| 74 | + "userIdentity": 5, |
| 75 | + "path": "/film-download2/qie_client_1_0v5_5_3.apk", |
| 76 | + "name": "qie_client_1_0v5_5_3.apk", |
| 77 | + "ext": ".apk", |
| 78 | + "size": 45955786, |
| 79 | + "parent": "42641190cde128a477ba376da72c3d2d", |
| 80 | + "type": 0, |
| 81 | + "directory": false, |
| 82 | + "atime": 1548721988, |
| 83 | + "ctime": 1548721988, |
| 84 | + "mtime": 1548721988, |
| 85 | + "version": 0, |
| 86 | + "locking": false, |
| 87 | + "op": 4, |
| 88 | + "ignoreCase": false, |
| 89 | + "mime": "application/zip", |
| 90 | + "preview": false, |
| 91 | + "previewType": 0 |
| 92 | + }, |
| 93 | + { |
| 94 | + "identity": "375e8d5e695e012f0d391cb1bda5e7ad", |
| 95 | + "hash": "", |
| 96 | + "userIdentity": 5, |
| 97 | + "path": "/film-download2/让子弹飞.Let.The.Bullets.Fly.2010.BD1080P.X264.DTS-HD.MA 5.1.Mandarin&Sichuan.CHS-ENG.Mp4BaFans", |
| 98 | + "name": "让子弹飞.Let.The.Bullets.Fly.2010.BD1080P.X264.DTS-HD.MA 5.1.Mandarin&Sichuan.CHS-ENG.Mp4BaFans", |
| 99 | + "ext": "", |
| 100 | + "size": 0, |
| 101 | + "parent": "42641190cde128a477ba376da72c3d2d", |
| 102 | + "type": 1, |
| 103 | + "directory": true, |
| 104 | + "atime": 1548721803, |
| 105 | + "ctime": 1548721803, |
| 106 | + "mtime": 1548721803, |
| 107 | + "version": 0, |
| 108 | + "locking": false, |
| 109 | + "op": 4, |
| 110 | + "ignoreCase": false, |
| 111 | + "preview": false, |
| 112 | + "previewType": 0, |
| 113 | + "mime": "text/directory" |
| 114 | + } |
| 115 | + ], |
| 116 | + "parent": { |
| 117 | + "identity": "42641190cde128a477ba376da72c3d2d", |
| 118 | + "hash": "", |
| 119 | + "userIdentity": 5, |
| 120 | + "path": "/film-download2", |
| 121 | + "name": "film-download2", |
| 122 | + "ext": "", |
| 123 | + "size": 0, |
| 124 | + "parent": "6666cd76f96956469e7be39d750cc7d9", |
| 125 | + "type": 1, |
| 126 | + "directory": true, |
| 127 | + "atime": 1548721803, |
| 128 | + "ctime": 1548721803, |
| 129 | + "mtime": 1548721803, |
| 130 | + "version": 0, |
| 131 | + "locking": false, |
| 132 | + "op": 4, |
| 133 | + "ignoreCase": false, |
| 134 | + "preview": false, |
| 135 | + "previewType": 0, |
| 136 | + "mime": "text/directory" |
| 137 | + }, |
| 138 | + "totalCount": 2, |
| 139 | + "totalPage": 1, |
| 140 | + "page": 1, |
| 141 | + "pageSize": 10 |
| 142 | + }, |
| 143 | + "code": "OK", |
| 144 | + "success": true |
| 145 | +} |
| 146 | +``` |
| 147 | + |
| 148 | +1. 以 ```identity``` 的方式获取文件夹信息 |
| 149 | + |
| 150 | + |
| 151 | +* 发送 |
| 152 | + |
| 153 | +```POST``` ```/v2/files/page``` |
| 154 | + |
| 155 | +```json |
| 156 | +{ |
| 157 | + "identity":"42641190cde128a477ba376da72c3d2d", |
| 158 | + "page": 1, |
| 159 | + "pageSize": 10 |
| 160 | +} |
| 161 | +``` |
| 162 | + |
| 163 | +* 接收: |
| 164 | + |
| 165 | +```json |
| 166 | +{ |
| 167 | + "status": 0, |
| 168 | + "result": { |
| 169 | + "list": [ |
| 170 | + { |
| 171 | + "children": [], |
| 172 | + "identity": "ee171501456aa827dc8c942521e457c3", |
| 173 | + "hash": "lrkL2FvEG0ZOF_YKxVNqeRkmHjgx", |
| 174 | + "userIdentity": 5, |
| 175 | + "path": "/film-download2/qie_client_1_0v5_5_3.apk", |
| 176 | + "name": "qie_client_1_0v5_5_3.apk", |
| 177 | + "ext": ".apk", |
| 178 | + "size": 45955786, |
| 179 | + "parent": "42641190cde128a477ba376da72c3d2d", |
| 180 | + "type": 0, |
| 181 | + "directory": false, |
| 182 | + "atime": 1548721988, |
| 183 | + "ctime": 1548721988, |
| 184 | + "mtime": 1548721988, |
| 185 | + "version": 0, |
| 186 | + "locking": false, |
| 187 | + "op": 4, |
| 188 | + "ignoreCase": false, |
| 189 | + "mime": "application/zip", |
| 190 | + "preview": false, |
| 191 | + "previewType": 0 |
| 192 | + }, |
| 193 | + { |
| 194 | + "children": [], |
| 195 | + "identity": "375e8d5e695e012f0d391cb1bda5e7ad", |
| 196 | + "hash": "", |
| 197 | + "userIdentity": 5, |
| 198 | + "path": "/film-download2/让子弹飞.Let.The.Bullets.Fly.2010.BD1080P.X264.DTS-HD.MA 5.1.Mandarin&Sichuan.CHS-ENG.Mp4BaFans", |
| 199 | + "name": "让子弹飞.Let.The.Bullets.Fly.2010.BD1080P.X264.DTS-HD.MA 5.1.Mandarin&Sichuan.CHS-ENG.Mp4BaFans", |
| 200 | + "ext": "", |
| 201 | + "size": 0, |
| 202 | + "parent": "42641190cde128a477ba376da72c3d2d", |
| 203 | + "type": 1, |
| 204 | + "directory": true, |
| 205 | + "atime": 1548721803, |
| 206 | + "ctime": 1548721803, |
| 207 | + "mtime": 1548721803, |
| 208 | + "version": 0, |
| 209 | + "locking": false, |
| 210 | + "op": 4, |
| 211 | + "ignoreCase": false, |
| 212 | + "preview": false, |
| 213 | + "previewType": 0, |
| 214 | + "mime": "text/directory" |
| 215 | + } |
| 216 | + ], |
| 217 | + "parent": { |
| 218 | + "children": [], |
| 219 | + "identity": "42641190cde128a477ba376da72c3d2d", |
| 220 | + "hash": "", |
| 221 | + "userIdentity": 5, |
| 222 | + "path": "/film-download2", |
| 223 | + "name": "film-download2", |
| 224 | + "ext": "", |
| 225 | + "size": 0, |
| 226 | + "parent": "6666cd76f96956469e7be39d750cc7d9", |
| 227 | + "type": 1, |
| 228 | + "directory": true, |
| 229 | + "atime": 1548721803, |
| 230 | + "ctime": 1548721803, |
| 231 | + "mtime": 1548721803, |
| 232 | + "version": 0, |
| 233 | + "locking": false, |
| 234 | + "op": 4, |
| 235 | + "ignoreCase": false, |
| 236 | + "preview": false, |
| 237 | + "previewType": 0, |
| 238 | + "mime": "text/directory" |
| 239 | + }, |
| 240 | + "totalCount": 2, |
| 241 | + "totalPage": 1, |
| 242 | + "page": 1, |
| 243 | + "pageSize": 10 |
| 244 | + }, |
| 245 | + "code": "OK", |
| 246 | + "success": true |
| 247 | +} |
| 248 | +``` |
0 commit comments