KWMUserDao.h 1.49 KB
Newer Older
houweibin committed
1 2 3 4 5 6 7 8 9 10
//
//  KWMUserDao.h
//  iOrangeBusiness
//
//  Created by Yaotian on 10/28/14.
//  Copyright (c) 2014 kwm. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Buy/Buy.h>
houweibin committed
11
#import "KWMCustomsClearance.h"
houweibin committed
12

lee committed
13 14
#import <Mobile-Buy-SDK/Buy/BUYCustomer.h>

houweibin committed
15 16 17 18 19 20 21 22 23
@class KWMUser;
@class KWMRequestResult;


/**
 *  数据管理类: 当前登录用户数据
 */
@interface KWMUserDao : NSObject

lee committed
24 25
@property (nonatomic, strong) NSString *currencyCode;

houweibin committed
26 27
@property (nonatomic, strong) KWMCustomsClearance *customsClearance;

lee committed
28 29
@property (nonatomic, strong) BUYClient *client;

lee committed
30 31 32 33
@property (nonatomic, strong) BUYCustomer *customer;

@property (nonatomic, strong) NSArray *tags;

houweibin committed
34 35 36 37 38 39 40
+ (KWMUserDao *)shareDao;
- (BOOL)checkSession;
- (KWMUser *)loginUser;
- (BOOL)isLogin;
- (void)logout;
- (void)saveUser:(KWMUser *)user;
- (void)saveExchangeRate:(NSNumber *)exchangeRate;
lee committed
41
- (NSDecimalNumber *)exchangeRate;
lee committed
42
- (void) requestTags;
houweibin committed
43

lee committed
44 45
- (void) login;

houweibin committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
- (void (^)(NSURLSessionDataTask *, KWMRequestResult *))getLoginSuccessCallback:(void (^)(NSURLSessionDataTask *, KWMRequestResult *))callback;

- (void)saveImageUrl:(NSString *)imageUrl key:(NSString *)key;

- (NSString *)getImageUrl:(NSString *)key;

-(void)saveCollectionCache:(NSArray *)products collectionId:(NSNumber *)collectionId tags:(NSArray *)tags;

-(NSArray *)getCollectionCache:(NSNumber *)collectionId tags:(NSArray *)tags;

-(NSDictionary *)checkOutCache;

-(void)saveCheckoutCache:(NSDictionary *)checkout;

-(void)deleteCheckoutCache;

-(NSString *)getCheckoutCachePath;

@end