upFamilyModule 家庭模块

模块概述

家庭模块为H5页面提供获取家庭列表相关信息。

注意,如果需要用到全面的家庭信息,需要注册监听,等家庭列表刷新完成后再调用相关接口,监听调用示例:

uplusapi.addEventListener('Noti_UserFamilyListChange', 'name', (data) => {
  // uses the data
});

Noti_UserFamilyListChange:用户家庭列表刷新后发送此通知
Noti_UserDeviceListChange:用户设备列表刷新后发送此通知
Noti_UserCurrentFamilyChange:用户当前家庭发生变更后发送此通知

方法列表

  • getFamilyMap (获取家庭列表)
  • getCurrentFamily (获取当前家庭信息)
  • setCurrentFamily (设置当前家庭)
  • createFamilyFloor (创建家庭楼层)
  • deleteFamilyFloor (删除家庭楼层)
  • updateRoomName (更新房间名称)
  • updateRoomList (更新当前家庭房间列表)
  • moveDevicesToOtherRoom (批量移动设备到新房间)
  • addFamilyRoom (增加家庭下房间)
  • updateDeviceName (更改设备名称)
  • removeFamilyRoom (删除家庭下房间)
  • createFamily (创建家庭)
  • updateFamilyInfo (更新家庭信息)
  • exitFamilyAsMember (普通成员离开家庭)
  • exitFamilyAsAdmin (管理员移除家庭)
  • deleteMemberAsAdmin (管理员移除成员)
  • inviteMemberAsAdmin (管理员邀请成员(通过手机号))
  • changeFamilyAdmin (变更家庭管理员)
  • deleteFamilyAsAdmin (管理员解散家庭)
  • queryFirstMember (查询第一个加入家庭的家庭成员)
  • queryFamilyInfo (查询家庭信息)
  • queryFamilyInfoFromCache (由缓存查询家庭信息)
  • addVirtualMember (虚拟用户加入家庭)
  • modifyVirtualMember (修改虚拟成员)
  • moveDevicesToFamily (批量转移设备到目标家庭)
  • unbindDeviceFromFamily (家庭批量解绑设备)
  • removeDevicesFromFamily (家庭批量移除设备)

公共数据

  • 所有数据均以JSON结构返回,由代码,信息和数据三部分组成
{
    "retCode": "000000", //接口状态标识码,错误标识码以29开头
    "retInfo": "操作成功",//接口信息说明
    "retData": null //业务数据
}

房间信息模型 RoomInfo

{ 
  "familyId": "",
  "roomId": "",
  "roomName": "",
  "roomClass":"", //房间类型
  "roomLabel":"", //房间标签
  "roomLogo":"",  //房间logo url
  "roomPicture":"" //房间图片 url
}
  • 房间信息模型定义
属性名 数据类型 说明
familyId String 家庭id
roomId String 房间id
roomName String 房间名称
roomClass String 房间类型
roomLabel String 房间标签
roomLogo String 房间logo url
roomPicture String 房间图片 url

楼层信息模型 FloorInfo

{ 
  'floorId': '',
  'floorOrderId': '',
  'floorName': '',
  'floorClass': '',
  'floorLabel': '',
  'floorLogo': '',
  'floorPicture': '',
  'floorCreateTime': '',
  'rooms': [RoomInfo],
}
  • 楼层信息模型定义
属性名 数据类型 说明
floorId String 楼层id
floorName String 楼层名称
floorOrderId String 楼层次序(-3到5,没有0)
floorClass String 楼层类型
floorLabel String 楼层标签
floorLogo String 楼层logo url
floorPicture String 楼层图片url
floorCreateTime String 楼层创建时间
rooms [RoomInfo] 房间列表

设备信息模型 DeviceInfo

{
  "apptypeName": "空气净化器", //设备类型名称
  "brand": "haier", // 设备品牌
  "prodNo": "FR00V7M2E", //产品编号
  "bindType": "SmartLink", //绑定类型
  "bindTime": "2019-10-31 10:30:11", //绑定时间comunicationMode
  "comunicationMode": "xxxxx", //通讯方式
  "deviceId": "0007A8AC5CEC", //设备deviceId
  "deviceName": "E70edE6cf51", //设备名称
  "deviceType": "20001###", //设备类型代码
  "deviceNetType":"netDevice",//设备网器类型,netDevice:网器,noNetDevice:非网器
  "deviceRole": "1", //1.普通和设备;2.网关设备;3.附件设备; 4 子设备
  "deviceRoleType": "1", //主设备/子设备/无主从关系,枚举值:0 无主设备;1 主设备;2 子设备。
  "imageAddr1": "http://file.c.haier.net/images/2019/01/11/f3aed13ef3e044b6eba388d046c934fe.png", //设备图片1
  "imageAddr2": "http://file.c.haier.net/images/2019/01/11/f3aed13ef3e044b6eba388d046c934fe.png", //设备图片2
  "isOnline": false, //设备在线状态
  "model": "M1黑色", //设备型号
  "wifiType": "201c120000118674200100418002065800000000000000000000000000000040", //设备typeid
  "ownerId": "25950360", //管理员Id
  "ownerInfo": { //设备管理员信息
    "mobile": "158****4506", //管理员手机号
    "userId": "5569278" //管理员userId
  },
  "permission": {
    "auth": {
      "control": true, //是否可控制
      "set": true, //是否可修改
      "view": true //是否可查看
    },
    "authType": "home" //授权类型
  },
  "room": RoomInfo, // 房间信息,RoomInfo参照房间信息模型
  "devFloorId": "123",  // 楼层id
  "devFloorOrderId": "1", // 楼层次序
  "devFloorName": "一楼", // 楼层名称
  "deviceNetType": "netDevice",//设备网器类型
}
  • 设备信息定义
属性名 数据类型 说明
apptypeName String 设备类型名称
brand String 设备品牌
prodNo String 产品编号
bindType String 绑定类型
bindTime String 绑定时间
comunicationMode String 通讯方式
deviceId String 设备mac
deviceName String 设备名称
deviceType String 设备类型代码
deviceNetType String 设备网器类型,netDevice:网器,noNetDevice:非网器
deviceRole String 1.普通和设备;2.网关设备;3.附件设备; 4 子设备
deviceRoleType String 主设备/子设备/无主从关系,枚举值:0 无主设备;1 主设备;2 子设备。
imageAddr1 String 设备图片地址1
imageAddr2 String 设备图片地址2
isOnline Boolean 设备在线状态
model String 设备型号
wifiType String 设备typeid
ownerId String 管理员id
ownerInfo Object 设备管理员信息
permission Object 授权信息
auth Object 权限信息
control Boolean 是否可控制
set Boolean 是否可修改
view Boolean 是否可查看
authType String 授权类型
room RoomInfo 房间信息
devFloorId String 楼层id
devFloorOrderId String 楼层次序(-3到5,没有0)
devFloorName String 楼层名称
deviceNetType String 设备网器类型 (网器:netDevice,非网器:nonNetDevice)

成员信息模型 MemberInfo

{ 
  "joinTime": "2017-02-25 14:09:18", //加入时间
  "memberInfo": { //成员信息
    "avatarUrl": "http://resource.haier.net:80/download/resource/uzhsh/5569278/1499938384705.jpg", //头像地址
    "mobile": "158****4506", //手机号
    "name": "ghgcvvccE7684", // 用户名
    "userId": "5569278", // 用户userId
    "virtualUserFlag": false, // true 虚拟用户,false 非虚拟用户
    "ucUserId":"", //用户中心userId
    "hostUserId":"" //宿主用户的IOT平台userId
  },
  "memberName": "admin5569278", //成员名称
  "familyId":"", //家庭id
  "shareDeviceCount": 5 //分享到该家庭下的设备数量
}
  • 成员信息定义
属性名 数据类型 说明
joinTime String 加入时间
memberInfo Object 成员信息
avatarUrl String 头像地址
mobile String 手机号
name String 用户名
userId String 用户userId
virtualUserFlag boolean 虚拟用户标识
ucUserId String 用户中心userId
hostUserId String 宿主用户的IOT平台userId
memberName String 成员名称
familyId String 家庭id
shareDeviceCount Number 分享到该家庭下的设备数量

家庭数据模型 FamilyInfo

{
  "createTime": "2017-02-25 14:09:18", //家庭创建时间
  "familyId": "994039150958000000", //家庭familyId
  "firstMember": MemberInfo, //首位加入的成员信息,MemberInfo参照成员信息模型
  "info": { //家庭信息
    "familyLocation": { // 家庭定位
      "cityCode": "101020100", // 家庭所在城市代码
      "latitude": 31.24916, //家庭所在城市经度
      "longitude": 121.4879 //家庭所在城市纬度
    },
    "familyName": "家庭1", //家庭名称
    "familyPosition": "广州 番禺" //家庭位置
  },
  "locationChangeFlag": true, //家庭位置修改标识位
  "members": [MemberInfo], //成员列表,MemberInfo参照成员信息模型
  "owner": { //管理员信息
    "avatarUrl": "",  //头像
    "mobile": "", //电话
    "userId": "", //userId
    "ucUserId":"", //用户中心userId
    "name":"",//昵称
  },
  "floorInfos": [FloorInfo], //楼层列表,FloorInfo参照楼层信息模型
  "sharedDevices": [DeviceInfo], //分享的设备列表,DeviceInfo参照设备信息模型
  "familyOwner":"" // 家庭管理员id
  • 设备基本信息定义
属性名 数据类型 说明
createTime String 创建时间
familyId String 家庭Id
firstMember Object 首位加入家庭的成员信息
info Object 家庭信息
familyLocation Object 家庭定位
cityCode String 家庭所在城市代码
latitude Number 家庭所在城市经度
longitude Number 家庭所在城市纬度
familyName String 家庭名称
familyPosition String 家庭位置
locationChangeFlag Boolean 家庭位置修改标识位
members Array 家庭成员列表
owner Object 管理员信息
avatarUrl String 头像
mobile String 电话
userId String 优家云平台用户Id
ucUserId String 用户中心userId
name String 管理员昵称
floorInfos [FloorInfo] 家庭楼层列表
sharedDevices [DeviceInfo] 分享到该家庭下的设备列表
familyOwner String 家庭管理员id

批量处理设备结果模型 BatchProcessDeviceCollection

{
  "successDevices": [BatchProcessDevice];
  "failureDevices": [BatchProcessDevice];
}
  • 批量处理设备结果模型定义
属性名 数据类型 说明
successDevices [BatchProcessDevice] 成功处理的设备信息集合
failureDevices [BatchProcessDevice] 处理失败的设备信息集合

批量处理设备模型 BatchProcessDevice

{
  "deviceId": string;
  "deviceName": string;
}
  • 批量处理设备模型定义
属性名 数据类型 说明
deviceId string 设备ID
deviceName string 设备名称

具体定义:返回数据通用


模块变更记录

  • V4.0.0
    • 删除接口
      • editFamilyFloor(编辑楼层)
    • 部分错误码变更
    • 创建家庭参数变更:
      • 新增房间参数模型Room,包含roomName、roomClass2个属性。
      • 创建家庭接口参数新增房间参数数组Room[]。
    • 新增接口
      • queryFirstMember (查询第一个加入家庭的家庭成员)
      • queryFamilyInfo (查询家庭信息)
      • queryFamilyInfoFromCache (由缓存查询家庭信息)
      • addVirtualMember (虚拟用户加入家庭)
      • modifyVirtualMember (修改虚拟成员)
      • moveDevicesToFamily (批量转移设备到目标家庭)
      • unbindDeviceFromFamily (家庭批量解绑设备)
      • removeDevicesFromFamily (家庭批量移除设备)
  • V3.7.0

    • 数据模型变更:
      • DeviceInfo对象中新增deviceNetType属性, 设备网器类型(netDevice 网器;nonNetDevice 非网器)。
      • DeviceInfo对象中新增deviceRole,deviceRoleType属性。
  • V3.6.0(App版本6.22.0及以上)

    • 新增数据模型:
      • FloorInfo(楼层模型)
    • 数据模型变更:
      • FamilyInfo 中去掉 rooms 属性,新增 floorInfos 属性
      • DeviceInfo 中新增楼层字段:devFloorId, devFloorName, devFloorOrderId
    • 新增方法:
      • createFamilyFloor(新建楼层)
      • deleteFamilyFloor(删除楼层)
      • editFamilyFloor(编辑楼层)
    • 方法变更:
      • addFamilyRoom(增加家庭下房间):新增入参 floorId(必填)
      • updateRoomList(刷新房间列表):新增入参 floorId(必填)
  • V3.0.0

    • 新增family模块,新增方法:
      • getFamilyMap (获取家庭列表)
      • setCurrentFamily (设置当前家庭)
      • getCurrentFamily (获取当前家庭信息)
      • updateRoomName (更新房间名称)
      • deviceUpdateRoomName (更新设备房间位置)
  • V3.2.0

    • 重构家庭模块接口,统一返回数据,重新定义retCode:
      • 000000---操作成功
      • 000001---操作失败
      • 000002---非法参数错误
      • 990001---模块未定义
      • 300001---目标家庭不存在
      • 300002---目标房间不存在
      • 300003---目标设备不存在
      • 300004---用户未登陆
      • 300005---用户数据刷新中
      • 300006---目标房间已存在
    • 增加cordova容器对模块的支持
    • 增加updateRoomList(更新当前家庭房间列表)接口
    • 正确返回数据中latitude,longitude字段变更为Number类型
    • 新增moveDevicesToOtherRoom (批量移动设备到新房间)
    • 删除deviceUpdateRoomName
    • 新增addFamilyRoom(增加家庭下房间)、updateDeviceName(更改设备名称)接口
  • V3.3.0

    • 新增方法:
      • removeFamilyRoom (删除家庭下房间)
      • createFamily (创建家庭)
      • updateFamilyInfo (更新家庭信息)
      • exitFamilyAsMember (普通成员离开家庭)
      • exitFamilyAsAdmin (管理员移除家庭)
      • deleteMemberAsAdmin (管理员移除成员)
      • inviteMemberAsAdmin (管理员邀请成员(通过手机号))
      • changeFamilyAdmin (变更家庭管理员)
      • deleteFamilyAsAdmin (管理员解散家庭)
  • V3.4.0(警告:此版本修改的方法仅支持App版本6.19.0及以上)

    • 修改方法:

      • getFamilyMap (获取家庭列表)

        • 智家App版本6.19.0以前,使用此版本getFamilyMap时,会导致返回数据为空
      • getCurrentFamily (获取当前家庭信息)

        • 智家App版本6.19.0以前,使用此版本getCurrentFamily时,会导致返回数据为空
      • createFamily (创建家庭)
        • 返回数据格式更改为:
          {
          "retCode":"000000",
          "retInfo":"调用函数createFamily([object Object])成功",
          "retData":{
            "familyId":"341169379443000000"
          }
          }
          

方法说明

  • getFamilyMap (获取家庭列表)

    getFamilyMap()
适用性
容器 Nebula
支持情况
APP版本 6.12.0 及以上
params 输入参数:

错误返回 retCode说明:
retCode编码 retInfo说明
000000 操作成功
110001 用户未登录
110002 用户数据未刷新完成
正确返回 retData说明:
数据类型 说明
[FamilyInfo] 家庭列表
示例

调用方式

uplusapi.upFamilyModule.getFamilyMap().then((result) =>console.log('result',result));

获取成功返回结果

{
    "retCode": "000000",
    "retInfo": "调用函数getFamilyMap()成功",
    "retData": [FamilyInfo] //参照家庭信息模型
}
  • getCurrentFamily (获取当前家庭列信息)

    getCurrentFamily()
适用性
容器 Nebula
支持情况
APP版本 6.12.0 及以上
params 输入参数:

错误返回 retCode说明:
retCode编码 retInfo说明
000000 操作成功
110001 用户未登录
110002 用户数据未刷新完成
正确返回 retData说明:
数据类型 说明
FamilyInfo 家庭信息
示例

调用方式

uplusapi.upFamilyModule.getCurrentFamily().then((result) =>console.log('result',result));

获取成功返回结果

{
    "retCode": "000000",
    "retInfo": "调用函数getCurrentFamily()成功",
    "retData": FamilyInfo //参照家庭信息模型
}
  • setCurrentFamily (设置当前家庭)

    setCurrentFamily()
适用性
容器 Nebula
支持情况
APP版本 6.12.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 家庭Id
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.setCurrentFamily({
  "familyId": "123123"
}).then((result) =>console.log('result',result));
  • createFamilyFloor (创建家庭楼层)

    createFamilyFloor()
适用性
容器 Nebula
支持情况
APP版本 6.22.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 家庭id
floorOrderId String 楼层次序(-3到5,没有0;为了方便后续扩展 app server 仅对 0 做了限制)
floorName String 楼层名称(目前不支持,为以后楼层需求迭代而保留的字段)
floorLabel String 楼层标签 (目前不支持,为以后楼层需求迭代而保留的字段)
floorLogo String 楼层logo url (目前不支持,为以后楼层需求迭代而保留的字段)
floorPicture String 楼层图片url (目前不支持,为以后楼层需求迭代而保留的字段)
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.createFamilyFloor({
  familyId: '123456',
  floorOrderId: '1',
  floorName: '一楼',
  floorLabel: '客厅一楼',
  floorLogo: 'http://www.haier.com/123.jpg',
  floorPicture: 'http://www.haier.com/456.jpg',
}).then((result) =>console.log('result',result));
  • deleteFamilyFloor (删除家庭楼层)

    deleteFamilyFloor()
适用性

| 容器 | Nebula | | :--: | :--: | | 支持情况| 是 | | APP版本 | 6.22.0 及以上 |

params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 家庭id
floorId String 楼层id
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.deleteFamilyFloor({
  familyId: '123456',
  floorId: '123'
}).then((result) => {
    console.log('result',result);
}).catch((e) => {
    console.log(e);
});
  • updateRoomName (更新房间名称)

    updateRoomName()
适用性
容器 Nebula
支持情况
APP版本 6.12.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 家庭Id
roomId String 房间Id
roomName String 房间名称
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.updateRoomName({
  "familyId": "12313",
  "roomId": "123132",
  "roomName": "厨房"
}).then((result) =>console.log('result',result));
  • moveDevicesToOtherRoom (批量移动设备到新房间)

    moveDevicesToOtherRoom()
适用性
容器 Nebula
支持情况
APP版本 6.12.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 家庭Id
deviceIds Array 要移动的设备信息数组,见下方deviceIds单独说明
newRoom String 新房间名称
newRoomId String 新房间id

deviceIds属性

属性名 数据类型 说明
deviceId String 设备id
deviceName String 设备名称
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在

|110004|房间不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.moveDevicesToOtherRoom({
      familyId: '717040163919000002',
      deviceIds: [{ deviceId: '78:A5:04:4B:2A:92', deviceName: '体质仪1112' }],
      newRoom: '客厅',
      newRoomId: '359150848956000000'
    }).then(res=>{
      console.log('moveDevicesToOtherRoom', res);
      uplusapi.upFamilyModule.getFamilyMap().then(ret=>{
      console.log('更新后信息', ret);
    });
    });
  • updateRoomList (更新当前家庭房间列表)

    updateRoomList()
适用性
容器 Nebula
支持情况
APP版本 6.12.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 家庭Id
floorId String 楼层Id
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:
数据类型 说明
[RoomInfo] 房间信息列表
示例

调用方式

uplusapi.upFamilyModule.updateRoomList({
  "familyId":"12312313",
  "floorId":"123abc"
}).then((result) =>console.log('result',result));
  • addFamilyRoom (增加家庭下房间)

    addFamilyRoom()
适用性
容器 Nebula
支持情况
APP版本 6.13.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
roomName String 添加的房间名称
familyId String 要添加房间的家庭ID
floorId String 要添加房间所在的楼层ID
roomLabel String /
roomClass String /
roomLogo String /
roomPicture String /
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

由于历史原因,虽然接口返回值声明为void,但实际retData返回结构如下:

|属性名| 数据类型 | 说明 | | --- | --- | --- | | roomId| String | 房间ID |

示例

调用方式

uplusapi.upFamilyModule.addFamilyRoom({
  roomName: '储藏室',
  familyId: '12345678',
  floorId: '123abc'
}).then(res => console.log(res)).catch(err => console.log(err));
  • updateDeviceName (更改设备名称)

    updateDeviceName()
适用性
容器 Nebula
支持情况
APP版本 6.13.0 及以上
params 输入参数:
属性名 数据类型 是否必填 说明
deviceId String 要修改设备mac
deviceName String 要修改设备昵称
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110007 家庭设备不存在
正确返回 retData说明:

由于历史原因,虽然接口返回值声明为void,但实际retData返回结构如下:

|属性名| 数据类型 | 说明 | | --- | --- | --- | | deviceId| String | 设备ID |

示例

调用方式

uplusapi.upFamilyModule.updateDeviceName({
  deviceId: 'DC330DDDDDD',
  deviceName: '我的设备'
}).then(res => console.log(res)).catch(err => console.log(err));
  • removeFamilyRoom (删除家庭下房间)

    removeFamilyRoom()
适用性
容器 Nebula
支持情况 | 是
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
roomId String 要删除房间ID
familyId String 要删除房间的家庭ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.removeFamilyRoom({
  roomId: '123132',
  familyId: '12345678'
}).then(res => console.log(res)).catch(err => console.log(err));
  • createFamily (创建家庭)

    createFamily()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyName String 创建的家庭名称
familyPosition String 创建的家庭位置
familyLocation Object 家庭所在经纬度、城市编码
roomNames Array 房间信息
familyLocation
属性名 数据类型 是否必填 说明
longitude Number 经度
latitude Number 纬度
cityCode String 城市编码,该参数暂无用,cityCode app server会根据经纬度计算
roomNames
属性名 数据类型 是否必填 说明
roomName String 房间名称
roomClass String 房间类型
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
正确返回 retData说明:

由于历史原因,虽然接口返回值声明为void,但实际retData返回结构如下:

|属性名| 数据类型 | 说明 | | --- | --- | --- | | familyId| String | 家庭ID |

示例

调用方式

uplusapi.upFamilyModule.createFamily({
  familyName: '小屋',
  familyPosition: '青岛',
  familyLocation:{
    longitude: 120.2563476600,
    latitude:  35.8712468500,
    cityCode: '370202'
  },
  roomNames:[{roomName:'阳台',roomClass:'阳台'}]
}).then(res => console.log(res)).catch(err => console.log(err));
  • updateFamilyInfo (更新家庭信息)

    updateFamilyInfo()
适用性
容器 | Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 修改的家庭ID
familyName String 修改家庭名称
familyPosition String 修改家庭位置
familyLocation Object 修改家庭所在经纬度、城市编码
familyLocation
属性名 数据类型 是否必填 说明
longitude Number 经度
latitude Number 纬度
cityCode String 城市编码
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.updateFamilyInfo({
  familyId: '12345678',
  familyName: '小屋',
  familyPosition: '青岛',
  familyLocation:{
    longitude: 120.2563476600,
    latitude:  35.8712468500,
    cityCode: '370202'
  }
}).then(res => console.log(res)).catch(err => console.log(err));
  • exitFamilyAsMember (普通成员离开家庭)

    exitFamilyAsMember()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要离开的家庭ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.exitFamilyAsMember({
  familyId: '12345678'
}).then(res => console.log(res)).catch(err => console.log(err));
  • exitFamilyAsAdmin (管理员离开家庭)

    exitFamilyAsAdmin()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要离开的家庭ID
userId String 管理员ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.exitFamilyAsAdmin({
  familyId: '12345678',
  userId: '123456789'
}).then(res => console.log(res)).catch(err => console.log(err));
  • deleteMemberAsAdmin (管理员移除成员)

    deleteMemberAsAdmin()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要移除的家庭ID
userId String 被移除的成员ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.deleteMemberAsAdmin({
  familyId: '12345678',
  userId: '123456789'
}).then(res => console.log(res)).catch(err => console.log(err));
  • inviteMemberAsAdmin (管理员邀请成员(通过手机号))

    inviteMemberAsAdmin()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要加入的家庭ID
phone String 邀请成员的手机号
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.inviteMemberAsAdmin({
  familyId: '12345678',
  phone: '123456789'
}).then(res => console.log(res)).catch(err => console.log(err));
  • changeFamilyAdmin (变更家庭管理员)

    changeFamilyAdmin()
适用性
容器 Nebula
支持情况
APP版本 | 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要变更的家庭ID
userId String 要移交的用户ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.changeFamilyAdmin({
  familyId: '12345678',
  userId: '123456789'
}).then(res => console.log(res)).catch(err => console.log(err));
  • deleteFamilyAsAdmin (管理员解散家庭)

    deleteFamilyAsAdmin()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要变更的家庭ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误

|110003|家庭不存在|

正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.deleteFamilyAsAdmin({
  familyId: '12345678'
}).then(res => console.log(res)).catch(err => console.log(err));
  • queryFirstMember (查询第一个加入家庭的家庭成员)

    queryFirstMember()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要查询的家庭ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:
数据类型 说明
MemberInfo 家庭成员信息
示例

调用方式

uplusapi.upFamilyModule.queryFirstMember({
  familyId: '12345678'
}).then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
    "retCode": "000000",
    "retInfo": "调用函数queryFirstMember()成功",
    "retData": MemberInfo //参照家庭成员信息模型
}
  • queryFamilyInfo (查询家庭信息)

    queryFamilyInfo()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要查询的家庭ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:
数据类型 说明
FamilyInfo 家庭成员信息
示例

调用方式

uplusapi.upFamilyModule.queryFamilyInfo(data: {
({
  familyId: '12345678'
}).then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
    "retCode": "000000",
    "retInfo": "调用函数queryFamilyInfo()成功",
    "retData": FamilyInfo //参照家庭信息模型
}
  • queryFamilyInfoFromCache (由缓存查询家庭信息)

    queryFamilyInfoFromCache()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要查询的家庭ID
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:
数据类型 说明
FamilyInfo 家庭成员信息
示例

调用方式

uplusapi.upFamilyModule.queryFamilyInfoFromCache(data: {
({
  familyId: '12345678'
}).then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
    "retCode": "000000",
    "retInfo": "调用函数queryFamilyInfoFromCache()成功",
    "retData": FamilyInfo //参照家庭信息模型
}
  • addVirtualMember (虚拟用户加入家庭)

    addVirtualMember()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要加入的家庭ID
virtualUCId String 虚拟用户用户中心ID
userFamilyName String 用户加入家庭附属参数,为用户在家庭中昵称
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.addVirtualMember({
  familyId: '12345678';
  virtualUCId: '1234567';
  userFamilyName: 'name';
}).then(res => console.log(res)).catch(err => console.log(err));
  • modifyVirtualMember (修改虚拟成员)

    modifyVirtualMember()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 要查询的家庭ID
memberId String 虚拟成员用户中心id
memberName String 成员名称
avatarUrl String 成员头像地址
isCreater String 是否创建者
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
正确返回 retData说明:

示例

调用方式

uplusapi.upFamilyModule.modifyVirtualMember({
  familyId: '12345678';
  memberId: '1234567';
  memberName: 'name';
  avatarUrl: 'url';
  isCreater: true;
}).then(res => console.log(res)).catch(err => console.log(err));
  • moveDevicesToFamily (批量转移设备到目标家庭)

    moveDevicesToFamily()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 设备所在家庭的家庭ID
newFamilyId String 设备转移的目标家庭的家庭ID
deviceIds Array 需转移的设备ID列表
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
110009 目标家庭不存在
110010 批量操作设备列表为空
正确返回 retData说明:
数据类型 说明
BatchProcessDeviceCollection 批量转移家庭结果集合
示例

调用方式

uplusapi.upFamilyModule.moveDevicesToFamily({
  familyId: "familyId",
  newFamilyId: "newFamilyId",
  deviceIds: ["deviceId"],
}).then(res => console.log(res)).catch(err => console.log(err));
  • unbindDeviceFromFamily (家庭批量解绑设备)

    unbindDeviceFromFamily()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 解绑设备所在的家庭ID
deviceIds Array 需解绑设备的ID列表
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
110010 批量操作设备列表为空
正确返回 retData说明:
数据类型 说明
BatchProcessDeviceCollection 批量解绑结果集合
示例

调用方式

uplusapi.upFamilyModule.unbindDeviceFromFamily({
  familyId: "familyId",
  deviceIds: ["deviceId"],
}).then(res => console.log(res)).catch(err => console.log(err));
  • removeDevicesFromFamily (家庭批量移除设备)

    removeDevicesFromFamily()
适用性
容器 Nebula
支持情况
APP版本 待确定
params 输入参数:
属性名 数据类型 是否必填 说明
familyId String 解绑设备所在的家庭ID
deviceIds Array 需解绑设备的ID列表
错误返回 retCode说明:
retCode编码 retInfo说明
900003 非法参数错误
110003 家庭不存在
110010 批量操作设备列表为空
正确返回 retData说明:
数据类型 说明
BatchProcessDeviceCollection 批量移除结果集合
示例

调用方式

uplusapi.upFamilyModule.removeDevicesFromFamily({
  familyId: "familyId",
  deviceIds: ["deviceId"],
}).then(res => console.log(res)).catch(err => console.log(err));

results matching ""

    No results matching ""