宠物店修改
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "EGOCache.h"
|
||||
@interface DataCenter : NSObject
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
-(void)setValue:(id)value forKey:(NSString*)key;
|
||||
// 获取数据
|
||||
-(id)valueForKey:(NSString*)key;
|
||||
@property (nonatomic, strong) EGOCache *cache;
|
||||
-(void)cacheinit:(NSString*)useid;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -44,9 +44,16 @@
|
||||
_dict=[[NSMutableDictionary alloc]init];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)cacheinit:(NSString*)useid
|
||||
{
|
||||
NSArray*arr=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
self.cache = [[EGOCache alloc] initWithCacheDirectory:[arr.firstObject stringByAppendingPathComponent:[NSString stringWithFormat:@"ifish/%@",[CommonUtils getNotNilStr:useid]]]];
|
||||
[self.cache setDefaultTimeoutInterval:864000000];
|
||||
}
|
||||
//根据文件名 获取指定文件名的在沙盒Documents的 全路径
|
||||
-(NSString*)getFullFilePathWithName:(NSString *)name{
|
||||
//方法1
|
||||
|
||||
@@ -57,5 +57,6 @@
|
||||
//新绚多
|
||||
+(void)saveNewXuToControlName:(XuToControlName *)nameModel;
|
||||
+(XuToControlName *)currentNewXuToControlName:(NSString *)macaddress;
|
||||
+(XuToControlName *)currentPetsXuToControlName:(NSString *)macaddress;
|
||||
|
||||
@end
|
||||
|
||||
@@ -241,6 +241,26 @@
|
||||
return controlName;
|
||||
|
||||
}
|
||||
+(XuToControlName *)currentPetsXuToControlName:(NSString *)macaddress
|
||||
{
|
||||
NSString *key = [NSString stringWithFormat:@"newXuTo%@",macaddress];
|
||||
NSString *file = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:key];
|
||||
XuToControlName *controlName = [NSKeyedUnarchiver unarchiveObjectWithFile:file];
|
||||
if (!controlName||[controlName isKindOfClass:[NSNull class]]) {
|
||||
controlName = [[XuToControlName alloc] init];
|
||||
controlName.shajunLight = @"杀菌灯";
|
||||
controlName.zengyangPump = @"换气";
|
||||
controlName.light1 = @"杀菌";
|
||||
controlName.light2 = @"恒温";
|
||||
controlName.zaolangPump = @"造浪泵";
|
||||
controlName.huLiDeng = @"护理灯";
|
||||
controlName.xunhuanPump = @"照明";
|
||||
controlName.jiaRe = @"加热棒";
|
||||
controlName.macAddress = macaddress;
|
||||
}
|
||||
return controlName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user