//
//  GMALBaseRequest.m
//  Gengmei
//
//  Created by MoMo on 2019/9/16.
//  Copyright © 2019 更美互动信息科技有限公司. All rights reserved.
//

#import "GMALBaseRequest.h"

@implementation GMALBaseRequest

- (void)setCompletBlock:(GMCompleteBlock _Nonnull)completBlock {
    _completBlock = completBlock;
    [self stop];
}

- (void)stop {
    
    NSURLSessionTaskState state = self.dataTask.state;
    
    if (state == NSURLSessionTaskStateRunning || state == NSURLSessionTaskStateSuspended) {
        [self.dataTask cancel];
    }
}

@end

@implementation GMRequestObject

- (instancetype)init {
    if (self = [super init]) {
        self.count = kInPageCount;
    }
    return self;
}
@end
