diff --git a/Sources/AliyunpanSDK/AliyunpanScope/File/SearchFile.swift b/Sources/AliyunpanSDK/AliyunpanScope/File/SearchFile.swift index 9be97b1..1579291 100644 --- a/Sources/AliyunpanSDK/AliyunpanScope/File/SearchFile.swift +++ b/Sources/AliyunpanSDK/AliyunpanScope/File/SearchFile.swift @@ -24,7 +24,7 @@ extension AliyunpanFileScope { /// 查询语句,样例:固定目录搜索,只搜索一级 parent_file_id = '123' 精确查询 name = '123' 模糊匹配 name match '123' 搜索指定后缀文件 file_extension = 'apk' 范围查询 created_at < '2019-01-14T00:00:00' 复合查询: type = 'folder' or name = '123' parent_file_id = 'root' and name = '123' and category = 'video' public let query: String? /// created_at ASC | DESC updated_at ASC | DESC name ASC | DESC size ASC | DESC - public let order_by: OrderBy? + public let order_by: String? /// 生成的视频缩略图截帧时间,单位ms,默认120000ms public let video_thumbnail_time: Int? /// 生成的视频缩略图宽度,默认480px @@ -34,16 +34,20 @@ extension AliyunpanFileScope { /// 是否返回总数 public let return_total_count: Bool? - public init(drive_id: String, limit: Int?, marker: String?, query: String?, order_by: OrderBy?, video_thumbnail_time: Int?, video_thumbnail_width: Int?, image_thumbnail_width: Int?, return_total_count: Bool?) { + public init(drive_id: String, limit: Int?, marker: String?, query: String?, order_by: OrderBy?, order_direction: OrderDirection?, video_thumbnail_time: Int?, video_thumbnail_width: Int?, image_thumbnail_width: Int?, return_total_count: Bool?) { self.drive_id = drive_id self.limit = limit self.marker = marker self.query = query - self.order_by = order_by self.video_thumbnail_time = video_thumbnail_time self.video_thumbnail_width = video_thumbnail_width self.image_thumbnail_width = image_thumbnail_width self.return_total_count = return_total_count + if let order_by = order_by, let order_direction = order_direction { + self.order_by = "\(order_by) \(order_direction)" + } else { + self.order_by = nil + } } }