查询配网基础数据

更新时间:2024-08-19 07:42:56下载pdf

提供配网列表数据获取能力,提供获取数据列表自定义展示的方法。您可以结合涂鸦开发者平台支持的配网列表页数据,来配置列表页。

功能说明

您需要通过 ThingSmartActivatorDiscoveryRequest 提供的对应方法,获取对应的数据类目信息。

接入组件

在工程的 Podfile 文件中添加技能快绑业务包组件,并执行 pod update 命令:

source 'https://github.com/tuya/tuya-pod-specs.git'
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'your_target_name' do
  pod 'ThingSmartActivatorDiscoveryManager'
end

依赖服务

无。

获取配网列表一级品类数据

接口

/// Request a list of categories at the first level
/// @param param Request parameters
/// @param success Network success callback, return the corresponding first-level category information
/// @param failure Network failure callbacks
- (void)requestPrimaryCategoryWithParam:(ThingActivatorPrimaryCategoryRequestData *)param success:(void(^)(ThingSmartACategoryModel *result))success failure:(ThingActivatorCallbackError)failure;

参数

Objective-C 示例

#import <ThingSmartActivatorDiscoveryManager/ThingSmartActivatorDiscoveryManager.h>

    self.requestService = [ThingSmartActivatorDiscoveryRequest new];
    ThingActivatorPrimaryCategoryRequestData *param = [[ThingActivatorPrimaryCategoryRequestData alloc] init];

    [self.requestService requestPrimaryCategoryWithParam:param success:^(ThingSmartACategoryModel * _Nonnull result) {
   
    } failure:failure];

Swift 示例

   let requestService = ThingSmartActivatorDiscoveryRequest()
   let requestData =  ThingActivatorPrimaryCategoryRequestData()
   requestService.requestPrimaryCategory(withParam: requestData) { result in
        
   } failure: { error in
        
   }

获取配网列表二级品类数据

参数

/// Request a list of secondary categories corresponding to primary categories
/// @param param Request parameters
/// @param success Network success callback, return the corresponding secondary category list
/// @param failure Network failure callbacks
- (void)requestSecondaryCategoryWithParam:(ThingActivatorSecondaryCategoryRequestData *)param success:(void(^)( NSArray <ThingSmartACategoryLevel2Model *>*result))success failure:(ThingActivatorCallbackError)failure;

参数

名称 参数类型 说明
levelOneCode NSString 一级类目的 levelOneCode
type NSString 一级类目的 type

Objective-C 示例

#import<ThingSmartActivatorDiscoveryManager/ThingSmartActivatorDiscoveryManager.h>

self.requestService = [ThingSmartActivatorDiscoveryRequest new];
ThingActivatorSecondaryCategoryRequestData *param = [[ThingActivatorSecondaryCategoryRequestData alloc] init];
param.levelOneCode = levelOneCode;
param.type = type;
[self.requestService requestSecondaryCategoryWithParam:param success:^(NSArray<ThingSmartACategoryLevel2Model *> * _Nonnull result) {

} failure:^(NSError * _Nonnull error) {
        
}];

Swift 示例

 let requestService = ThingSmartActivatorDiscoveryRequest()
 let requestData =  ThingActivatorSecondaryCategoryRequestData()
 requestData.levelOneCode = "levelOneCode"
 requestData.type = "type"
 requestService.requestSecondaryCategory(withParam: requestData) { result in
            
 } failure: { error in
            
 }

获取配网列表三级品类详情数据

参数

/// Request a list of secondary categories corresponding to primary categories
/// @param param Request parameters
/// @param success Network success callback to return bootstrap details
/// @param failure Network failure callbacks
- (void)requestCategoryDetailWithParam:(ThingActivatorCategoryDetailRequestData *)param success:(void(^)(ThingSmartDeviceCategoryModel *result))success failure:(ThingActivatorCallbackError)failure;

参数

名称 参数类型 说明
bizValue NSString 产品 ID 或者品类 ID
bizType NSNumber bizValue 类型
  • 0:品类
  • 1:产品

Objective-C 示例

ThingActivatorCategoryDetailRequestData *param = [[ThingActivatorCategoryDetailRequestData alloc] init];
param.bizType = bizType;
param.bizValue = bizValue;
    
[self.requestService requestCategoryDetailWithParam:param success:^(ThingSmartDeviceCategoryModel * _Nonnull result) {

} failure:failure];

Swift 示例

let requestService = ThingSmartActivatorDiscoveryRequest()
let requestData =  ThingActivatorCategoryDetailRequestData()
requestData.bizType = 1
requestData.bizValue = "productID"
requestService.requestCategoryDetail(withParam: requestData) { result in
    
} failure: { error in
    
}