Skip to content

getSelectionListWithOptions:completion: ​

获取选品单列表 ​

分页获取选品单及其多语言名称。拿到 selectionId 后,可通过 getGameListWithSelectionId:options:completion: 查询该选品单中的游戏。

调用前须完成 initializeWithConfiguration:completion: 初始化,无需用户登录。

方法声明 ​

objectivec
+ (void)getSelectionListWithOptions:(nullable SUDOPSelectionListOptions *)options
                        completion:(nullable void(^)(SUDOPSelectionListResult *_Nullable result,
                                                      NSError *_Nullable error))completion;

参数说明 ​

参数类型必传描述
optionsSUDOPSelectionListOptions *否分页及语言参数。传入 nil 时使用第 0 页、每页 10 条及服务端默认语言。
completionBlock否成功返回 result,失败返回 error。

SUDOPSelectionListOptions ​

字段类型默认值描述
pageNoNSInteger0页码,从 0 开始,小于 0 时按 0 处理。
pageSizeNSInteger10每页条数,小于或等于 0 时按 10 处理。
languageNSString *nil可选的 BCP 47 语言标签,如 zh-CN;nil 或空字符串使用服务端默认值。

返回模型 SUDOPSelectionListResult ​

字段类型描述
pageNoNSInteger当前页码,从 0 开始。
pageSizeNSInteger每页条数。
totalNSInteger选品单总数。
recordsNSArray<SUDOPSelectionListItem *> *当前页的选品单列表。

SUDOPSelectionListItem ​

字段类型描述
selectionIdNSString *选品单 ID。
nameNSDictionary<NSString *, NSString *> *选品单多语言名称,key 为语言标签,default 为默认名称。

代码示例 ​

objectivec
SUDOPSelectionListOptions *options = [[SUDOPSelectionListOptions alloc] init];
options.language = @"zh-CN";

[SUDOP getSelectionListWithOptions:options
                        completion:^(SUDOPSelectionListResult * _Nullable result,
                                     NSError * _Nullable error) {
    if (error) {
        NSLog(@"获取选品单失败: %@", error.localizedDescription);
        return;
    }
    for (SUDOPSelectionListItem *item in result.records) {
        NSLog(@"选品单 ID: %@,名称: %@", item.selectionId, item.name);
    }
}];