简体中文
简体中文
English
联系我们
注册
登录
layout空间导航

通行管理

更新时间:2022-02-17 07:02:41下载pdf

App 通行

查询 App 授权访问人列表

接口说明

fun fetchAppAccessList(
        ownerId: String,
        effective: Int,
        pageNo: String,
        pageSize: String,
        listener: Business.ResultListener<AccessPageBean>?
    )

参数说明

参数 说明
ownerId 站点 ID
effective
  • 0:无效
  • 1:有效
pageNo 分页索引,最小值:1
pageSize 分页大小,默认值:20

示例代码

TuyaSmartResidenceSdk.access()
                .fetchAppAccessList(ownerId, 1, "1", "20", object : Business.ResultListener<AccessPageBean> {
                    override fun onFailure(p0: BusinessResponse?, p1: AccessPageBean?, p2: String?) {
												//error callback
                    }

                    override fun onSuccess(p0: BusinessResponse?, p1: AccessPageBean?, p2: String?) {
												//success callback
                    }
                })

添加 App 通行人员

接口说明

fun addAppAccess(accessCreateBean: AccessCreateBean, listener: Business.ResultListener<Boolean>?)

参数说明

参数 说明
accessCreateBean App 通行信息
username 用户名
nickname 昵称
deviceIdList 设备 ID 集合
startTime 有效起始时间
endTime 有效结束时间
userType 权限类型
  • 10:站点拥有者
  • 20:站点管理员
  • 30:App 通行人员
  • 40:密码通行人员
ownerId 站点 ID

示例代码

TuyaSmartResidenceSdk.access().addAppAccess(accessCreateBean, object : Business.ResultListener<Boolean> {
		override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
				//error callback
		}

		override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
				//success callback
		}
})

检验通行人员是否注册

接口说明

fun checkAccessAccount(username: String, listener: Business.ResultListener<Boolean>?)

参数说明

参数 说明
username 用户名

示例代码

TuyaSmartResidenceSdk.access().checkAccessAccount(username, object : Business.ResultListener<Boolean> {
		override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
				// error callback
		}

		override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
				// success callback
		}
})

检验通行人员是否已授权

接口说明

fun checkAccessAuthorization(ownerId: String, username: String, listener: Business.ResultListener<Int>?)

参数说明

参数 说明
ownerId 站点 ID
username 用户名

示例代码

TuyaSmartResidenceSdk.access().checkAccessAuthorization(ownerId,username,object : Business.ResultListener<Int> {
		override fun onFailure(p0: BusinessResponse?, p1: Int?, p2: String?) {
				// error callback
		}

		override fun onSuccess(p0: BusinessResponse?, p1: Int?, p2: String?) {
				// success callback
		}

})

查询 App 通行人员详情

接口说明

fun fetchAppAccessUserDetail(
        ownerId: String,
        accessUserId: String,
        listener: Business.ResultListener<AccessBean>?
    )

参数说明

参数 说明
ownerId 站点 ID
accessUserId 通行人员 ID

示例代码

TuyaSmartResidenceSdk.access().fetchAppAccessUserDetail(ownerId, accessUserId,
				object : Business.ResultListener<AccessBean> {
						override fun onFailure(p0: BusinessResponse?, p1: AccessBean?, p2: String?) {
								// error callback
						}

						override fun onSuccess(p0: BusinessResponse?, p1: AccessBean?, p2: String?) {
								// success callback
						}

})

查询 App 通行记录

接口说明

fun fetchAppAccessPassRecord(
        ownerId: String,
        accessUserId: String,
        pageNo: String,
        pageSize: String,
        listener: Business.ResultListener<PassRecordPageBean>?
    )

参数说明

参数 说明
ownerId 站点 ID
accessUserId 通行人员 ID
pageNo 分页索引,最小值:1
pageSize 分页大小,默认值:20

示例代码

TuyaSmartResidenceSdk.access().fetchAppAccessPassRecord(ownerId,accessUserId,"1","20",
					object : Business.ResultListener<PassRecordPageBean> {
                    override fun onFailure(p0: BusinessResponse?, p1: PassRecordPageBean?, p2: String?) {
														// error callback
                    }

                    override fun onSuccess(p0: BusinessResponse?, p1: PassRecordPageBean?, p2: String?) {
														// success callback
                    }

                })

查询 App 通行人员数量

接口说明

fun fetchAppAccessTotal(ownerId: String, effective: Int, listener: Business.ResultListener<Int>?)

参数说明

参数 说明
ownerId 站点 ID
effective
  • 0:无效
  • 1:有效

示例代码

TuyaSmartResidenceSdk.access().fetchAppAccessTotal(ownerId, 1, object : Business.ResultListener<Int> {
		override fun onFailure(p0: BusinessResponse?, p1: Int?, p2: String?) {
				// error callback
		}

		override fun onSuccess(p0: BusinessResponse?, p1: Int?, p2: String?) {
				// success callback
		}

})

移除 App 通行人员

接口说明

fun removeAppAccess(ownerId: String, accessUserId: String, listener: Business.ResultListener<Boolean>?)

参数说明

参数 说明
ownerId 站点 ID
accessUserId 通行人员 ID

示例代码

TuyaSmartResidenceSdk.access().removeAppAccess(ownerId, accessUserId,
         object : Business.ResultListener<Boolean> {
                override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                    	 // error callback
                }

                override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                    	 // success callback
                }

            })

修改 App 通行人员

接口说明

fun updateAppAccess(access: AccessUser,listener: Business.ResultListener<Boolean>?)

参数说明

参数 说明
access App 通行信息
nickname 昵称
deviceIdList 设备 ID 集合
startTime 有效起始时间
endTime 有效结束时间
userType 权限类型
  • 10:站点拥有者
  • 20:站点管理员
  • 30:App 通行人员
  • 40:密码通行人员
ownerId 站点 ID
accessUserId 通行人员 ID

示例代码

TuyaSmartResidenceSdk.access().updateAppAccess(accessUser, object : Business.ResultListener<Boolean> {
				override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
								// error callback
				}

				override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
								// success callback
				}

})

批量添加 App 通行设备

接口说明

fun addAppAccessDevice(
        ownerId: String,
        accessUserId: String,
        deviceIdList: List<String>,
        listener: Business.ResultListener<Boolean>?
    )

参数说明

参数 说明
ownerId 站点 ID
accessUserId 通行人员 ID
deviceIdList 设备 ID 集合

示例代码

TuyaSmartResidenceSdk.access().addAppAccessDevice(ownerId,accessUserId, deviceIdList,
        object : Business.ResultListener<Boolean> {
                override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                       // error callback
                }

                override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                       // success callback
                }

       })

移除 App 通行设备

接口说明

fun removeAppAccessDevice(
        ownerId: String,
        accessUserId: String,
        deviceId: String,
        listener: Business.ResultListener<Boolean>?
    )

参数说明

参数 说明
ownerId 站点 ID
accessUserId 通行人员 ID
deviceId 设备 ID

示例代码

TuyaSmartResidenceSdk.access().removeAppAccessDevice(ownerId, accessUserId, deviceId,
        object : Business.ResultListener<Boolean> {
               override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                       // error callback
               }

               override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                       // success callback
               }
        })

密码通行

查询密码访问人列表

接口说明

fun fetchPasswordAccessList(
        ownerId: String,
        effective: Int,
        pageNo: String,
        pageSize: String,
        listener: Business.ResultListener<ArrayList<AccessPasswordBean>>?
    )

参数说明

参数 说明
ownerId 站点 ID
effective
  • 0:无效
  • 1:有效
pageNo 分页索引,最小值:1
pageSize 分页大小,默认值:20

示例代码

TuyaSmartResidenceSdk.access().fetchPasswordAccessList(ownerId,1,"1","20",
				object : Business.ResultListener<ArrayList<AccessPasswordBean>> {
                override fun onFailure(p0: BusinessResponse?, p1: ArrayList<AccessPasswordBean>?, p2: String?) {
												// error callback
                }

                override fun onSuccess(p0: BusinessResponse?, p1: ArrayList<AccessPasswordBean>?, p2: String?) {
												// success callback
                }
				})

添加密码通行人员

接口说明

fun addPasswordAccess(
        ownerId: String,
        passwordCreateBean: PasswordCreateBean,
        deviceDataList: List<DeviceData>,
        listener: Business.ResultListener<PasswordResult>?
    )

参数说明

参数 说明
ownerId 站点 ID
passwordCreateBean 密码通行信息
deviceDataList 设备信息集合

示例代码

TuyaSmartResidenceSdk.access().addPasswordAccess(ownerId,passwordCreateBean,deviceDataList,
         object : Business.ResultListener<PasswordResult> {
                 override fun onFailure(p0: BusinessResponse?, p1: PasswordResult?, p2: String?) {
                         // error callback
                 }

                 override fun onSuccess(p0: BusinessResponse?, p1: PasswordResult?, p2: String?) {
                         // success callback
                 }
         })

查询密码通行人员详情

接口说明

fun fetchPasswordAccessUserDetail(
        ownerId: String,
        authGroupId: String,
        listener: Business.ResultListener<PasswordDetail>?
    )

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID

示例代码

TuyaSmartResidenceSdk.access().fetchPasswordAccessUserDetail(ownerId,authGroupId,
         object : Business.ResultListener<PasswordDetail> {
                    override fun onFailure(p0: BusinessResponse?, p1: PasswordDetail?, p2: String?) {
                            // error callback
                    }

                    override fun onSuccess(p0: BusinessResponse?, p1: PasswordDetail?, p2: String?) {
                            // error callback
                    }
         })

查询密码通行记录

接口说明

fun fetchPasswordAccessPassRecord(
        ownerId: String,
        authGroupId: String,
        pageNo: String,
        pageSize: String,
        listener: Business.ResultListener<PassRecordPageBean>?
    )

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID
pageNo 分页索引,最小值:1
pageSize 分页大小,默认值:20

示例代码

TuyaSmartResidenceSdk.access().fetchPasswordAccessPassRecord(ownerId,authGroupId,"1","20",
         object : Business.ResultListener<PassRecordPageBean> {
                 override fun onFailure(p0: BusinessResponse?, p1: PassRecordPageBean?, p2: String?) {
                         // error callback
                 }

                 override fun onSuccess(p0: BusinessResponse?, p1: PassRecordPageBean?, p2: String?) {
                         // success callback
                 }

         })

查询密码通行人员数量

接口说明

fun fetchPasswordAccessTotal(ownerId: String, effective: Int, listener: Business.ResultListener<Int>?)

参数说明

参数 说明
ownerId 站点 ID
effective
  • 0:无效
  • 1:有效

示例代码

TuyaSmartResidenceSdk.access().fetchPasswordAccessTotal(ownerId, 1, object : Business.ResultListener<Int> {
		override fun onFailure(p0: BusinessResponse?, p1: Int?, p2: String?) {
				// error callback
		}

		override fun onSuccess(p0: BusinessResponse?, p1: Int?, p2: String?) {
				// success callback
		}

})

移除密码通行人员

接口说明

fun removePasswordAccess(ownerId: String, authGroupId: String, listener: Business.ResultListener<Boolean>?)

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID

示例代码

TuyaSmartResidenceSdk.access().removePasswordAccess(ownerId, authGroupId,
         object : Business.ResultListener<Boolean> {
                override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                    	 // error callback
                }

                override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                    	 // success callback
                }

            })

修改密码通行昵称

接口说明

fun updatePasswordAccessNickname(
        ownerId: String,
        authGroupId: String,
        nickname: String,
        listener: Business.ResultListener<Boolean>?
    )

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID
nickname 昵称

示例代码

TuyaSmartResidenceSdk.access().updateAppAccess(accessUser, object : Business.ResultListener<Boolean> {
				override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
								// error callback
				}

				override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
								// success callback
				}

})

修改密码通行有效期

接口说明

fun updatePasswordAccessValidity(
        ownerId: String,
        authGroupId: String,
        doorPassword: DoorPassword,
        listener: Business.ResultListener<Boolean>?
    )

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID
doorPassword 通信密码有效期信息

示例代码

TuyaSmartResidenceSdk.access().updatePasswordAccessValidity(ownerId, authGroupId, doorPassword,
         object : Business.ResultListener<Boolean> {
                 override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
												// error callback
                 }

                 override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
												// success callback
                 }
         })

批量添加密码通行设备

接口说明

fun addPasswordAccessDevice(
        ownerId: String,
        authGroupId: String,
        deviceIdList: List<String>,
        listener: Business.ResultListener<Boolean>?
    )

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID
deviceIdList 设备 ID 集合

示例代码

TuyaSmartResidenceSdk.access().addPasswordAccessDevice(ownerId, authGroupId, deviceIdList,
         object : Business.ResultListener<Boolean> {
                 override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
												// error callback
                 }

                 override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
												// success callback
                 }
         })

移除密码通行设备

接口说明

fun removePasswordAccessDevice(
        ownerId: String,
        authGroupId: String,
        deviceId: String,
        listener: Business.ResultListener<Boolean>?,
    )

参数说明

参数 说明
ownerId 站点 ID
authGroupId 通行人员 ID
deviceId 设备 ID

示例代码

TuyaSmartResidenceSdk.access().removePasswordAccessDevice(ownerId, authGroupId, deviceId,
        object : Business.ResultListener<Boolean> {
               override fun onFailure(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                       // error callback
               }

               override fun onSuccess(p0: BusinessResponse?, p1: Boolean?, p2: String?) {
                       // success callback
               }
        })

查询通行设备列表

接口说明

fun fetchDeviceListWithSiteId(ownerId: String, listener: Business.ResultListener<ArrayList<String>>?)

参数说明

参数 说明
ownerId 站点 ID

示例代码

TuyaSmartResidenceSdk.access()
                .fetchDeviceListWithSiteId(ownerId, object : Business.ResultListener<ArrayList<String>> {
                    override fun onFailure(p0: BusinessResponse?, p1: ArrayList<String>?, p2: String?) {
												// error callback
                    }

                    override fun onSuccess(p0: BusinessResponse?, p1: ArrayList<String>?, p2: String?) {
												// success callback
                    }

                })