getSelectionList
获取选品单列表
分页获取选品单及其多语言名称。拿到 selectionId 后,可通过 getGameList 的重载 查询该选品单中的游戏。
调用前须完成 SUDOP.initSDK 初始化,无需用户登录。
方法声明
java
public static void getSelectionList(SUDOPSelectionListParams params,
SUDOPSelectionListCallback callback);参数说明
| 参数 | 类型 | 描述 |
|---|---|---|
| params | SUDOPSelectionListParams | 可选。传入 null 时使用第 0 页、每页 10 条及服务端默认语言。 |
| callback | SUDOPSelectionListCallback | 结果回调;传入 null 时不发起请求。 |
SUDOPSelectionListParams
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| pageNo | int | 0 | 页码,从 0 开始,小于 0 时按 0 处理。 |
| pageSize | int | 10 | 每页条数,小于或等于 0 时按 10 处理。 |
| language | String | null | 可选的 BCP 47 语言标签,如 zh-CN;null 或空字符串使用服务端默认值。 |
结果回调
java
public interface SUDOPSelectionListCallback {
void onSuccess(SUDOPSelectionListResult result);
void onFailure(int retCode, String retMsg);
}成功时返回分页结果;失败时返回错误码 retCode 和错误描述 retMsg。
SUDOPSelectionListResult
| 字段 | 类型 | 描述 |
|---|---|---|
| pageNo | int | 当前页码,从 0 开始。 |
| pageSize | int | 每页条数。 |
| total | int | 选品单总数。 |
| records | List<SUDOPSelectionListItem> | 当前页的选品单列表。 |
SUDOPSelectionListItem
| 字段 | 类型 | 描述 |
|---|---|---|
| selectionId | String | 选品单 ID。 |
| name | Map<String, String> | 选品单多语言名称,key 为语言标签,default 为默认名称。 |
代码示例
java
SUDOPSelectionListParams params = new SUDOPSelectionListParams();
params.language = "zh-CN";
SUDOP.getSelectionList(params, new SUDOPSelectionListCallback() {
@Override
public void onSuccess(SUDOPSelectionListResult result) {
for (SUDOPSelectionListItem item : result.records) {
Log.i("SUDOP", "选品单 ID: " + item.selectionId + ", 名称: " + item.name);
}
}
@Override
public void onFailure(int retCode, String retMsg) {
Log.e("SUDOP", "获取选品单失败: " + retCode + ", " + retMsg);
}
});