Commit 0323d362 authored by 井庆林's avatar 井庆林

修改Entity

parent e938dd72
PODS: PODS:
- GMCache (1.0.1): - GMCache (1.0.1):
- TMCache (= 2.1.0) - TMCache (= 2.1.0)
- GMPhobos (1.3.5): - GMPhobos (1.4.0):
- GMCache - GMCache
- MagicalRecord - MagicalRecord
- MJExtension - MJExtension
...@@ -28,11 +28,11 @@ EXTERNAL SOURCES: ...@@ -28,11 +28,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
GMCache: b78d8e46db864405e91d226ce640cc80d966c611 GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMPhobos: 81a3a1171bab1499b1147eca51a5359dcfb660d0 GMPhobos: 3934127a7ec536932be9a5e64562093d68f98edb
MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755 MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545 MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: ea0fac2144ac80baf8f21576cde49526c19991ad PODFILE CHECKSUM: 4db0de045b595396507d6bad04e4823b02c3061d
COCOAPODS: 1.8.4 COCOAPODS: 1.8.4
...@@ -426,7 +426,7 @@ static NSString *sdkVersion = @"1.4.0"; ...@@ -426,7 +426,7 @@ static NSString *sdkVersion = @"1.4.0";
/** 获取所有非立即发送埋点数量 */ /** 获取所有非立即发送埋点数量 */
+ (NSInteger)normalPhobosCount { + (NSInteger)normalPhobosCount {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"sendStatus = %d", PhobosDataSendStatusNormal]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"status = %d", PhobosDataSendStatusNormal];
return [PhobosDataManager fetchCountOfEntitiesWithPredicate:predicate]; return [PhobosDataManager fetchCountOfEntitiesWithPredicate:predicate];
} }
...@@ -437,7 +437,7 @@ static NSString *sdkVersion = @"1.4.0"; ...@@ -437,7 +437,7 @@ static NSString *sdkVersion = @"1.4.0";
/** 获取所有立即发送埋点数量 */ /** 获取所有立即发送埋点数量 */
+ (NSUInteger)immediatelyPhobosCount { + (NSUInteger)immediatelyPhobosCount {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"sendStatus = %d or sendStatus = %d", PhobosDataSendStatusToBeSend, PhobosDataSendStatusError]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"status = %d or status = %d", PhobosDataSendStatusToBeSend, PhobosDataSendStatusError];
return [PhobosDataManager fetchCountOfEntitiesWithPredicate:predicate]; return [PhobosDataManager fetchCountOfEntitiesWithPredicate:predicate];
} }
......
...@@ -21,7 +21,7 @@ static NSManagedObjectContext *Phobos_defaultContext; ...@@ -21,7 +21,7 @@ static NSManagedObjectContext *Phobos_defaultContext;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSURL *modelURL = [bundle URLForResource:@"PhobosDatas" withExtension:@"momd"];//NewCodeDataModel.xcdatamodeld NSURL *modelURL = [bundle URLForResource:@"GMCoreData" withExtension:@"momd"];//NewCodeDataModel.xcdatamodeld
NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
[NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; [NSManagedObjectModel MR_setDefaultManagedObjectModel:model];
[MagicalRecord setupAutoMigratingCoreDataStack]; [MagicalRecord setupAutoMigratingCoreDataStack];
...@@ -31,9 +31,9 @@ static NSManagedObjectContext *Phobos_defaultContext; ...@@ -31,9 +31,9 @@ static NSManagedObjectContext *Phobos_defaultContext;
+ (NSArray<SendDataEntity *> *)fetchDataEntitiesWithImmediately:(BOOL)immediately { + (NSArray<SendDataEntity *> *)fetchDataEntitiesWithImmediately:(BOOL)immediately {
NSPredicate *predicate; NSPredicate *predicate;
if (immediately) { if (immediately) {
predicate = [NSPredicate predicateWithFormat:@"sendStatus = %d or sendStatus = %d", PhobosDataSendStatusToBeSend, PhobosDataSendStatusError]; predicate = [NSPredicate predicateWithFormat:@"status = %d or status = %d", PhobosDataSendStatusToBeSend, PhobosDataSendStatusError];
} else { } else {
predicate = [NSPredicate predicateWithFormat:@"sendStatus = %d", PhobosDataSendStatusNormal]; predicate = [NSPredicate predicateWithFormat:@"status = %d", PhobosDataSendStatusNormal];
} }
return [self fetchDataEntitiesWithPredicate:predicate]; return [self fetchDataEntitiesWithPredicate:predicate];
} }
......
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