//
//  ALHotViewModel.m
//  GMAlpha
//
//  Created by Q14 on 2018/11/13.
//  Copyright © 2018年 Gengmei. All rights reserved.
//

#import "ALHotViewModel.h"
#import "ALGroupHomeObject.h"
@implementation ALHotViewModel

- (instancetype)init{
    self = [super init];
    if (self) {
        _remoteUrl = API_GROUP_HOME;
        _type = GMGroupHomeTypeHot;        
    }
    return self;
}

- (void)buildParams {
    _params= @{@"page": @(self.page),
               @"count": @(10),
               @"type": @(_type)
               };
}
- (void)buildModelWithRemoteDic:(NSDictionary *)dic {
    NSDictionary *data = dic[@"data"];
    if (data[@"groups"]) {
        [self.dataArray addObjectsFromArray:[ALGroupHomeObject arrayOfModelsFromDictionaries:data[@"groups"] error:nil]];
    }
}
@end
