getFileListAll method

Future<FileAllList> getFileListAll({
  1. required String dir,
  2. int? start,
  3. int? end,
  4. BaiduOrder order = BaiduOrder.name,
  5. bool desc = false,
  6. int limit = 1000,
  7. bool recursion = false,
  8. bool web = true,
  9. Map<String, String> otherParams = const {},
})

递归获取文件列表

/// 其他请求参数查看官方文档: https://pan.baidu.com/union/doc/Zksg0sb73 ,并放入otherParams

Implementation

Future<FileAllList> getFileListAll({
  required String dir,
  int? start,
  int? end,
  BaiduOrder order = BaiduOrder.name,
  bool desc = false,
  int limit = 1000,
  bool recursion = false,
  bool web = true,
  Map<String, String> otherParams = const {},
}) async {
  final params = <String, String>{
    'path': dir,
    'limit': limit.toString(),
    ...otherParams,
  };

  if (recursion) {
    params['recursion'] = '1';
  }

  _addCommonParams(
    params: params,
    order: order,
    desc: desc,
    start: start,
    end: end,
    limit: limit,
    web: web,
  );

  final map = await _get('rest/2.0/xpan/multimedia', params: {
    'method': 'listall',
    ...params,
  });

  return FileAllList.fromJson(map);
}