From f037ab79698fe3b1c0a2bc8a3db0663febfa7f80 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期一, 19 四月 2021 15:57:43 +0800 Subject: [PATCH] 2021-04-19 1.1.HDL云萤石摄像头对接接口,增加platform参数, 代表平台 1.on+(默认) 2.evoyo --- Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/Global/ResponseData.m | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/Global/ResponseData.m b/Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/Global/ResponseData.m index eb4aa3d..25d1404 100644 --- a/Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/Global/ResponseData.m +++ b/Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/Global/ResponseData.m @@ -10,4 +10,55 @@ @implementation ResponseData +/// init +-(id)init { + if (self = [super init]) { + self.code = @"-1"; + self.message = @"璇锋眰鏈嶅姟鍣ㄥけ璐ワ紝璇风◢鍚庡啀璇曪紒"; + + } + return self; +} + +/// 鍒濆鍖栧苟瑙f瀽杩斿洖瀛楀吀鍙傛暟 +/// @param dic 杩斿洖鍙傛暟 +- (id)initWithDictionary:(NSDictionary *)dic +{ + if (self = [super init]) { + @try { + if (dic) { + //1.鍙栧嚭杩斿洖鏁版嵁鐨勭姸鎬佺爜 + self.code = [NSString stringWithFormat:@"%@", dic[@"code"]]; + //2.鎻愮ず淇℃伅 + self.message = [dic objectForKey:@"message"]; + //3.杩斿洖鏁版嵁 + NSDictionary *mData = (NSDictionary *)[dic objectForKey:@"data"]; + self.data = mData; + } else { + //娌℃湁杩斿洖鏁版嵁 + self.message = @"璇锋眰鏈嶅姟鍣ㄥけ璐ワ紝璇风◢鍚庡啀璇曪紒"; + self.data = nil; + self.code = @"-1"; + } + } + //鎺ユ敹鍒板紓甯� + @catch (NSException *exception) { + self.message = @"鏁版嵁瑙f瀽閿欒"; + self.data = dic; + self.code = @"-2"; + } + @finally { + + } + } + return self; +} + +/// Description +- (BOOL)success +{ + //娌充笢code涓�0 锛岃悿鐭充负200 浠h〃鎴愬姛 + return [self.code isEqual: @"0"] || [self.code isEqual: @"200"] ; +} + @end -- Gitblit v1.8.0