You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
10 KiB

//
// User.h
// ;
//
// Created by xTT on 15/6/7.
// Copyright (c) 2015年 xTT. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import "baseModel.h"
//#import "Circle.h"
#define cUser [User currentUser]
@class Circle;
@class Device;
@interface User : baseModel
/**
SDK的Key
*/
@property (nonatomic, strong) NSString *juphoonKey;
@property (nonatomic, strong) NSString *openid;
@property (nonatomic, strong) NSString *accesstoken;
@property (nonatomic, strong) NSMutableArray *myDevices;
@property (nonatomic, strong) NSMutableArray *ownedDevices;
@property (nonatomic, strong) NSMutableArray *chatGroupDevices;
@property (nonatomic, strong) NSMutableArray *chatGroups;
//@property (nonatomic, strong) NSMutableArray *myFamily;//家庭成员
@property (nonatomic, strong) Device *cDevice;
//@property (nonatomic, strong) NSNumber *locate_offset;
@property (nonatomic, strong) NSString *user_email;
@property (nonatomic, strong) NSNumber *share_locate;
/**
(102)
*/
@property (nonatomic ,strong) NSNumber *status;
//@property (nonatomic, strong) NSMutableArray *myDevice;
@property (nonatomic, strong) NSMutableArray *questions;
@property (nonatomic, strong) CLLocation *curLocation;
/**
imei号登录时的imei号 15,14,10 (imei) 11 ()
*/
@property (nonatomic, strong) NSString *loginName;
/**
,
*/
@property (nonatomic, strong) NSString *wx_name;
/**
0 1
*/
@property (nonatomic, strong) NSNumber *wx_status;
/**
10
*/
@property (nonatomic, strong) NSNumber *account_status;
@property (nonatomic, strong) NSString *wxid;
@property (nonatomic, strong) NSString *qqid;
/**
*/
@property (nonatomic, strong) NSString *BRVideoKey;
@property (nonatomic, strong) NSNumber *bairui_id;
+ (User *)currentUser;
+ (void)setCurrentUser:(User *)user;
+ (void)setDeviceToken:(NSString *)deviceToken AndVoIPToken:(NSString *)VoIPToken;
- (void)dataChanges:(void (^)())block;
//MARK: 上传微信授权 原始数据 和登录 新的登录接口
+ (void)upWXDataAndLoginParameters:(id)parameters
success:(void (^)(id))success
failure:(void (^)(id faiObject))failure;
#pragma 登录
+ (void)loginWithParameters:(id)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 主动退出登录
+ (void)logoutWithSuccess:(void (^)(id))success
failure:(void (^)(id faiObject))failure;
#pragma 注销用户
+ (void)unregisterWithSuccess:(void (^)(id))success
failure:(void (^)(id faiObject))failure;
#pragma 其他的登录
+ (void)loginWithParameters:(id)parameters
type:(int)type
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 注册用户
+ (void)newUserWithParameters:(id)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 获取用户信息
- (void)getUserInfoSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
/**
MARK:
*/
- (void)getGZHSwitchSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
/**
MARK:
*/
- (void)setGZHSwitchStatus:(NSNumber*)status
Success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 编辑用户信息
- (void)saveUserInfoSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 上传jjm
- (void)updatajkCodeSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 获取jjm信息
- (void)getjkCodeSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma mark --- 获取环信MI 用户 (与设备对应的 MI 用户)
- (void)getHXAccoutSuccess:(void (^)(id responseObject))success
failure:(void (^)())failure;
#pragma mark --获取首页轮播图
- (void)getSlideshowInfoSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma mark --表盘列表分页查询
- (void)getDialMsgInfo:(id)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma mark --点击首页轮播图上报
- (void)postSlideshowInfoWithID:(NSString *)slideID
Success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 微信用户 添加 手机号
+ (void)wxUserApplyPhone:(NSString*)phone
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 手机账号 绑定微信账号
+ (void)userBindWX:(NSMutableDictionary*)param
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 手机账号 解绑微信账号
+ (void)userUNBindWXSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 添加关联设备
- (void)addDeviceWithDevice:(Device *)device
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 扫码查询设备是否存在管理员,如果存在则得到管理员的 openid 和 phone
/**
, openid phone
@param params params @{@"imei":@"XXXX"}
@param success success description
@param failure failure description
*/
- (void)getDeviceIsHaveAdmin:(NSMutableDictionary *)params
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 发送关注申请的接口 需要管理员的 openid 和 phone
/**
openid phone.
imei : [str]
admin_openid : [str]
*/
- (void)postDeviceInAdmin:(NSMutableDictionary *)params
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
- (void)localDeleteDevice;
#pragma 删除关联设备
- (void)deleteDeviceSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 获取用户关联设备
- (void)getRelatedDeviceSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 获取用户聊天群
- (void)getRelatedChatGroupSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
/// 获取未读消息
- (void)GetNotificationCountWithSuccess:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;
#pragma 获取问题类别和热门问题
+ (void)getCategoryQAndHotQSuccess:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 获取某个问题类别中的所有问题
+ (void)getAllCategoryQWithCID:(NSString*)cid
success:(void (^)(id responseObject))success
failure:(void (^)(id faiObject))failure;
#pragma 保存最后一个激活设备 imei
+ (void)saveDefaultImei:(NSString *)imei;
+ (NSString *)getDefaultImei;
+ (void)saveAgreeImei:(NSString *)imei;
+ (NSString *)agreeImei;
+ (void)removeAgreeImei;
- (Device *)getDeviceWithImei:(NSString *)imei;
- (Circle *)getCircleWithId:(NSString *)Id;
- (Circle *)getCircleWithImei:(NSString *)imei;
+ (void)loadFormFile;
+ (void)saveToFile;
+ (void)deleteFormFile;
//MARK: 获取更新广告配置
/**
广
*/
- (void)getADConfig;
/// gps开关(开启历史轨迹)
- (void)setSwitchDataState:(NSInteger)state
success:(void (^)(id responseObject))success
failure:(void (^)())failure;
/**
imei获取供应商的配置
*/
- (void)getSupplierConfigWithDevice:(Device *)device;
#pragma mark --- 上传 视频通话的通话时长和视频通话的分辨率
- (void)postVideoCallTimeParame:(NSDictionary*) parameters
deviceModel:(Device *)deviceModel
success:(void (^)(id responseObject))success
failure:(void (^)())failure;
/**
MARK:
@param videoID ID
*/
- (void)activeHangUpVideoID:(NSString*)videoID
WithDevice:(Device*)device
WithSuccess:(void (^)(id responseObject))success failure:(void (^)())failure;
/**
()
@param callType 0: 1:
*/
- (void)getVideoAccoutCallType:(int)callType
deviceModel:(Device *)deviceModel
Success:(void (^)(id responseObject))success
failure:(void (^)())failure;
/**
APP获取当前设备发起的视频通话的配置 ()
@param deviceImei imei
@param CallType 0 , 0: 1:
*/
- (void)getVideoInfoWithDeviceImei:(NSString*)deviceImei
CallType:(int)callType
Success:(void (^)(id responseObject))success
failure:(void (^)(void))failure;
/**
APP
*/
-(void)getMsgUnreadCount:(NSString *)msgType
Success:(void (^)(id responseObject))success
failure:(void (^)(void))failure;
/**
APP
@param msgType messageattentionnotification
*/
-(void)updateMsg2Read:(NSString *)msgId
MsgType:(NSString *)msgType
Success:(void (^)(id responseObject))success
failure:(void (^)(void))failure;
@end