Skip to content

Commit

Permalink
fix: fix order_by on search API (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
caobug authored Jun 7, 2024
1 parent 8025e54 commit 60e5371
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/AliyunpanSDK/AliyunpanScope/File/SearchFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
}

Expand Down

0 comments on commit 60e5371

Please sign in to comment.