1
This commit is contained in:
@@ -10,16 +10,24 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class KBCharacter;
|
||||
@class KBTag;
|
||||
|
||||
/// 首页排行榜回调
|
||||
typedef void(^KBHomeRankCompletion)(NSArray<KBCharacter *> * _Nullable list,
|
||||
NSError * _Nullable error);
|
||||
|
||||
/// 首页标签回调
|
||||
typedef void(^KBHomeTagCompletion)(NSArray<KBTag *> * _Nullable list,
|
||||
NSError * _Nullable error);
|
||||
|
||||
@interface KBHomeVM : NSObject
|
||||
|
||||
/// 最近一次成功请求到的排行榜数据
|
||||
@property (nonatomic, copy, readonly, nullable) NSArray<KBCharacter *> *rankList;
|
||||
|
||||
/// 最近一次成功请求到的标签数据
|
||||
@property (nonatomic, copy, readonly, nullable) NSArray<KBTag *> *tagList;
|
||||
|
||||
/// 请求排行榜列表(GET /character/list)
|
||||
/// - Parameters:
|
||||
/// - params: 额外查询参数(可为空),例如分页、筛选 tag 等;
|
||||
@@ -29,6 +37,15 @@ typedef void(^KBHomeRankCompletion)(NSArray<KBCharacter *> * _Nullable list,
|
||||
needShow:(BOOL)needShow
|
||||
completion:(KBHomeRankCompletion)completion;
|
||||
|
||||
/// 请求排行榜标签列表(GET /tag/list)
|
||||
/// - Parameters:
|
||||
/// - params: 额外查询参数(可为空);
|
||||
/// - needShow: 是否在请求期间显示加载 HUD;
|
||||
/// - completion: 回调,list 为解析后的标签数组,error 非空表示失败。
|
||||
- (void)fetchTagListWithParams:(nullable NSDictionary *)params
|
||||
needShow:(BOOL)needShow
|
||||
completion:(KBHomeTagCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
Reference in New Issue
Block a user