Ai
76 Star 670 Fork 290

ThingsPanel/thingspanel-backend-community

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
swagger.yaml 11.85 KB
一键复制 编辑 原始数据 按行查看 历史
路滑 提交于 2025-05-06 21:30 +08:00 . Feat:增加一型一密功能
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
definitions:
errcode.Error:
properties:
code:
type: integer
data: {}
message:
description: 用于存储自定义消息
type: string
type: object
model.AlarmDeviceCountsResponse:
properties:
alarm_device_total:
description: 告警设备数量
type: integer
type: object
model.DeviceAuthReq:
properties:
device_name:
description: 设备名称(可选)
maxLength: 255
type: string
device_number:
description: 设备唯一标识
maxLength: 255
type: string
product_key:
description: 产品密钥(可选,用于产品关联)
maxLength: 255
type: string
template_secret:
description: 模板密钥
maxLength: 255
type: string
required:
- device_number
- template_secret
type: object
model.DeviceAuthRes:
properties:
device_id:
description: 设备ID
type: string
voucher:
description: 设备凭证
type: string
type: object
model.LoginReq:
properties:
email:
description: 登录账号(输入邮箱或者手机号)
example: test@test.cn
type: string
password:
description: 密码
example: "123456"
maxLength: 512
minLength: 6
type: string
salt:
description: 随机盐(如果在超管设置了前端RSA加密则需要上送)
maxLength: 512
type: string
required:
- email
- password
type: object
model.LoginRsp:
properties:
expires_in:
description: 过期时间(单位:秒)
type: integer
token:
description: 登录凭证
type: string
type: object
response.Response:
properties:
code:
type: integer
data: {}
message:
type: string
type: object
host: localhost:9999
info:
contact: {}
description: ThingsPanel API.
title: ThingsPanel API
version: "1.0"
paths:
/api/v1/alarm/device/counts:
get:
consumes:
- application/json
description: 获取租户下不同告警状态的设备数量统计
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/model.AlarmDeviceCountsResponse'
summary: 获取租户下告警状态的设备数量
tags:
- 告警管理
/api/v1/attribute/datas/{id}:
delete:
responses: {}
get:
responses: {}
/api/v1/attribute/datas/set/logs:
get:
responses: {}
/api/v1/board:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/board/{id}:
delete:
responses: {}
get:
responses: {}
/api/v1/board/device:
get:
responses: {}
/api/v1/board/device/total:
get:
responses: {}
/api/v1/board/home:
get:
responses: {}
/api/v1/board/tenant:
get:
responses: {}
/api/v1/board/tenant/device/info:
get:
responses: {}
/api/v1/board/tenant/user/info:
get:
responses: {}
/api/v1/board/trend:
get:
responses: {}
/api/v1/board/user/info:
get:
responses: {}
/api/v1/board/user/update:
post:
responses: {}
/api/v1/board/user/update/password:
post:
responses: {}
/api/v1/casbin/function:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/casbin/function/{id}:
delete:
responses: {}
/api/v1/casbin/user:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/casbin/user/{id}:
delete:
responses: {}
/api/v1/command/datas/set/logs:
get:
responses: {}
/api/v1/data_script:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/data_script/{id}:
delete:
responses: {}
/api/v1/datapolicy:
get:
responses: {}
put:
responses: {}
/api/v1/device:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/device/{id}:
delete:
responses: {}
/api/v1/device/active:
put:
responses: {}
/api/v1/device/auth:
post:
consumes:
- application/json
description: 实现一型一密认证机制,设备通过此接口获取凭证
parameters:
- description: 认证请求参数
in: body
name: request
required: true
schema:
$ref: '#/definitions/model.DeviceAuthReq'
produces:
- application/json
responses:
"200":
description: 成功
schema:
$ref: '#/definitions/model.DeviceAuthRes'
"400":
description: 错误响应
schema:
$ref: '#/definitions/errcode.Error'
summary: 设备动态认证
tags:
- 设备认证
/api/v1/device/check/{deviceNumber}:
get:
responses: {}
tags:
- 设备管理
/api/v1/device/detail/{id}:
get:
responses: {}
/api/v1/device/group:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/device/group/{id}:
delete:
responses: {}
/api/v1/device/group/detail/{id}:
get:
responses: {}
/api/v1/device/group/relation:
delete:
responses: {}
get:
responses: {}
post:
responses: {}
/api/v1/device/group/relation/list:
get:
responses: {}
/api/v1/device/group/tree:
get:
responses: {}
/api/v1/device/online/status/ws:
get:
consumes:
- application/json
description: 通过WebSocket连接获取实时设备在线状态
produces:
- application/json
responses: {}
summary: 获取设备在线状态
tags:
- 设备
/api/v1/device/template:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/device/template/{id}:
delete:
responses: {}
/api/v1/device/template/chart:
get:
responses: {}
/api/v1/device/template/detail/{id}:
get:
responses: {}
/api/v1/device/template/menu:
get:
responses: {}
/api/v1/device_config:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/device_config/{id}:
delete:
responses: {}
get:
responses: {}
/api/v1/device_config/batch:
put:
responses: {}
/api/v1/device_config/menu:
get:
responses: {}
/api/v1/dict:
get:
responses: {}
/api/v1/dict/column:
post:
responses: {}
/api/v1/dict/column/{id}:
delete:
responses: {}
/api/v1/dict/enum:
get:
responses: {}
/api/v1/dict/language:
post:
responses: {}
/api/v1/dict/language/{id}:
delete:
responses: {}
get:
responses: {}
/api/v1/event/datas:
get:
responses: {}
/api/v1/file/up:
post:
responses: {}
tags:
- 文件上传
/api/v1/login:
post:
consumes:
- application/json
description: 认证令牌(Token)将在用户成功登录后生成并返回。客户端需要在后续所有需要认证的API请求中,将此令牌添加到HTTP请求头(Header)的'x-token'字段中。服务器将通过验证此令牌来确认用户身份并授权访问受保护资源。
parameters:
- description: 登录凭证
in: body
name: request
required: true
schema:
$ref: '#/definitions/model.LoginReq'
produces:
- application/json
responses:
"200":
description: 成功
schema:
$ref: '#/definitions/model.LoginRsp'
"400":
description: 错误响应
schema:
$ref: '#/definitions/errcode.Error'
summary: 用户登录
tags:
- 用户认证
/api/v1/logo:
get:
responses: {}
put:
responses: {}
/api/v1/notification/services/config:
post:
responses: {}
/api/v1/notification/services/config/{type}:
get:
responses: {}
/api/v1/notification/services/config/e-mail/test:
post:
responses: {}
/api/v1/notification_group:
post:
responses: {}
/api/v1/notification_group/{id}:
delete:
responses: {}
get:
responses: {}
put:
responses: {}
/api/v1/notification_group/list:
get:
responses: {}
/api/v1/notification_history/list:
get:
responses: {}
/api/v1/open/keys:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/open/keys/{id}:
delete:
responses: {}
/api/v1/operation_logs:
get:
responses: {}
/api/v1/ota/package:
get:
responses: {}
post:
responses: {}
/api/v1/ota/package/:
put:
responses: {}
/api/v1/ota/package/{id}:
delete:
responses: {}
/api/v1/ota/task:
get:
responses: {}
post:
responses: {}
/api/v1/ota/task/{id}:
delete:
responses: {}
/api/v1/ota/task/detail:
get:
responses: {}
put:
responses: {}
/api/v1/protocol_plugin:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/protocol_plugin/{id}:
delete:
responses: {}
/api/v1/protocol_plugin/config_form:
get:
responses: {}
/api/v1/protocol_plugin/device_config_form:
get:
responses: {}
/api/v1/role:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/role/{id}:
delete:
responses: {}
/api/v1/system/metrics/current:
get:
consumes:
- application/json
description: 获取系统CPU、内存、磁盘使用率的当前值
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
summary: 获取当前系统指标
tags:
- 系统监控
/api/v1/system/metrics/history:
get:
consumes:
- application/json
description: 获取系统CPU、内存、磁盘使用率的历史数据
parameters:
- default: 24
description: 查询小时数,默认24小时
in: query
name: hours
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
summary: 获取系统指标历史数据
tags:
- 系统监控
/api/v1/telemetry/datas:
delete:
responses: {}
/api/v1/telemetry/datas/current/{id}:
get:
responses: {}
/api/v1/telemetry/datas/current/detail/{id}:
get:
responses: {}
/api/v1/telemetry/datas/current/keys:
get:
responses: {}
/api/v1/telemetry/datas/current/keys/ws:
get:
responses: {}
/api/v1/telemetry/datas/current/ws:
get:
responses: {}
/api/v1/telemetry/datas/history:
get:
responses: {}
/api/v1/telemetry/datas/history/page:
get:
responses: {}
/api/v1/telemetry/datas/history/pagination:
get:
responses: {}
/api/v1/telemetry/datas/set/logs:
get:
responses: {}
/api/v1/telemetry/datas/statistic:
get:
responses: {}
/api/v1/ui_elements:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/ui_elements/{id}:
delete:
responses: {}
/api/v1/ui_elements/menu:
get:
responses: {}
/api/v1/user:
get:
responses: {}
post:
responses: {}
put:
responses: {}
/api/v1/user/{id}:
delete:
responses: {}
get:
responses: {}
/api/v1/user/detail:
get:
responses: {}
/api/v1/user/tenant/id:
get:
responses: {}
/api/v1/user/update:
put:
responses: {}
schemes:
- http
securityDefinitions:
ApiKeyAuth:
in: header
name: x-token
type: apiKey
swagger: "2.0"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ThingsPanel/thingspanel-backend-community.git
git@gitee.com:ThingsPanel/thingspanel-backend-community.git
ThingsPanel
thingspanel-backend-community
thingspanel-backend-community
main

搜索帮助