Commit eb03882f authored by 井庆林's avatar 井庆林

code review

parent fef3d62e
...@@ -409,9 +409,8 @@ static NewPhobos *_sharedClient; ...@@ -409,9 +409,8 @@ static NewPhobos *_sharedClient;
NSDictionary *dataDict = [_sharedClient prepareDictionaryForEvent:eventName attributes:attributes]; NSDictionary *dataDict = [_sharedClient prepareDictionaryForEvent:eventName attributes:attributes];
@try { @try {
NSData *JSON = [PhobosUtil encodeJSON:dataDict]; NSData *JSON = [PhobosUtil encodeJSON:dataDict];
[PhobosDataManager insertData:dataDict sendAPI:currentAPI completion:^(BOOL contextDidSave, NSError * _Nullable error) { [PhobosDataManager insertData:dataDict sendAPI:currentAPI];
[self disposeSendDataWithImmediately:sendNow]; [self disposeSendDataWithImmediately:sendNow];
}];
} @catch (NSException *exception) { } @catch (NSException *exception) {
NSAssert(NO, @"哎呀呀,VALUE不能为NSObject "); NSAssert(NO, @"哎呀呀,VALUE不能为NSObject ");
} }
...@@ -426,9 +425,8 @@ static NewPhobos *_sharedClient; ...@@ -426,9 +425,8 @@ static NewPhobos *_sharedClient;
[PhobosDataManager updateDataEntities:entities sendStatus:PhobosDataSendStatusSending]; [PhobosDataManager updateDataEntities:entities sendStatus:PhobosDataSendStatusSending];
[PhobosSendManager sendDataWithEntities:entities completion:^(NSArray<PhobosSendDataEntity *> * _Nonnull finishEntities, NSInteger code) { [PhobosSendManager sendDataWithEntities:entities completion:^(NSArray<PhobosSendDataEntity *> * _Nonnull finishEntities, NSInteger code) {
if (code == 200) { if (code == 200) {
[PhobosDataManager updateDataEntities:finishEntities sendStatus:PhobosDataSendStatusFinish completion:^(BOOL contextDidSave, NSError * _Nullable error) { [PhobosDataManager updateDataEntities:finishEntities sendStatus:PhobosDataSendStatusFinish];
[PhobosDataManager deleteDataEntities:finishEntities]; [PhobosDataManager deleteDataEntities:finishEntities];
}];
} else { } else {
[PhobosDataManager updateDataEntities:finishEntities sendStatus:PhobosDataSendStatusError]; [PhobosDataManager updateDataEntities:finishEntities sendStatus:PhobosDataSendStatusError];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment