Ai
76 Star 670 Fork 290

ThingsPanel/thingspanel-backend-community

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docs.go 24.10 KB
一键复制 编辑 原始数据 按行查看 历史
路滑 提交于 2025-05-06 21:30 +08:00 . Feat:增加一型一密功能
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/alarm/device/counts": {
"get": {
"description": "获取租户下不同告警状态的设备数量统计",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"告警管理"
],
"summary": "获取租户下告警状态的设备数量",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.AlarmDeviceCountsResponse"
}
}
}
}
},
"/api/v1/attribute/datas/set/logs": {
"get": {
"responses": {}
}
},
"/api/v1/attribute/datas/{id}": {
"get": {
"responses": {}
},
"delete": {
"responses": {}
}
},
"/api/v1/board": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"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/board/{id}": {
"get": {
"responses": {}
},
"delete": {
"responses": {}
}
},
"/api/v1/casbin/function": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/casbin/function/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/casbin/user": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/casbin/user/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/command/datas/set/logs": {
"get": {
"responses": {}
}
},
"/api/v1/data_script": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/data_script/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/datapolicy": {
"get": {
"responses": {}
},
"put": {
"responses": {}
}
},
"/api/v1/device": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/device/active": {
"put": {
"responses": {}
}
},
"/api/v1/device/auth": {
"post": {
"description": "实现一型一密认证机制,设备通过此接口获取凭证",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"设备认证"
],
"summary": "设备动态认证",
"parameters": [
{
"description": "认证请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.DeviceAuthReq"
}
}
],
"responses": {
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/model.DeviceAuthRes"
}
},
"400": {
"description": "错误响应",
"schema": {
"$ref": "#/definitions/errcode.Error"
}
}
}
}
},
"/api/v1/device/check/{deviceNumber}": {
"get": {
"tags": [
"设备管理"
],
"responses": {}
}
},
"/api/v1/device/detail/{id}": {
"get": {
"responses": {}
}
},
"/api/v1/device/group": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/device/group/detail/{id}": {
"get": {
"responses": {}
}
},
"/api/v1/device/group/relation": {
"get": {
"responses": {}
},
"post": {
"responses": {}
},
"delete": {
"responses": {}
}
},
"/api/v1/device/group/relation/list": {
"get": {
"responses": {}
}
},
"/api/v1/device/group/tree": {
"get": {
"responses": {}
}
},
"/api/v1/device/group/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/device/online/status/ws": {
"get": {
"description": "通过WebSocket连接获取实时设备在线状态",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"设备"
],
"summary": "获取设备在线状态",
"responses": {}
}
},
"/api/v1/device/template": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"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/template/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/device/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/device_config": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/device_config/batch": {
"put": {
"responses": {}
}
},
"/api/v1/device_config/menu": {
"get": {
"responses": {}
}
},
"/api/v1/device_config/{id}": {
"get": {
"responses": {}
},
"delete": {
"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}": {
"get": {
"responses": {}
},
"delete": {
"responses": {}
}
},
"/api/v1/event/datas": {
"get": {
"responses": {}
}
},
"/api/v1/file/up": {
"post": {
"tags": [
"文件上传"
],
"responses": {}
}
},
"/api/v1/login": {
"post": {
"description": "认证令牌(Token)将在用户成功登录后生成并返回。客户端需要在后续所有需要认证的API请求中,将此令牌添加到HTTP请求头(Header)的'x-token'字段中。服务器将通过验证此令牌来确认用户身份并授权访问受保护资源。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"用户认证"
],
"summary": "用户登录",
"parameters": [
{
"description": "登录凭证",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.LoginReq"
}
}
],
"responses": {
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/model.LoginRsp"
}
},
"400": {
"description": "错误响应",
"schema": {
"$ref": "#/definitions/errcode.Error"
}
}
}
}
},
"/api/v1/logo": {
"get": {
"responses": {}
},
"put": {
"responses": {}
}
},
"/api/v1/notification/services/config": {
"post": {
"responses": {}
}
},
"/api/v1/notification/services/config/e-mail/test": {
"post": {
"responses": {}
}
},
"/api/v1/notification/services/config/{type}": {
"get": {
"responses": {}
}
},
"/api/v1/notification_group": {
"post": {
"responses": {}
}
},
"/api/v1/notification_group/list": {
"get": {
"responses": {}
}
},
"/api/v1/notification_group/{id}": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"delete": {
"responses": {}
}
},
"/api/v1/notification_history/list": {
"get": {
"responses": {}
}
},
"/api/v1/open/keys": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"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/detail": {
"get": {
"responses": {}
},
"put": {
"responses": {}
}
},
"/api/v1/ota/task/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/protocol_plugin": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/protocol_plugin/config_form": {
"get": {
"responses": {}
}
},
"/api/v1/protocol_plugin/device_config_form": {
"get": {
"responses": {}
}
},
"/api/v1/protocol_plugin/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/role": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/role/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/system/metrics/current": {
"get": {
"description": "获取系统CPU、内存、磁盘使用率的当前值",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"系统监控"
],
"summary": "获取当前系统指标",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/api/v1/system/metrics/history": {
"get": {
"description": "获取系统CPU、内存、磁盘使用率的历史数据",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"系统监控"
],
"summary": "获取系统指标历史数据",
"parameters": [
{
"type": "integer",
"default": 24,
"description": "查询小时数,默认24小时",
"name": "hours",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/api/v1/telemetry/datas": {
"delete": {
"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/current/{id}": {
"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": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/ui_elements/menu": {
"get": {
"responses": {}
}
},
"/api/v1/ui_elements/{id}": {
"delete": {
"responses": {}
}
},
"/api/v1/user": {
"get": {
"responses": {}
},
"put": {
"responses": {}
},
"post": {
"responses": {}
}
},
"/api/v1/user/detail": {
"get": {
"responses": {}
}
},
"/api/v1/user/tenant/id": {
"get": {
"responses": {}
}
},
"/api/v1/user/update": {
"put": {
"responses": {}
}
},
"/api/v1/user/{id}": {
"get": {
"responses": {}
},
"delete": {
"responses": {}
}
}
},
"definitions": {
"errcode.Error": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"message": {
"description": "用于存储自定义消息",
"type": "string"
}
}
},
"model.AlarmDeviceCountsResponse": {
"type": "object",
"properties": {
"alarm_device_total": {
"description": "告警设备数量",
"type": "integer"
}
}
},
"model.DeviceAuthReq": {
"type": "object",
"required": [
"device_number",
"template_secret"
],
"properties": {
"device_name": {
"description": "设备名称(可选)",
"type": "string",
"maxLength": 255
},
"device_number": {
"description": "设备唯一标识",
"type": "string",
"maxLength": 255
},
"product_key": {
"description": "产品密钥(可选,用于产品关联)",
"type": "string",
"maxLength": 255
},
"template_secret": {
"description": "模板密钥",
"type": "string",
"maxLength": 255
}
}
},
"model.DeviceAuthRes": {
"type": "object",
"properties": {
"device_id": {
"description": "设备ID",
"type": "string"
},
"voucher": {
"description": "设备凭证",
"type": "string"
}
}
},
"model.LoginReq": {
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"description": "登录账号(输入邮箱或者手机号)",
"type": "string",
"example": "test@test.cn"
},
"password": {
"description": "密码",
"type": "string",
"maxLength": 512,
"minLength": 6,
"example": "123456"
},
"salt": {
"description": "随机盐(如果在超管设置了前端RSA加密则需要上送)",
"type": "string",
"maxLength": 512
}
}
},
"model.LoginRsp": {
"type": "object",
"properties": {
"expires_in": {
"description": "过期时间(单位:秒)",
"type": "integer"
},
"token": {
"description": "登录凭证",
"type": "string"
}
}
},
"response.Response": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"message": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "x-token",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:9999",
BasePath: "",
Schemes: []string{"http"},
Title: "ThingsPanel API",
Description: "ThingsPanel API.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
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

搜索帮助