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.
 
 
 
 

332 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;
/**
公众号模板消息开关状态(打开:1,关闭:0,未关注公众号:2)
*/
@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;
/**
是(1)否(0)手机账号登录
*/
@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 message:提醒,attention:关注记录,notification:通知
*/
-(void)updateMsg2Read:(NSString *)msgId
MsgType:(NSString *)msgType
Success:(void (^)(id responseObject))success
failure:(void (^)(void))failure;
@end