//
//  ALHomeHotViewModel.m
//  GMAlpha
//
//  Created by zhb on 2018/11/15.
//  Copyright © 2018 Gengmei. All rights reserved.
//

#import "ALHomeHotViewModel.h"

@implementation ALHomeHotViewModel
- (instancetype)init
{
    self = [super init];
    if (self) {
        _remoteUrl = API_V1_INDEX;
    }
    return self;
}

- (void)buildParams{
    _params = @{
                @"type":@(1),
                @"page":@(self.page),
                @"count":@(10)
                };
}

- (void)buildModelWithRemoteDic:(NSDictionary *)dic{
    if ([dic[@"error"] integerValue] != 0) {
        return;
    }
    NSDictionary *contentData = dic[@"data"];
    NSError *error = nil;
    self.contentObject = [[ALHomeHotObject alloc] initWithDictionary:contentData error:&error];
    [self.dataArray addObjectsFromArray:self.contentObject.cards];
}


@end
