图片管理
更新时间:2026-10-23 11:31:55
import { RTCXMsgPicGateway, RTCXPlaybackTypes } from 'rtcxsdk'
/**
* 根据图片ID批量获取图片存储地址
*
* @param params - [GetPictureReq]
* @public
*/
declare function getPictureById(params: GetPictureReq): Promise<GetPictureRsp>;
export declare namespace RTCXMsgPicGateway {
export {
getPictureById
}
}
批量根据图片ID获取图片地址
注意
本接口是批量接口,在可批量获取的场景下,请不要单个来请求,会影响平台服务
import { RTCXMsgPicGateway, RTCXPlaybackTypes } from 'rtcxsdk'
async function handleGetPictureById(iotId: string, pictureIdList: string[]) {
try {
const result = await RTCXMsgPicGateway.getPictureById({
iotId,
pictureIdList,
})
console.info(`查询成功,获取到 ${result.pictureList?.length || 0} 张图片`)
} catch (error) {
console.error('查询图片失败:', error)
}
}
请求对象 RTCXPlaybackTypes.GetPictureReq
/**
* 根据图片ID获取图片地址
* @public
*/
declare type GetPictureReq = {
/**
* 平台为设备颁发的ID,设备的唯一标识符。
*/
iotId: string;
/**
* 图片ID列表。最大500
*/
pictureIdList: string[];
/**
* 多目摄像头时候填写
*/
lensId?: number;
/**
* 不填或0:消息中心,1:事件中心
*/
datasource?: string;
};
返回对象 RTCXPlaybackTypes.GetPictureRsp
/**
* 批量获取图片返回
* @public
*/
declare type GetPictureRsp = {
pictureList: GetPictureRspItem[];
};
/**
* 图片信息
* @public
*/
declare type GetPictureRspItem = {
/**
* 图片地址
*/
pictureUrl: string;
/**
* 图片ID
*/
pictureId: string;
};