检查资源文件是否已存在

1.接口描述

接口说明:检查资源文件是否已存在。

请求方式:

  • 固件版本 V2.6.0 及以上:POST [ip]/mwapi/V2.0/source/check-source-exist
  • 固件版本 V2.5.0 及以下:POST [ip]/mwapi/check-source-exist
管理员权限 登录认证

2.输入参数

参数名称 必选 类型 描述
md5 String 文件MD5值,sourceType为 14 时为非必要参数
url String Url,仅在 sourceType 为 14 时生效
sourceType Int 资源类型
1:图片;2:视频;6:音乐;10:GFX;11:画面背景图;13:PDF;14:网页

3.输出参数

参数名称 类型 描述
result Int 状态码
message String 状态描述
info InfoData 资源存在状态信息
InfoData
参数名称 类型 描述
find Int 资源是否已存在
0:否;1:是
source SourceData 资源实体信息
SourceData
参数名称 类型 描述
duration Int 资源持续时间。仅视频音乐有效。
filePath String 资源文件相对路径。可通过http访问http://[设备IP]/file/相对路径
height Int 资源高度
homeUrl String 主页地址。仅网页有效
id Int 资源ID,资源在设备中的唯一身份标识。
md5 String 文件MD5值
name String 资源名称
rotation Int 旋转角度,逆时针方向,范围[0~360]
thumbHeight Int 资源缩略图高度
thumbWidth Int 资源缩略图宽度
thumbnailPath String 资源缩略图相对路径。可通过http访问http://[设备IP]/file/相对路径
type Int 资源类型
0:预置资源(采集+图片+视频)1:图片;2:视频;6:音乐;7:笔记背景图片;10:GFX图片;11:画面背景图片;12:画面背景色;13:PDF 文件;14:网页
url String 网页地址。仅网页有效
width Int 资源宽度

4.示例

检查图片文件是否已存在。

输入示例
{
    "md5": "asdfghjklkjhgfdsdfghjk",
    "sourceType": 1
}
输出示例
{
    "info": {
        "find": 1,
        "source": {
            "duration": 0,
            "filePath": "2009/2009.JPG",
            "height": 1080,
            "id": 2009,
            "md5": "f7e7f0cd578a44c77aed69e7c147d676",
            "name": "IMG_3010",
            "rotation": 0,
            "secondaryType": 0,
            "thumbHeight": 144,
            "thumbWidth": 256,
            "thumbnailPath": "2009/2009.thumb.jpeg",
            "type": 1,
            "width": 1920,
            "url": ""
        }
    },
    "message": "success",
    "result": 0
}

5.错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 定义 说明
7 MW_STATUS_INVALID_ARG 参数缺失
29 MW_STATUS_NO_SPACE 磁盘空间不足

与“”相关结果约

    找不到与“”相关的结果