1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // FKCashCouponReform.m
- // FirstLink
- //
- // Created by ascii on 15/9/8.
- // Copyright (c) 2015年 FirstLink. All rights reserved.
- //
- #import "FKCashCouponReform.h"
- @implementation FKCashCouponReform
- + (NSString *)parseTotalCount:(NSDictionary *)json {
- if ([json[@"data"][@"pager"] isKindOfClass:[NSDictionary class]]) {
- return [NSString stringWithFormat:@"%@", json[@"data"][@"pager"][@"total"]];
- }
- return nil;
- }
- + (NSString *)parseServerTime:(NSDictionary *)json {
- if ([json[@"data"] [@"server_time"] isKindOfClass:[NSString class]]) {
- return json[@"data"][@"server_time"];
- }
- return nil;
- }
- + (NSMutableArray *)parseCouponItems:(NSDictionary *)json {
- if ([json[@"data"] isKindOfClass:[NSDictionary class]]) {
- FKCouponItem *item;
-
- NSMutableArray *array = [NSMutableArray array];
- for (NSDictionary *dict in json[@"data"][@"list"]) {
- item = [[FKCouponItem alloc] init];
- [item mts_setValuesForKeysWithDictionary:dict];
-
- [array addObject:item];
- }
- return array;
- }
- return nil;
- }
- @end
|