Initial commit

This commit is contained in:
lianxiang
2018-08-22 11:15:52 +08:00
parent d98e20881f
commit 249bf6864e
491 changed files with 68665 additions and 7 deletions
+49
View File
@@ -0,0 +1,49 @@
//
// GiGaAPIResult.m
// GIGA
//
// Created by lianxiang on 2018/8/15.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import "GiGaAPIResult.h"
@implementation GiGaAPIResult
-(BOOL)success{
return self.status == 0;
}
-(id)initWithDictionary:(NSDictionary *)dic
{
if (self = [super init]) {
@try {
if (dic && ![dic isKindOfClass:[NSNull class]]) {
self.status = [[dic objectForKey:@"errorcode"] intValue];//待定
self.message = [dic objectForKey:@""];//待定
NSDictionary *data = [[dic objectForKey:@"result"] objectForKey:@"data"];
self.dic = data;
}else{
self.message = @"网络错误";
self.dic = nil;
self.status = 1;
}
}
@catch(NSException *exception) {
self.dic = dic;
self.status = 0;
}
@finally {
}
}
return self;
}
@end