43 lines
1.4 KiB
Objective-C
43 lines
1.4 KiB
Objective-C
//
|
|
// XPHomeContainerPresenter.m
|
|
// YuMi
|
|
//
|
|
// Created by YuMi on 2021/12/2.
|
|
//
|
|
|
|
#import "XPHomeContainerPresenter.h"
|
|
#import "Api+Home.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "HomeTagModel.h"
|
|
#import "XPHomeContainerProtocol.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "HomeBannerInfoModel.h"
|
|
@implementation XPHomeContainerPresenter
|
|
///得到首页轮播图
|
|
- (void)getHomeTopBannerList{
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api homeBannerList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeBannerInfoModel modelsWithArray:data.data];
|
|
[[self getView]getHomeTopBannerListSuccess:array];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
|
|
} errorToast:NO] uid:uid type:@"1"];
|
|
}
|
|
/// 获取所有的房间的tag
|
|
- (void)getHomeTagList {
|
|
NSString * uid = [[AccountInfoStorage instance] getUid];
|
|
NSArray<HomeTagModel *> *list = [[AccountInfoStorage instance]getCurrentTagList];
|
|
if(list.count > 0){
|
|
[[self getView] getHomeTagListSuccess:list];
|
|
}
|
|
[Api homeTagComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeTagModel modelsWithArray:data.data];
|
|
[[AccountInfoStorage instance]saveTagList:array];
|
|
if(list.count == 0 || list.count != array.count){
|
|
[[self getView] getHomeTagListSuccess:array];
|
|
}
|
|
}] uid:uid];
|
|
}
|
|
|
|
@end
|