【乐吾乐大屏可视化组态编辑器】API接口文档(pgsql)

API接口文档(pgsql)

在线使用:https://v.le5le.com/ 

采用前后端分离架构,乐吾乐后端服务提供一整套完整的web组态编辑器的所有数据接口,包含2D/3D图纸接口服务、文件接口服务和用户接口服务等,安装包版本提供后端可执行程序文件,后端源码版提供Java源码。用户也可以自行按照接口文档去实现部分必要的接口,参考接口文档如下:

全局规则

默认:所有接口返回通过是否包含error字段来判断结果成功。

•调用调用成功:直接返回数据,不能包含error字段

// 例如:请求用户信息返回结构
{
  "id": 1,
  "username": "用户名"
}
•调用失败时,返回: { error: '错误原因'}

Copy

// 例如:请求用户信息返回结构
{
  "error": "请先登录",
 	"xxx": "其他可选自定义错误信息"
}

Copy

以下接口除非特殊说明都需要携带以下参数

名称 位置 类型 说明
Authorization header string 用户登录token

大屏接口列表

获取登录信息

URL:

/api/account/profile

Method:

GET

参数

无需多余参数

返回

名称 类型 必选 中文名
id string 用户id
account string 账户
avatarUrl string 头像url
username string 用户名
phone string
email string
teams [object] 团队
id string
name string
company object 公司
id string
name string
department object 部门
id string
name string
roles [string] 角色
inviteCode string 邀请码
wechat string 关联微信账号
github string 关联GitHub账号
sina string 关联新浪账号
vip integer 会员有效期截至时间
corporation object 企业
id string
name string
owner boolean
license string 营业执照

示例:

{
  "id": "44",
    "account": "enim dolor",
    "avatarUrl": "http://dummyimage.com/100x100",
    "username": "夏超",
    "phone": "18139363365",
    "email": "[email protected]",
    "teams": [
    {
      "id": "39",
      "name": "设反下门持"
    },
    {
      "id": "77",
      "name": "院装先口任年"
    },
    {
      "id": "76",
      "name": "研色问严"
    }
  ],
    "company": {
    "id": "31",
      "name": "来教元理但百"
  },
  "department": {
    "id": "94",
      "name": "的分上适传候"
  },
  "roles": [
    "in sit qui",
    "tempor in exercitation aliqua officia"
  ],
    "inviteCode": "32",
    "wechat": "aliqua ut aliquip in",
    "github": "ut aliquip",
    "sina": "consequat exercitation dolor cillum mollit",
    "vip": 1662364456
}

// 例如:请求用户信息返回结构
{
  error: '请先登录',
    xxx: '其他可选自定义错误信息'
}

Copy

新增大屏项目

URL:

/api/data/v/add

Method:

POST

Body

名称 位置 类型 必选 中文名 说明
name body string 数据项 none
image body string 缩略图地址
data body object 图纸数据
type body string 数据分类
case body string 应用场景
folder body string 所属文件夹

示例:

// 下面为通用大屏项目文件示例
{
    "data": {//图纸数据
        "x": 32,
        "y": 32,
        "scale": 1,
        "pens": [
          ...
        ],
        "origin": {
            "x": 0,
            "y": 0
        },
        "center": {
            "x": 0,
            "y": 0
        },
        "paths": {},
        "template": "5580654",
        "enableMock": true,
        "tags": [
            "方案"
        ],
        "scaleMode": "1",
        "groups": [],
        "iconUrls": [],
        "version": "1.0.23",
        "component": false
    },
    "image": "xxx",
    "name": "xxx",
    "folder": "xxx",
    "shared": true,
    "userFlag": 1 
}

Copy

返回

应包含新增大屏文件时,所有数据

// 下面为通用大屏文件示例
{
  "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
  "name": "新建项目",
  "image": "xxx",
  "data": {...},
  "shared": true,
  "userFlag": 1,
  "folder": "新建文件夹",
  "ownerId": "xxx",
  "ownerName": "xxx",
  "createdAt": "2021-01-17T17:56:55.41911+08:00",
  "updatedAt": "2021-01-17T17:56:55.41911+08:00"
}

Copy

更新大屏项目

URL:

/api/data/v/update

Method:

POST

Body

名称 位置 类型 必选 中文名 说明
id body string 数据Id none
name body string 数据项 none
image body string 缩略图地址
data body object 图纸数据
type body string 数据分类
case body string 应用场景

示例:

// 相对完整的更新示例
{
    "id": "xxx",
    "data": {
        "x": 32,
        "y": 32,
        "scale": 1,
        "pens": [
            ...
        ],
        "origin": {
            "x": 0,
            "y": 0
        },
        "center": {
            "x": 0,
            "y": 0
        },
        "paths": {},
        "template": "186fe58c",
        "tags": [
            "方案"
        ],
        "groups": [],
        "version": "1.0.23",
        "iconUrls": [],
        "component": false,
        "scaleMode": "1",
        "enableMock": true,
    },
    "image": "xxx",
    "name": "xxx",
    "folder": "xxx",
    "shared": true,
    "userFlag": 1 //1 - 用户方案 2 - 用户模板
}

Copy

返回

应包含新增大屏文件时,所有数据

// 下面为通用大屏文件示例
{
  "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
  "name": "新建项目",
  "image": "xxx",
  "data": {...},
  "shared": true,
  "userFlag": 1,
  "folder": "新建文件夹",
  "ownerId": "xxx",
  "ownerName": "xxx",
  "createdAt": "2021-01-17T17:56:55.41911+08:00",
  "updatedAt": "2021-01-17T17:56:55.41911+08:00"
}

Copy

获取大屏项目

URL:

/api/data/v/get

Method:

POST

Body

名称 位置 类型 必选 中文名 说明
id body string none
projection body string 返回字段 英文逗号分隔,例如:id,name,data

示例:

{
  "id": "xxx"
}

Copy

返回

应包含新增大屏文件时,所有数据

// 下面为通用大屏文件示例
{
    "id": "xxx",
    "name": "xxx",
    "image": "xxx",
    "data": {
        "x": 32,
        "y": 32,
        "pens": [
            ...
        ],
        "tags": [
            "模板"
        ],
        "paths": {},
        "scale": 1,
        "center": {
            "x": 0,
            "y": 0
        },
        "groups": [],
        "origin": {
            "x": 0,
            "y": 0
        },
        "version": "1.0.23",
        "iconUrls": [],
        "template": "2830eac2",
        "component": false,
        "scaleMode": "1",
        "enableMock": true
    },
    "shared": true,
    "folder": "xxx",
    "teams": [],
    "ownerId": "xxx",
    "ownerName": "xxx",
    "updatedAt": "2021-01-17T17:56:55.41911+08:00"
}

Copy

删除大屏项目

URL:

/api/data/v/delete

Method:

POST

Body

{
  "id": "大屏项目id"
}

Copy

返回

没有特别要求,参考全局规则。

获取大屏项目列表

URL:

/api/data/v/list

Method:

POST

Query

{
  current: 1,
  pageSize: 1000,
}

Copy

Body

名称 位置 类型 必选 中文名 说明
name body string 模糊查询name属性 none
folder body string 所属文件夹 none
systemFlag body integer 系统标识 1 - 系统方案 2 - 系统模板。请求公共解决方案(非个人)时,必传
userFlag body integer 用户标识 1 - 用户方案 2 - 用户模板
ownerId body string 创建者ID none
ownerName body string 创建者名称 none
departmentId body string 部门ID none
teamId body string 团队ID none
createdStart body integer 创建时间起始点 none
createdEnd body integer 创建时间截至点 none
shared body boolean false - 未分享 true - 分享 ,不传 - 全部
sort body object none
key body integer 排序字段名 > 0 升序,其他 降序
projection body string 返回字段 英文逗号分隔,例如:id,name,data

示例:

{
  "userFlag": "1"
  "projection":"id,name,image..."//返回字段,不传默认返回所有字段
}

Copy

返回

// 下面为通用大屏文件示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
          "name": "新建项目",
          "image": "xxx",
          "shared": true,
          "userFlag": 1,
          "folder": "新建文件夹",
          "ownerId": "xxx",
          "ownerName": "xxx",
          "createdAt": "2021-01-17T17:56:55.41911+08:00",
          "updatedAt": "2021-01-17T17:56:55.41911+08:00"
      },
      ...
    ]
}

Copy

新增大屏组件

URL:

/api/data/v.component/add

Method:

POST

Body

同“大屏接口列表” - “新增大屏项目”,仅用户组件和系统组件标识不同,详见下方示例

// 下面为通用示例
{
    "data": {
        "x": 32,
        "y": 32,
        "scale": 1,
        "pens": [
            ...
        ],
        "origin": {
            "x": 0,
            "y": 0
        },
        "center": {
            "x": 0,
            "y": 0
        },
        "paths": {},
        "template": "c3e2009",
        "enableMock": true,
        "tags": [
            "组件"
        ],
        "scaleMode": "1",
        "groups": [],
        "iconUrls": [],
        "component": true,
        "version": "1.0.23",
        "componentDatas": [
        	...
        ]
    },
    "image": "xxx",
    "name": "xxx",
    "folder": "xxx",
    "shared": true,
    "userFlag": 1//用户组件
    //"systemFlag":1//系统组件
}

Copy

返回

应包含新增大屏文件时的数据

// 下面为通用大屏文件示例
{
    "id": "018d16e5-9223-7539-bc58-f35a2e20ee8b",
    "name": "新建项目",
    "image": "xxx",
    "data": {
      ...
    },
    "shared": true,
    "userFlag": 1,
    "folder": "新建文件夹",
    "ownerId": "xxx",
    "ownerName": "xx",
    "editorId": "xxx",
    "editorName": "xx",
    "createdAt": "2023-01-17T10:09:20.419817181Z",
    "updatedAt": "2023-01-17T10:09:20.419817181Z"
}

Copy

更新大屏组件

URL:

/api/data/v.component/update

Method:

POST

Body

同“大屏接口列表” - “更新大屏项目”,仅用户组件和系统组件标识不同,详见下方示例

// 下面为通用示例
{
    "data": {
        "x": 32,
        "y": 32,
        "scale": 1,
        "pens": [
            ...
        ],
        "origin": {
            "x": 0,
            "y": 0
        },
        "center": {
            "x": 0,
            "y": 0
        },
        "paths": {},
        "template": "c3e2009",
        "enableMock": true,
        "tags": [
            "组件"
        ],
        "scaleMode": "1",
        "groups": [],
        "iconUrls": [],
        "component": true,
        "version": "1.0.23",
        "componentDatas": [
        	...
        ]
    },
    "image": "xxx",
    "name": "xxx",
    "folder": "xxx",
    "shared": true,
    "userFlag": 1//用户组件
    //"systemFlag":1//系统组件
}

Copy

返回

应包含新增大屏文件时,所有数据

// 下面为通用大屏文件示例
{
    "id": "018d16e5-9223-7539-bc58-f35a2e20ee8b",
    "name": "新建项目",
    "image": "xxx",
    "data": {
      ...
    },
    "shared": true,
    "userFlag": 1,
    "folder": "新建文件夹",
    "ownerId": "xxx",
    "ownerName": "xx",
    "editorId": "xxx",
    "editorName": "xx",
    "createdAt": "2023-01-17T10:09:20.419817181Z",
    "updatedAt": "2023-01-17T10:09:20.419817181Z"
}

Copy

获取大屏组件

URL:

/api/data/v.component/get

Method:

POST

Body

{
  "id": "大屏组件id"
}

Copy

返回

应包含新增大屏文件时,所有数据

// 下面为通用示例
{
    "id": "018d16e5-9223-7539-bc58-f35a2e20ee8b",
    "name": "新建项目",
    "image": "xxx",
    "data": {…},
    "shared": true,
    "userFlag": 1,
    "folder": "新建文件夹",
    "ownerId": "xxx",
    "ownerName": "xx",
    "editorId": "xxx",
    "editorName": "xx",
    "createdAt": "2023-01-17T10:09:20.419817181Z",
    "updatedAt": "2023-01-17T10:09:20.419817181Z"
}

Copy

删除大屏组件

URL:

/api/data/v.component/delete

Method:

POST

Body

{
  "id": "大屏组件id"
}

Copy

返回

没有特别要求,参考全局规则。

获取大屏组件列表

URL:

/api/data/v.component/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
  "userFlag": 1//用户组件
  //"systemFlag":1//系统组件
  "projection":"id,name,image..."//返回字段,不传默认返回所有字段
}

Copy

返回

{
  "total":3,
  "list":[
    {
      "id": "018d16e5-9223-7539-bc58-f35a2e20ee8b",
      "name": "新建项目",
      "image": "xxx",
      "shared": true,
      "userFlag": 1,
      "folder": "新建文件夹",
      "ownerId": "xxx",
      "ownerName": "xx",
      "editorId": "xxx",
      "editorName": "xx",
      "createdAt": "2023-01-17T10:09:20.419817181Z",
      "updatedAt": "2023-01-17T10:09:20.419817181Z"
    },
    ...
  ]
}

Copy

获取3D组件列表

URL:

/api/data/3d/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
  "projection":"id,name,image..."//返回字段,不传默认返回所有字段
}

Copy

返回

{
  "total":1,
  "list":[
    {
      "id": "018d16e5-9223-7539-bc58-f35a2e20ee8b",
      "name": "新建项目",
      "image": "xxx",
      "createdAt": "2023-01-17T10:09:20.419817181Z",
      "updatedAt": "2023-01-17T10:09:20.419817181Z"
    }
  ]
}

Copy

新建文件夹

URL:

/api/directory/add

Method:

POST

Body

{
    "fullpath": "/大屏/{case}/新建文件夹的名称"//case:方案|模板|组件|图片
  //示例:"fullpath": "/大屏/方案/新建文件夹"
}

Copy

返回

{
    "id": "018d16eb-8077-7252-89c9-aad43dd3d72f",//文件夹id
    "ownerId": "0182199f-42e0-70cd-809a-3a35b7e9b39d",//文件夹创建者id
    "fullpath": "/大屏/组件/新建文件夹",//文件夹完整路径
    "createdAt": "2024-01-17T10:15:49.111891848Z",
    "updatedAt": "0001-01-01T00:00:00Z"
}

Copy

更新文件夹

URL:

/api/directory/update

Method:

POST

Body

{
    "oldFullpath": "xxx",//旧文件夹
    "newFullpath": "xxx"//新文件夹
}

Copy

返回

无特别要求

删除文件夹

URL:

/api/directory/delete

Method:

POST

Body

{
    "fullpaths": [
        "/大屏/方案/新建文件夹"//待删除文件夹
    ],
    "physically": true//true-物理删除 false-逻辑删除
}

Copy

返回

无特别要求

获取文件夹列表

不超过16M的小文件,使用mongodb的二进制存储,非gridfs

URL:

/api/directory/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

{
    "fullpath": "/大屏/{case}"//case:方案|模板|组件|图片
}

Copy

返回

{
  "total":1,
  "list":[
    {
    	"id": "018d16eb-8077-7252-89c9-aad43dd3d72f",
      "ownerId": "0182199f-42e0-70cd-809a-3a35b7e9b39d",
      "fullpath": "/大屏/组件/新建文件夹",
      "createdAt": "2024-01-17T10:15:49.111891848Z",
      "updatedAt": "0001-01-01T00:00:00Z"
		}
  ]
}

Copy

上传图片

URL:

/api/image/upload

Method:

POST

FormData

•filename:string 文件名,可选

•shared:string 是否共享,默认为true

•conflict:string directory+name 如果存在,处理方式:默认不穿覆盖;new-自动重命名为一个新文件;其他-不做任何操作,返回报错

•file:Blob 文件二进制

•directory:string 文件存放文件夹,例如:'/2D/缩略图'

返回

{
    "id": "018d1b1f-eb0b-7ca5-9a31-56269e3095a6",
    "name": "test.png",//图片名称自动获取
    "fullname": "/2021/0118/1/1/3d5_4680f5a0.png",//图片完整文件名
    "url": "/2021/0118/1/1/3d5_4680f5a0.png",//图片路径
    "directory": "/大屏/图片/新建文件夹",//图片所在文件夹
    "shared": true,
    "size": 1871165,
    "ownerId": "xxx",
    "ownerName": "xxx",
    "createdAt": "2021-01-18T05:51:33.131708608Z",
    "updatedAt": "0001-01-01T00:00:00Z"
}

Copy

删除图片

URL:

/api/files/delete

Method:

POST

Body

{
    "fullnames": [
        "/2021/0118/1/1/3d5_4680f5a0.png"//图片返回的完整文件名
    ],
    "physically": true//true-物理删除 false-逻辑删除
}

Copy

返回

无特别要求

获取文件列表

URL:

/api/file/list

Method:

POST

Query

名称 类型 必选 说明
current string 当前页
pageSize string 每页记录数

Body

名称 类型 必选 说明
tag string none
shared boolean false - 未分享 true - 分享 ,不传 - 全部
type string none
name string none
directory string none
children boolean 包含所有子目录文件,联合directory使用
deleted integer 0 - 未删除, 1 - 删除 ,其他 - 全部
remarks string 备注
sort object 检索结果排序规则,大于0:升序;小于0:降序
{
  "tag": "string",
    "shared": true,
    "type": "string",
    "name": "string",
    "directory": "string",
    "children": true,
    "deleted": 0,
    "remarks": "string",
    "sort": {
    "owner_id":   1,
      "created_at": -1
  }
}

Copy

返回

{
  "total": 0,
    "list": [
    {
      "filename": "string",
      "metadata": {}
    }
  ]
}

Copy

获取素材或png、svg分组列表

用于获取远程指定类型(素材、图元(png、svg))的静态图片资源目录

URL:

/api/assets/folders

Method:

POST

Body

获取素材分组列表
{
  "path": "v/material" 
}
获取png分组列表
{
  "path": "png"  
}
获取svg分组列表
{
  "path": "svg" 
}

Copy

返回

{
  "list": [
    "常用图标",
    "智能家居",
    "标题",
    "电信机房",
    "装饰",
    "面板"
  ],
  "prefix": false,
  "total":6
}
或
{
  "list": [
    "v/material/常用图标/",
    "v/material/智能家居/",
    "v/material/标题/",
    "v/material/电信机房/",
    "v/material/装饰/",
    "v/material/面板/"
  ],
  "prefix": true,
  "total":6
}

Copy

获取素材或png、svg文件列表

用于获取远程指定类型(素材、图元(png、svg))的静态图片资源文件列表

URL:

/api/assets/files

Method:

POST

Body

获取素材分组列表
{
  "path": "v/material" 
}
获取png分组列表
{
  "path": "png"  
}
获取svg分组列表
{
  "path": "svg" 
}

Copy

返回

{
  "list": [
    "v/material/常用图标/地图标注.svg",
    "v/material/智能家居/太阳能板温度.png",
    "v/material/智能家居/指标.png",
  ],
    "prefix": true,
    "total":3
}
//或者
{
    "total": 2,
    "list": [
        "png/2.5D-采暖系统",
        "png/2.5D-制冷站"
    ],
    "prefix": true
}

Copy

新增数据源

URL:

/api/data/datasources/add

Method:

POST

Body

不同类型,数据结构不一样,建议为文档类型

// 订阅实时数据类型 
{
    "name": "xxx",
    "type": "subscribe",
    "data": {
        "protocol": "http",
        "url": "/xxx",
        "options": {
            "clientId": "",
            "username": "",
            "password": "",
            "customClientId": false
        },
        "httpTimeInterval": 1000,
        "headers": "",
        "method": "GET",
        "body": ""
    }
}

// 向后台发送类型 
{
    "name": "test",
    "data": {
        "body": "",
        "headers": "",
        "httpTimeInterval": 1000,
        "method": "GET",
        "options": {
            "clientId": "test",
            "customClientId": true,
            "password": "test",
            "username": "test"
        },
        "protocol": "mqtt",
        "topics": "test",
        "url": "/xxx"
    },
    "shared": false,
    "type": "publish",
    "createdAt": "2024-01-18T09:30:53.856752442Z",
    "updatedAt": "2024-01-18T09:30:53.856752442Z"
}
// 数据集类型
{
    "name": "test",
    "type": "dataset",
    "data": {
        "devices": [//数据集
            {
                "device": "设备1",
                "label": "整数0-100",
                "id": "data-001",
                "type": "integer",
                "mock": "0-100"
            }
        ],
        "mode": "",//数据方式,默认 api-HTTP请求,空字符串-自定义
        "url": ""//获取数据集的接口,
    }
}

Copy

返回

应包含新增时,所有数据

// 下面为通用示例
{
  "id": "018d16f2-55e5-743c-a498-0053afd9b219",
  "name": "test",
  "data": {
      "body": "",
      "headers": "",
      "httpTimeInterval": 1000,
      "method": "GET",
      "options": {
          "clientId": "",
          "customClientId": false,
          "password": "",
          "username": ""
      },
      "protocol": "http",
      "url": "/xxxx"
  },
  "shared": false,
  "type": "subscribe",
  "ownerId": "xxx",
  "ownerName": "xxx",
  "editorId": "xxx",
  "editorName": "xxx",
  "createdAt": "2024-01-17T10:23:16.965635509Z",
  "updatedAt": "2024-01-17T10:23:16.965635509Z"
}

Copy

更新数据源

URL:

/api/data/datasources/update

Method:

POST

Body

// 订阅实时数据类型 
{
  	"id": "018d1be8-bc20-756d-bf81-7f1218668059",
    "name": "xxx",
    "data": {
        "url": "/xxx",
        "body": "",
        "method": "GET",
        "headers": "",
        "options": {
            "clientId": "",
            "password": "",
            "username": "",
            "customClientId": false
        },
        "protocol": "http",
        "httpTimeInterval": 1000
    },
    "type": "subscribe",
}

// 向后台发送类型 
{
  	"id": "018d1be8-bc20-756d-bf81-7f1218668059",
    "type": "publish",
    "name": "xxx"
    "data": {
        "protocol": "http",
        "options": {
          "clientId": "",
          "password": "",
          "username": "",
          "customClientId": false
        },
        "httpTimeInterval": 1000,
        "headers": "",
        "method": "GET",
        "body": "",
        "url": "/xxx"
    },
}

// 数据集类型
{
  	"id": "018d1be8-bc20-756d-bf81-7f1218668059",
    "name": "test",
    "type": "dataset",
    "data": {
        "devices": [//数据集
            {
                "device": "设备1",
                "label": "整数0-100",
                "id": "data-001",
                "type": "integer",
                "mock": "0-100"
            }
        ],
        "mode": "",//数据方式,默认 api-HTTP请求,空字符串-自定义
        "url": ""//获取数据集的接口,
    }
}

Copy

返回

新增是配置的所有数据

// 下面为通用大屏文件示例
{
    "id": "018d16f2-55e5-743c-a498-0053afd9b219",
    "name": "test",
    "data": {
        "body": "",
        "headers": "",
        "httpTimeInterval": 1000,
        "method": "GET",
        "options": {
            "clientId": "",
            "customClientId": false,
            "password": "",
            "username": ""
        },
        "protocol": "http",
        "url": "/xxxx"
    },
    "shared": false,
    "type": "subscribe",
    "createdAt": "2024-01-17T10:23:16.965635509Z",
    "updatedAt": "2024-01-17T10:23:16.965635509Z"
}

Copy

获取数据源

URL:

/api/data/datasources/get

Method:

POST

Body

{
  "id": "数据源id"
}

Copy

返回

应包含新增时,所有数据

// 订阅实时数据类型 
{
    "id": "018d16f2-55e5-743c-a498-0053afd9b219",
    "name": "xxx",
    "data": {
        "url": "/xxx",
        "body": "",
        "method": "GET",
        "headers": "",
        "options": {
            "clientId": "",
            "password": "",
            "username": "",
            "customClientId": false
        },
        "protocol": "http",
        "httpTimeInterval": 1000
    },
      "createdAt": "2024-01-17T10:23:16.965635509Z",
    "updatedAt": "2024-01-17T10:23:16.965635509Z"
}

// 向后台发送类型 
{
    "id": "018d16f2-55e5-743c-a498-0053afd9b219",
    "name": "test",
    "data": {
        "body": "",
        "headers": "",
        "httpTimeInterval": 1000,
        "method": "GET",
        "options": {
            "clientId": "",
            "customClientId": false,
            "password": "",
            "username": ""
        },
        "protocol": "http",
        "url": "/xxxx"
    },
    "shared": false,
    "type": "subscribe",
    "createdAt": "2024-01-17T10:23:16.965635509Z",
    "updatedAt": "2024-01-17T10:23:16.965635509Z"
}

// 数据集类型
{
  	"id": "xxx",
    "name": "test",
    "data": {
        "devices": [//数据集
            {
                "device": "设备1",
                "label": "整数0-100",
                "id": "data-001",
                "type": "integer",
                "mock": "0-100"
            }
        ],
        "mode": "",//数据方式,默认 api-HTTP请求,空字符串-自定义
        "url": ""//获取数据集的接口,
    }
  "createdAt": "2024-01-17T10:23:16.965635509Z",
  "updatedAt": "2024-01-17T10:23:16.965635509Z"
}

Copy

删除数据源

URL:

/api/data/datasources/delete

Method:

POST

Body

{
  "id": "数据源id"
}

Copy

返回

没有特别要求,参考全局规则。

后台管理接口列表

2D图纸列表

URL:

/api/data/2d/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
  "name": "文件名"// 模糊查询
}

Copy

返回

// 下面为通用文件列表示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
          "name": "新建项目",
          "image": "xxx",
          "shared": true,
          "userFlag": 1,
          "folder": "新建文件夹",
          "ownerId": "xxx",
          "ownerName": "xxx",
          "createdAt": "2021-01-17T17:56:55.41911+08:00",
          "updatedAt": "2021-01-17T17:56:55.41911+08:00"
        }
    ]
}

Copy

3D图纸列表

URL:

/api/data/3d/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
  "name": "文件名"// 模糊查询
}

Copy

返回

// 下面为通用文件列表示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d1a96-2d16-7094-b298-fbaee854be36",
          "name": "测试",
          "image": "/2021/0118/1/1/7aa4853c-b93f-4272-96f5-42d8c0e0a189_c1a9dede.png",
          "shared": false,
          "ownerId": "xxx",
          "ownerName": "xxx",
          "createdAt": "2021-01-18T11:21:06.070895+08:00",
          "updatedAt": "2021-01-18T11:21:06.070895+08:00"
      }
    ]
}

Copy

大屏项目列表

URL:

/api/data/v/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
    "name": "文件名"// 模糊查询
}

Copy

返回

// 下面为通用大屏文件示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
          "name": "新建项目",
          "image": "xxx",
          "shared": true,
          "userFlag": 1,
          "folder": "新建文件夹",
          "ownerId": "xxx",
          "ownerName": "xxx",
          "createdAt": "2021-01-17T17:56:55.41911+08:00",
          "updatedAt": "2021-01-17T17:56:55.41911+08:00"
      },
      ...
    ]
}

Copy

更新大屏项目

同“大屏接口列表” - “更新大屏项目”

用户列表

URL:

/api/operation/account/list

Method:

POST

Query

名称 类型 必选 说明
current string 当前页
pageSize string 每页记录数
q string 模糊搜索用户
department string 部门id
team string 团队id

示例:

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

{
  "q": "模糊查询,支持用户名、邮箱、手机号等多字段同时模糊查询"
}

Copy

返回

名称 类型 必选 中文名
total number true 总数
list [object] true 用户信息列表

用户信息:

名称 类型 必选 中文名
id string 用户id
account string 账户
avatarUrl string 头像url
username string 用户名
phone string
email string
teams [object] 团队
id string
name string
company object 公司
id string
name string
department object 部门
id string
name string
roles [string] 角色
inviteCode string 邀请码
wechat string 关联微信账号
github string 关联GitHub账号
sina string 关联新浪账号
vip integer 会员有效期截至时间
corporation object 企业
id string
name string
owner boolean
license string 营业执照
{
  "total":3,
  "list":[
    {
      "id": "xxx",
      "createdAt": "xxx",
      "department": {
          "id": "666666666666666666666666",
          "name": "乐吾乐科技"
      },
      "email": "",
      "phone": "xxxxxxx",
      "roles": [
          "系统管理员",
          "运营管理员"
      ],
      "teams": [],
      "username": "Alsmile",
    }
  ]
}

Copy

更新用户信息

URL:

/api/operation/account/update

Method:

POST

Body

同“大屏接口列表” - “用户列表”返回的用户信息字段

{
  "id": "xxx"
  "xxx": "其他可选"
}

Copy

返回

{
  "id": "xxx",  
  "xxx": "其他可选"
}

Copy

获取用户头像

URL:

/api/account/avatar/{id}

Method:

GET

Params

名称 类型 必选 说明
id string 用户id

返回

头像文件的二进制内容

获取用户统计信息

URL:

/api/account/statistics

Method:

GET

参数

不需要额外参数

返回

名称 类型 必选 中文名 说明
userId string 用户ID none
used integer 已使用云盘空间容量 none
capacity integer 可使用云盘空间容量 none
expired string 云盘空间容量到期时间 none
VipDataLimit object 允许保存数据最大个数 VIP会员用户允许保存数据(2D,3D,大屏)最大个数,普通用户返回免费个数。
VipDataCount object 实际保存数据个数 实际已经保存数据(2D,3D,大屏)个数
DeploymentPackageLimit object 允许下载离线部署包的次数 大屏、3D、2D
DeploymentPackageCount object 已经使用的下载离线部署包次数 none
{
  "userId": "01890b98-2a48-70d0-8002-c2db3cf46b85",
  "used": 26723050,
  "capacity": 10,
  "expired": "2025-10-23T11:28:36.574333+08:00",
  "vipDataLimit": {
    "2d": 1000,
    "3d": 1000,
    "v": 1000
  },
  "vipDataCount": {
    "2d": 17,
    "v": 2
  },
  "deploymentPackageLimit": {
    "2d": 5
  },
  "deploymentPackageCount": {
    "2d": 1
  }
}

Copy

获取统计信息

URL:

/api/operation/statistics

Method:

POST

参数

不需要额外参数

返回

名称 类型 必选 中文名
accountCount number 注册用户总数
vipCount number 有效VIP用户总数:截止当前查询时间点,还没有过期的VIP用户总数
orderCount number 非取消状态的订单总数
total2d number 2D图纸数据总数(不包含2D组件)
last302d number 创建时间为最近30天的2D图纸数据总数(不包含2D组件)
last602d number 创建时间为最近60天的2D图纸数据总数(不包含2D组件)
total3d number 同上(不包含组件)
last303d number 同上(不包含组件)
last603d number 同上(不包含组件)
totalV number 同上(不包含组件)
last30V number 同上(不包含组件)
last60V number 同上(不包含组件)
aggregationSignup [object] 近10天,每天的注册账号数。
aggregationVip [object] 近10天,每天的充值VIP会员数。(订单状态是完成的订单)
aggregationCloud [object] 近10天,每天的充值云盘会员数。(订单状态是完成的订单)
aggregation2d [string] 近10天,每天的2D数据创建数。(不包含组件)
aggregation3d [object] 近10天,每天的3D数据创建数。(不包含组件)
aggregationV [object] 近10天,每天的大屏数据创建数。(不包含组件)

示例

{
    "accountCount": 18660,
    "vipCount": 100,
    "orderCount": 236,
    "total2d": 24776,
    "last302d": 33,
    "last602d": 33,
    "total3d": 545,
    "last303d": 16,
    "last603d": 70,
    "totalV": 199,
    "last30V": 18,
    "last60V": 34,
    "aggregationSignup": [
        {
            "count": 2,
            "date": "2024-01-04T00:00:00-05:00"
        }
    ],
    "aggregationVip": [
        {
            "count": 2,
            "date": "2024-01-09T00:00:00-05:00"
        },
        {
            "count": 7,
            "date": "2024-01-10T00:00:00-05:00"
        },
        {
            "count": 1,
            "date": "2024-01-11T00:00:00-05:00"
        }
    ],
    "aggregationCloud": null,
    "aggregation2d": [
        {
            "count": 5,
            "date": "2024-01-04T00:00:00-05:00"
        },
        {
            "count": 1,
            "date": "2024-01-08T00:00:00-05:00"
        },
        {
            "count": 1,
            "date": "2024-01-09T00:00:00-05:00"
        },
        {
            "count": 3,
            "date": "2024-01-10T00:00:00-05:00"
        },
        {
            "count": 6,
            "date": "2024-01-11T00:00:00-05:00"
        },
        {
            "count": 2,
            "date": "2024-01-12T00:00:00-05:00"
        }
    ],
    "aggregation3d": [
        {
            "count": 1,
            "date": "2024-01-03T00:00:00-05:00"
        },
        {
            "count": 3,
            "date": "2024-01-08T00:00:00-05:00"
        },
        {
            "count": 1,
            "date": "2024-01-10T00:00:00-05:00"
        }
    ],
    "aggregationV": [
        {
            "count": 3,
            "date": "2024-01-07T00:00:00-05:00"
        },
        {
            "count": 6,
            "date": "2024-01-10T00:00:00-05:00"
        },
        {
            "count": 2,
            "date": "2024-01-12T00:00:00-05:00"
        }
    ]
}

Copy

新建部门信息

URL:

/api/operation/department/create

Method:

POST

Body

名称 类型 必选 中文名
name string 名称
parentId string 父id
leader string 负责人

{
  "name": "名称",
  "parentId": "父部门ID",
  "leader":"xxx"
}

Copy

返回

{
  "id": "xxx",  
  "name": "名称",
  "parentId": "父部门ID",
  "leader":"xxx"
}

Copy

更新部门信息

URL:

/api/operation/department/update

Method:

POST

Body


{
  "name": "名称",
  "parentId": "父部门ID",
  "leader":"xxx"
}

Copy

返回

{
  "id": "xxx",  
  "name": "名称",
  "parentId": "父部门ID",
  "leader":"xxx"
}

Copy

删除部门

URL:

/api/operation/department/delete

Method:

POST

Body


{
   "id": "部门ID",
}

Copy

返回

无特别要求

获取部门列表

URL:

/api/account/departments

Method:

GET

Query

名称 类型 必选 说明
q string 部门名称,模糊查询
current string 当前页
pageSize string 每页记录数

返回

{
  "total": 1,
  "list": [
    {
      "id": "xxx",  
      "name": "名称",
      "parentId": "父部门ID",
      "leader":"xxx"
    }
  ]
}

Copy

获取企业信息文件内容

URL:

/api/enterprise

Method:

GET

参数

无需多余参数

返回

{
  "helps": [
    {
      "name": "产品介绍",
      "url": "https://doc.le5le.com/document/118756411"
    },
    {
      "name": "快速上手",
      "url": "https://doc.le5le.com/document/119363000"
    },
    {
      "name": "使用手册",
      "url": "https://doc.le5le.com/document/118764244"
    },
    {
      "divider": true,
      "name": "快捷键",
      "url": "https://doc.le5le.com/document/119620214"
    },
    {
      "divider": true,
      "name": "企业服务与支持",
      "url": "https://doc.le5le.com/document/119296274"
    },
    {
      "name": "关于我们",
      "url": "https://le5le.com/about.html"
    }
  ],
  "home": "https://le5le.com",
  "name": "乐吾乐"
}

Copy

用户中心接口列表

2D图纸列表

URL:

/api/data/2d/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
  "name": "文件名",// 模糊查询
  "teamId":""//团队id,可不传
}

Copy

返回

// 下面为通用文件列表示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
          "name": "新建项目",
          "image": "xxx",
          "shared": true,
          "userFlag": 1,
          "folder": "新建文件夹",
          "ownerId": "xxx",
          "ownerName": "xxx",
          "createdAt": "2021-01-17T17:56:55.41911+08:00",
          "updatedAt": "2021-01-17T17:56:55.41911+08:00"
        }
    ]
}

Copy

3D图纸列表

URL:

/api/data/3d/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
  "name": "文件名",// 模糊查询
  "teamId":""//团队id,可不传
}

Copy

返回

// 下面为通用文件列表示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d1a96-2d16-7094-b298-fbaee854be36",
          "name": "测试",
          "image": "/2021/0118/1/1/7aa4853c-b93f-4272-96f5-42d8c0e0a189_c1a9dede.png",
          "shared": false,
          "ownerId": "xxx",
          "ownerName": "xxx",
          "case":"",//场景
          "createdAt": "2021-01-18T11:21:06.070895+08:00",
          "updatedAt": "2021-01-18T11:21:06.070895+08:00"
      }
    ]
}

Copy

大屏项目列表

URL:

/api/data/v/list

Method:

POST

Query

{
  "current": 1,//当前第几页,默认1
  "pageSize": 1000,//每页记录数,默认10
}

Copy

Body

同“大屏接口列表” - “获取大屏项目列表”

示例:

{
    "name": "文件名"// 模糊查询
    "teamId":""//团队id,可不传
}

Copy

返回

// 下面为通用大屏文件示例
{
    "total": 1,//总共项目数
    "list": [
        {
          "id": "018d16da-33fb-7f5b-80e8-0e3c32c23983",
          "name": "新建项目",
          "image": "xxx",
          "shared": true,
          "userFlag": 1,
          "folder": "新建文件夹",
          "ownerId": "xxx",
          "ownerName": "xxx",
          "createdAt": "2021-01-17T17:56:55.41911+08:00",
          "updatedAt": "2021-01-17T17:56:55.41911+08:00"
      },
      ...
    ]
}

Copy

获取消息列表

URL:

/api/message/list

Method:

POST

Params:

•current 当前页

•pageSize 每页请求数量

Body:

{
    "q": "",//模糊查询
    "read": false //是否已读  undefind全部消息 true已读消息 fasle未读消息
}

Copy

返回:

{
    "list": [
        {
            "id": "", //id
            "title": "a", //标题
            "html": "a", //内容
            "to": null, //接收方用户id
            "from": null,  //发送方用户id
            "data": null, //数据
            "read": null, //是否已读
            "createdAt": "2023-09-14T09:59:33.845377+08:00",
            "deletedAt": null
        }
      //...
    ],
    "total": 2
}

Copy

获取未读消息数量

URL:

/api/message/unread/count

Method:

POST

返回:

{
    "unread": 1 //未读数量
}

Copy

消息标为已读

URL:

/api/message/read

Method:

POST

Body:

{
    "ids": [
        "" //消息id列表
    ]
}

Copy

返回:

{}

全部消息标为已读

URL:

/api/message/read/all

Method:

POST

Body:

{}

返回:

{}

删除消息

URL:

/api/message/delete

Method:

POST

Body:

{
    "ids": [ //消息id列表
        ""
    ]
}

Copy

返回:

{}

获取团队列表

URL:

/api/account/teams

Method:

GET

返回:

{
    "list": [
        {
            "id": "018615fb-1188-70b5-8063-534123f564e3",
            "name": "zzz",
            "avatarUrl": "",
            "description": "测试",
            "ownerId": "0178f286-96d0-70cd-809a-3a16f96435e1",
            "inviteLink": null,
            "inviteExpiration": null,
            "inviteApprove": null,
            "createdAt": "0001-01-01T00:00:00Z",
            "isAdmin": 10
        }
      //...
    ],
    "total": 1
}

Copy

获取团队成员

URL:

/api/account/team/members

Method:

POST

Params:

•current 当前页

•pageSize 每页数量

Body:

{
  teamId:""//团队id
}

Copy

返回:

{
    "list": [
        {
            "teamId": "",
            "userId": "用户id",
            "username": "",//用户名
            "isAdmin": 10, //管理员权限, 10 创建者(管理员) 1管理员 0普通用户
            "pending": false,
            "createdAt": null
        },
        //...
    ],
    "total": 2
}

Copy

更新团队成员管理权限

URL:

/api/account/team/admin

Method:

POST

Body:

{
  "teamId": "", //团队id
  "userId": "",//团队成员id
  "isAdmin": 1 //权限
}

Copy

返回:

{
  "teamId": "", //团队id
  "userId": "",//团队成员id
  "isAdmin": 1 //权限
}

Copy

移除团队成员

URL:

/api/account/team/member/delete

Method:

POST

Body:

{
  "teamId": "", //团队id
  "userId": "",//团队成员id
}

Copy

返回:

{}

创建团队

URL:

/api/account/team/create

Method:

POST

Body:

{
    "show": true,
    "files": [],
    "avatarUrl": "",//头像
    "name": "",//部门名称
    "saving": true,
    "description": "" //部门描述
}

Copy

返回:

{
    "id": "", //团队id
    "name": "",
    "avatarUrl": "",
    "description": "",
    "ownerId": "0178f286-96d0-70cd-809a-3a16f96435e1",
    "inviteLink": null,
    "inviteExpiration": null,
    "inviteApprove": null,
    "createdAt": "2024-01-29T09:37:05.565137203Z",
    "isAdmin": null
}

Copy

删除团队

URL:

/api/account/team/delete

Method:

POST

Body:

{
    "id": "" //团队id
}

Copy

返回:

{}

更新团队信息

URL:

/api/account/team/update

Method:

POST

Body:

{
    "id": "", //团队id 必传
    "avatarUrl":"",//
    "description":"",//团队描述
    "name":"",//团队名称
    "inviteLink": true,//允许通过邀请链接加入
    "inviteApprove": true,//邀请链接加入规则,true表示需要管理员审核
    "inviteExpiration": ""//邀请链接有效期
     //... 改什么传什么
}

Copy

返回:

{
  id:""//团队id
}

Copy

查找账号

URL:

/api/account/find

Method:

POST

Body:

{
  account: ""//账号
}

Copy

返回:

{
    "id": "",//用户id
    "username": "", //用户名
    "createdAt": "0001-01-01T00:00:00Z",
    "updatedAt": "0001-01-01T00:00:00Z"
}

Copy

团队邀请人员

URL:

/api/account/team/invite

Method:

POST

Body:

{
    "teamId": "", //团队id
    "teamName": "",//团队名称
    "memberId": "",//被邀请成员id
    "memberName": ""//被邀请成员用户名
}

Copy

返回:

{}

获取账号信息

URL:

/api/account/detail

Method:

POST

返回:

{
    "id": "",
    "phone": "",
    "username": "",
    "avatarUrl":"",//头像地址
    "roles": [],//角色
    "departmentId": "",//部门id
    "departmentName": "", //部门名称
    // "vip": "2027-06-02T09:28:34.053+08:0",//vip到期时间
    // "vipData": { //vip可存图纸数量
    //     "2d": 2000,
    //     "3d": 2000,
    //     "v": 2000
    // },
    "teamList": [
        {
            "id": "",//团队id
            "name": "" //团队名称
        },
        //...
    ],
    "createdAt": "",
    "updatedAt": ""
}

Copy

更新账号信息

URL:

/api/account/profile/update

Method:

POST

BODY:

{
  avatarUrl:""//改什么传什么,例如改头像
}

Copy

返回:

{}

上传头像

URL:

/api/image/upload

Method:

POST

FormData

•file:Blob 文件二进制

•directory:string 文件存放文件夹,'/头像'

返回

{
    "id": "",
    "name": "test.png",//图片名称自动获取
    "fullname": "",//图片完整文件名
    "url": "",//图片路径
    "directory": "/头像",//图片所在文件夹
    "shared": true,
    "size": 1871165,
    "ownerId": "xxx",
    "ownerName": "xxx",
    "createdAt": "2021-01-18T05:51:33.131708608Z",
    "updatedAt": "0001-01-01T00:00:00Z"
}

Copy

更新登录账号

URL:

/api/account/account/update

Method:

POST

BODY:

{
    "account": ""//登录账号
}

Copy

返回: {}

更新邮箱

URL:

/api/account/email/update

Method:

POST

Body:

{
    "show": true,
    "email": "",//邮箱
    "code": "",//动态验证码
    "captcha": ""//图形验证码
}

Copy

返回:

{}

获取图片验证码

URL:

/api/account/captcha?t=时间戳

Method:

GET

返回:

图片资源地址

向邮箱发送动态验证码

URL:

/api/account/email/update

Method:

POST

Body:

{
    "email": "", //邮箱
    // "code": "", //图形验证码
    "type": "email" //类型
}

Copy

返回:

{}

修改密码

URL:

/api/account/password/update

Method:

POST

Body:

{
    "code": "",//当前密码
    "password": "" //新密码
}

Copy

返回:

{}

你可能感兴趣的:(2D可视化组态编辑器,编辑器,前端,流程图,开源,交互,数据可视化)