2025-09-12 16:58:39 +08:00
|
|
|
|
// 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}}",
|
2025-09-12 20:32:29 +08:00
|
|
|
|
"contact": {},
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"version": "{{.Version}}"
|
|
|
|
|
|
},
|
|
|
|
|
|
"host": "{{.Host}}",
|
|
|
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
|
|
|
"paths": {
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"/api/v1/area-controllers": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "获取系统中所有区域主控的列表",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"区域主控管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取所有区域主控列表",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/device.AreaControllerResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "根据提供的信息创建一个新区域主控",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"区域主控管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "创建新区域主控",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "区域主控信息",
|
|
|
|
|
|
"name": "areaController",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/device.CreateAreaControllerRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/device.AreaControllerResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/area-controllers/{id}": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "根据ID获取单个区域主控的详细信息",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"区域主控管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取区域主控信息",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "区域主控ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/device.AreaControllerResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"description": "根据ID更新一个已存在的区域主控信息",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"区域主控管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "更新区域主控信息",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "区域主控ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "要更新的区域主控信息",
|
|
|
|
|
|
"name": "areaController",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/device.UpdateAreaControllerRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/device.AreaControllerResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"delete": {
|
|
|
|
|
|
"description": "根据ID删除一个区域主控(软删除)",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"区域主控管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "删除区域主控",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "区域主控ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-30 22:07:55 +08:00
|
|
|
|
"/api/v1/device-templates": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "获取系统中所有设备模板的列表",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备模板管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取设备模板列表",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/device.DeviceTemplateResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "根据提供的信息创建一个新设备模板",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备模板管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "创建新设备模板",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "设备模板信息",
|
|
|
|
|
|
"name": "deviceTemplate",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/device.CreateDeviceTemplateRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/device.DeviceTemplateResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/device-templates/{id}": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "根据设备模板ID获取单个设备模板的详细信息",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备模板管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取设备模板信息",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "设备模板ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/device.DeviceTemplateResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"description": "根据设备模板ID更新一个已存在的设备模板信息",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备模板管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "更新设备模板信息",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "设备模板ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "要更新的设备模板信息",
|
|
|
|
|
|
"name": "deviceTemplate",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/device.UpdateDeviceTemplateRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/device.DeviceTemplateResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"delete": {
|
|
|
|
|
|
"description": "根据设备模板ID删除一个设备模板(软删除)",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备模板管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "删除设备模板",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "设备模板ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/devices": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "获取系统中所有设备的列表",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取设备列表",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "OK",
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 17:43:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"post": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"description": "根据提供的信息创建一个新设备",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"设备管理"
|
2025-09-12 16:58:39 +08:00
|
|
|
|
],
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"summary": "创建新设备",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"description": "设备信息",
|
|
|
|
|
|
"name": "device",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"$ref": "#/definitions/device.CreateDeviceRequest"
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "OK",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
2025-09-12 17:43:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/devices/{id}": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "根据设备ID获取单个设备的详细信息",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取设备信息",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "设备ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "OK",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
2025-09-12 17:43:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"description": "根据设备ID更新一个已存在的设备信息",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "更新设备信息",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "设备ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
2025-09-12 16:58:39 +08:00
|
|
|
|
},
|
2025-09-12 17:43:42 +08:00
|
|
|
|
{
|
|
|
|
|
|
"description": "要更新的设备信息",
|
|
|
|
|
|
"name": "device",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/device.UpdateDeviceRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "OK",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
2025-09-12 17:43:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"delete": {
|
|
|
|
|
|
"description": "根据设备ID删除一个设备(软删除)",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"设备管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "删除设备",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "设备ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "OK",
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/plans": {
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "获取所有计划的列表",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取计划列表",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表成功获取列表",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.ListPlansResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "创建一个新的计划,包括其基本信息和所有关联的子计划/任务。",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "创建计划",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "计划信息",
|
|
|
|
|
|
"name": "plan",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.CreatePlanRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为201代表创建成功",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.PlanResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/plans/{id}": {
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "根据计划ID获取单个计划的详细信息。",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取计划详情",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "计划ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表成功获取",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.PlanResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"description": "根据计划ID更新计划的详细信息。",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "更新计划",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "计划ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "更新后的计划信息",
|
|
|
|
|
|
"name": "plan",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.UpdatePlanRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表更新成功",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.PlanResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"delete": {
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"description": "根据计划ID删除计划。(软删除)",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "删除计划",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "计划ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表删除成功",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/plans/{id}/start": {
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "根据计划ID启动一个计划的执行。",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "启动计划",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "计划ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表成功启动计划",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/plans/{id}/stop": {
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "根据计划ID停止一个正在执行的计划。",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"计划管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "停止计划",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "计划ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表成功停止计划",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/users": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "根据用户名和密码创建一个新的系统用户。",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"用户管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "创建新用户",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "用户信息",
|
|
|
|
|
|
"name": "user",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.CreateUserRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为201代表创建成功",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/user.CreateUserResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"/api/v1/users/login": {
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"post": {
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"description": "用户可以使用用户名、邮箱、手机号、微信号或飞书账号进行登录,成功后返回 JWT 令牌。",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"用户管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "用户登录",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "登录凭证",
|
|
|
|
|
|
"name": "credentials",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.LoginRequest"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"description": "业务码为200代表登录成功",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"schema": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/user.LoginResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-09-30 15:25:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/users/{id}/history": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "根据用户ID,分页获取该用户的操作审计日志。",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"用户管理"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取指定用户的操作历史",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "用户ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"default": 1,
|
|
|
|
|
|
"description": "页码",
|
|
|
|
|
|
"name": "page",
|
|
|
|
|
|
"in": "query"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"default": 10,
|
|
|
|
|
|
"description": "每页大小",
|
|
|
|
|
|
"name": "page_size",
|
|
|
|
|
|
"in": "query"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "按操作类型过滤",
|
|
|
|
|
|
"name": "action_type",
|
|
|
|
|
|
"in": "query"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "业务码为200代表成功获取",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.Response"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"$ref": "#/definitions/user.ListHistoryResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"definitions": {
|
|
|
|
|
|
"controller.Response": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"code": {
|
|
|
|
|
|
"description": "业务状态码",
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/controller.ResponseCode"
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-12 16:58:39 +08:00
|
|
|
|
},
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"description": "业务数据"
|
|
|
|
|
|
},
|
|
|
|
|
|
"message": {
|
|
|
|
|
|
"description": "提示信息",
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"controller.ResponseCode": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"enum": [
|
|
|
|
|
|
2000,
|
|
|
|
|
|
2001,
|
|
|
|
|
|
4000,
|
|
|
|
|
|
4001,
|
|
|
|
|
|
4004,
|
|
|
|
|
|
4009,
|
|
|
|
|
|
5000,
|
|
|
|
|
|
5003
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-comments": {
|
|
|
|
|
|
"CodeBadRequest": "请求参数错误",
|
|
|
|
|
|
"CodeConflict": "资源冲突",
|
|
|
|
|
|
"CodeCreated": "创建成功",
|
|
|
|
|
|
"CodeInternalError": "服务器内部错误",
|
|
|
|
|
|
"CodeNotFound": "资源未找到",
|
|
|
|
|
|
"CodeServiceUnavailable": "服务不可用",
|
|
|
|
|
|
"CodeSuccess": "操作成功",
|
|
|
|
|
|
"CodeUnauthorized": "未授权"
|
|
|
|
|
|
},
|
|
|
|
|
|
"x-enum-descriptions": [
|
|
|
|
|
|
"操作成功",
|
|
|
|
|
|
"创建成功",
|
|
|
|
|
|
"请求参数错误",
|
|
|
|
|
|
"未授权",
|
|
|
|
|
|
"资源未找到",
|
|
|
|
|
|
"资源冲突",
|
|
|
|
|
|
"服务器内部错误",
|
|
|
|
|
|
"服务不可用"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
|
"CodeSuccess",
|
|
|
|
|
|
"CodeCreated",
|
|
|
|
|
|
"CodeBadRequest",
|
|
|
|
|
|
"CodeUnauthorized",
|
|
|
|
|
|
"CodeNotFound",
|
|
|
|
|
|
"CodeConflict",
|
|
|
|
|
|
"CodeInternalError",
|
|
|
|
|
|
"CodeServiceUnavailable"
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
"device.AreaControllerResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"created_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"location": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"network_id": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"status": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"updated_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"device.CreateAreaControllerRequest": {
|
2025-09-19 23:51:13 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"name",
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"network_id"
|
2025-09-19 23:51:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"location": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"network_id": {
|
|
|
|
|
|
"type": "string"
|
2025-09-19 23:51:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
"properties": {
|
2025-09-20 17:11:04 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-30 15:25:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"device.CreateDeviceRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"area_controller_id",
|
|
|
|
|
|
"device_template_id",
|
|
|
|
|
|
"name"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"area_controller_id": {
|
|
|
|
|
|
"type": "integer"
|
2025-09-19 23:51:13 +08:00
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"device_template_id": {
|
|
|
|
|
|
"type": "integer"
|
2025-09-19 23:51:13 +08:00
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"location": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-19 23:51:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-09-12 17:43:42 +08:00
|
|
|
|
},
|
2025-09-30 22:07:55 +08:00
|
|
|
|
"device.CreateDeviceTemplateRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"category",
|
|
|
|
|
|
"commands",
|
|
|
|
|
|
"name"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"category": {
|
|
|
|
|
|
"$ref": "#/definitions/models.DeviceCategory"
|
|
|
|
|
|
},
|
|
|
|
|
|
"commands": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"manufacturer": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"values": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/models.ValueDescriptor"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"device.DeviceTemplateResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"category": {
|
|
|
|
|
|
"$ref": "#/definitions/models.DeviceCategory"
|
|
|
|
|
|
},
|
|
|
|
|
|
"commands": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"created_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"manufacturer": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"updated_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"values": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/models.ValueDescriptor"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"device.UpdateAreaControllerRequest": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"type": "object",
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"required": [
|
|
|
|
|
|
"name",
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"network_id"
|
2025-09-19 13:18:05 +08:00
|
|
|
|
],
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"properties": {
|
|
|
|
|
|
"location": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"network_id": {
|
|
|
|
|
|
"type": "string"
|
2025-09-12 17:43:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
"properties": {
|
2025-09-20 17:11:04 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-30 15:25:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"device.UpdateDeviceRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"area_controller_id",
|
|
|
|
|
|
"device_template_id",
|
|
|
|
|
|
"name"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"area_controller_id": {
|
|
|
|
|
|
"type": "integer"
|
2025-09-12 17:43:42 +08:00
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"device_template_id": {
|
|
|
|
|
|
"type": "integer"
|
2025-09-12 17:43:42 +08:00
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"location": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-12 17:43:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-30 22:07:55 +08:00
|
|
|
|
"device.UpdateDeviceTemplateRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"category",
|
|
|
|
|
|
"commands",
|
|
|
|
|
|
"name"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"category": {
|
|
|
|
|
|
"$ref": "#/definitions/models.DeviceCategory"
|
|
|
|
|
|
},
|
|
|
|
|
|
"commands": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"manufacturer": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"values": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/models.ValueDescriptor"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse": {
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"area_controller_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"area_controller_name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"created_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"device_template_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"device_template_name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2025-09-12 17:43:42 +08:00
|
|
|
|
"location": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"properties": {
|
2025-09-20 17:11:04 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-12 17:43:42 +08:00
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"updated_at": {
|
|
|
|
|
|
"type": "string"
|
2025-09-12 17:43:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-30 22:07:55 +08:00
|
|
|
|
"models.DeviceCategory": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"enum": [
|
|
|
|
|
|
"actuator",
|
|
|
|
|
|
"sensor"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
|
"CategoryActuator",
|
|
|
|
|
|
"CategorySensor"
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"models.PlanContentType": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"enum": [
|
|
|
|
|
|
"sub_plans",
|
|
|
|
|
|
"tasks"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-comments": {
|
|
|
|
|
|
"PlanContentTypeSubPlans": "计划包含子计划",
|
|
|
|
|
|
"PlanContentTypeTasks": "计划包含任务"
|
|
|
|
|
|
},
|
|
|
|
|
|
"x-enum-descriptions": [
|
|
|
|
|
|
"计划包含子计划",
|
|
|
|
|
|
"计划包含任务"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
|
"PlanContentTypeSubPlans",
|
|
|
|
|
|
"PlanContentTypeTasks"
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
"models.PlanExecutionType": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"enum": [
|
|
|
|
|
|
"automatic",
|
|
|
|
|
|
"manual"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-comments": {
|
|
|
|
|
|
"PlanExecutionTypeAutomatic": "自动执行 (包含定时和循环)",
|
|
|
|
|
|
"PlanExecutionTypeManual": "手动执行"
|
|
|
|
|
|
},
|
|
|
|
|
|
"x-enum-descriptions": [
|
|
|
|
|
|
"自动执行 (包含定时和循环)",
|
|
|
|
|
|
"手动执行"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
|
"PlanExecutionTypeAutomatic",
|
|
|
|
|
|
"PlanExecutionTypeManual"
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"models.PlanStatus": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"format": "int32",
|
|
|
|
|
|
"enum": [
|
|
|
|
|
|
0,
|
|
|
|
|
|
1,
|
2025-09-23 18:11:21 +08:00
|
|
|
|
2,
|
|
|
|
|
|
3
|
2025-09-19 13:18:05 +08:00
|
|
|
|
],
|
|
|
|
|
|
"x-enum-comments": {
|
|
|
|
|
|
"PlanStatusDisabled": "禁用计划",
|
|
|
|
|
|
"PlanStatusEnabled": "启用计划",
|
2025-09-23 18:11:21 +08:00
|
|
|
|
"PlanStatusFailed": "执行失败",
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"PlanStatusStopeed": "执行完毕"
|
|
|
|
|
|
},
|
|
|
|
|
|
"x-enum-descriptions": [
|
|
|
|
|
|
"禁用计划",
|
2025-09-23 18:11:21 +08:00
|
|
|
|
"启用计划",
|
|
|
|
|
|
"执行完毕",
|
|
|
|
|
|
"执行失败"
|
2025-09-19 13:18:05 +08:00
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
|
"PlanStatusDisabled",
|
2025-09-23 18:11:21 +08:00
|
|
|
|
"PlanStatusEnabled",
|
|
|
|
|
|
"PlanStatusStopeed",
|
|
|
|
|
|
"PlanStatusFailed"
|
2025-09-19 13:18:05 +08:00
|
|
|
|
]
|
|
|
|
|
|
},
|
2025-09-30 22:07:55 +08:00
|
|
|
|
"models.SensorType": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"enum": [
|
|
|
|
|
|
"signal_metrics",
|
|
|
|
|
|
"battery_level",
|
|
|
|
|
|
"temperature",
|
|
|
|
|
|
"humidity",
|
|
|
|
|
|
"weight"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-comments": {
|
|
|
|
|
|
"SensorTypeBatteryLevel": "电池电量",
|
|
|
|
|
|
"SensorTypeHumidity": "湿度",
|
|
|
|
|
|
"SensorTypeSignalMetrics": "信号强度",
|
|
|
|
|
|
"SensorTypeTemperature": "温度",
|
|
|
|
|
|
"SensorTypeWeight": "重量"
|
|
|
|
|
|
},
|
|
|
|
|
|
"x-enum-descriptions": [
|
|
|
|
|
|
"信号强度",
|
|
|
|
|
|
"电池电量",
|
|
|
|
|
|
"温度",
|
|
|
|
|
|
"湿度",
|
|
|
|
|
|
"重量"
|
|
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
|
"SensorTypeSignalMetrics",
|
|
|
|
|
|
"SensorTypeBatteryLevel",
|
|
|
|
|
|
"SensorTypeTemperature",
|
|
|
|
|
|
"SensorTypeHumidity",
|
|
|
|
|
|
"SensorTypeWeight"
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"models.TaskType": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"enum": [
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"plan_analysis",
|
2025-09-27 22:25:49 +08:00
|
|
|
|
"waiting",
|
|
|
|
|
|
"release_feed_weight"
|
2025-09-14 21:30:20 +08:00
|
|
|
|
],
|
|
|
|
|
|
"x-enum-comments": {
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"TaskPlanAnalysis": "解析Plan的Task列表并添加到待执行队列的特殊任务",
|
2025-09-27 22:25:49 +08:00
|
|
|
|
"TaskTypeReleaseFeedWeight": "下料口释放指定重量任务",
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"TaskTypeWaiting": "等待任务"
|
|
|
|
|
|
},
|
|
|
|
|
|
"x-enum-descriptions": [
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"解析Plan的Task列表并添加到待执行队列的特殊任务",
|
2025-09-27 22:25:49 +08:00
|
|
|
|
"等待任务",
|
|
|
|
|
|
"下料口释放指定重量任务"
|
2025-09-14 21:30:20 +08:00
|
|
|
|
],
|
|
|
|
|
|
"x-enum-varnames": [
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"TaskPlanAnalysis",
|
2025-09-27 22:25:49 +08:00
|
|
|
|
"TaskTypeWaiting",
|
|
|
|
|
|
"TaskTypeReleaseFeedWeight"
|
2025-09-14 21:30:20 +08:00
|
|
|
|
]
|
|
|
|
|
|
},
|
2025-09-30 22:07:55 +08:00
|
|
|
|
"models.ValueDescriptor": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"multiplier": {
|
|
|
|
|
|
"description": "乘数,用于原始数据转换",
|
|
|
|
|
|
"type": "number"
|
|
|
|
|
|
},
|
|
|
|
|
|
"offset": {
|
|
|
|
|
|
"description": "偏移量,用于原始数据转换",
|
|
|
|
|
|
"type": "number"
|
|
|
|
|
|
},
|
|
|
|
|
|
"type": {
|
|
|
|
|
|
"$ref": "#/definitions/models.SensorType"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"plan.CreatePlanRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"execution_type",
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"name"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"cron_expression": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "0 0 6 * * *"
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "根据温度自动调节风扇和加热器"
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"execute_num": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 10
|
|
|
|
|
|
},
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"execution_type": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.PlanExecutionType"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": "automatic"
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "猪舍温度控制计划"
|
2025-09-14 21:30:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
"sub_plan_ids": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"tasks": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.TaskRequest"
|
|
|
|
|
|
}
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"plan.ListPlansResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"plans": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.PlanResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"total": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 100
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"plan.PlanResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"content_type": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.PlanContentType"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": "tasks"
|
|
|
|
|
|
},
|
|
|
|
|
|
"cron_expression": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "0 0 6 * * *"
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "根据温度自动调节风扇和加热器"
|
|
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"execute_count": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 0
|
|
|
|
|
|
},
|
|
|
|
|
|
"execute_num": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 10
|
|
|
|
|
|
},
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"execution_type": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.PlanExecutionType"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": "automatic"
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "猪舍温度控制计划"
|
2025-09-14 21:30:20 +08:00
|
|
|
|
},
|
2025-09-19 13:18:05 +08:00
|
|
|
|
"status": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.PlanStatus"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": 0
|
|
|
|
|
|
},
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"sub_plans": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.SubPlanResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"tasks": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.TaskResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"plan.SubPlanResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"child_plan": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.PlanResponse"
|
|
|
|
|
|
},
|
|
|
|
|
|
"child_plan_id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 2
|
|
|
|
|
|
},
|
|
|
|
|
|
"execution_order": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"parent_plan_id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"plan.TaskRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "打开1号风扇"
|
|
|
|
|
|
},
|
|
|
|
|
|
"execution_order": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "打开风扇"
|
|
|
|
|
|
},
|
|
|
|
|
|
"parameters": {
|
2025-09-20 17:11:04 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-14 21:30:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
"type": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.TaskType"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": "waiting"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"plan.TaskResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "打开1号风扇"
|
|
|
|
|
|
},
|
|
|
|
|
|
"execution_order": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "打开风扇"
|
|
|
|
|
|
},
|
|
|
|
|
|
"parameters": {
|
2025-09-20 17:11:04 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
2025-09-14 21:30:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
"plan_id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"type": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.TaskType"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": "waiting"
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"plan.UpdatePlanRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"cron_expression": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "0 0 6 * * *"
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "更新后的描述"
|
|
|
|
|
|
},
|
2025-09-19 15:55:56 +08:00
|
|
|
|
"execute_num": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 10
|
|
|
|
|
|
},
|
2025-09-14 21:30:20 +08:00
|
|
|
|
"execution_type": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"$ref": "#/definitions/models.PlanExecutionType"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"example": "automatic"
|
|
|
|
|
|
},
|
2025-09-13 14:09:22 +08:00
|
|
|
|
"name": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "猪舍温度控制计划V2"
|
2025-09-14 21:30:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
"sub_plan_ids": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"tasks": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/plan.TaskRequest"
|
|
|
|
|
|
}
|
2025-09-13 14:09:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"user.CreateUserRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"password",
|
|
|
|
|
|
"username"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"password": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"minLength": 6,
|
|
|
|
|
|
"example": "password123"
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "newuser"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"user.CreateUserResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "newuser"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"user.HistoryResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"action_type": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "更新设备"
|
|
|
|
|
|
},
|
|
|
|
|
|
"description": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "设备更新成功"
|
|
|
|
|
|
},
|
|
|
|
|
|
"target_resource": {},
|
|
|
|
|
|
"time": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"user_id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 101
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "testuser"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"user.ListHistoryResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"history": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"$ref": "#/definitions/user.HistoryResponse"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"total": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 100
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"user.LoginRequest": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"identifier",
|
|
|
|
|
|
"password"
|
2025-09-12 16:58:39 +08:00
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"identifier": {
|
|
|
|
|
|
"description": "Identifier 可以是用户名、邮箱、手机号、微信号或飞书账号",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"type": "string",
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"example": "testuser"
|
2025-09-12 16:58:39 +08:00
|
|
|
|
},
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"password": {
|
2025-09-12 16:58:39 +08:00
|
|
|
|
"type": "string",
|
2025-09-30 15:25:07 +08:00
|
|
|
|
"example": "password123"
|
2025-09-12 16:58:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"user.LoginResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"example": 1
|
|
|
|
|
|
},
|
|
|
|
|
|
"token": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "testuser"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}`
|
|
|
|
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
|
|
var SwaggerInfo = &swag.Spec{
|
2025-09-12 20:32:29 +08:00
|
|
|
|
Version: "",
|
|
|
|
|
|
Host: "",
|
|
|
|
|
|
BasePath: "",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
Schemes: []string{},
|
2025-09-12 20:32:29 +08:00
|
|
|
|
Title: "",
|
|
|
|
|
|
Description: "",
|
2025-09-12 16:58:39 +08:00
|
|
|
|
InfoInstanceName: "swagger",
|
|
|
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
|
|
|
LeftDelim: "{{",
|
|
|
|
|
|
RightDelim: "}}",
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
|
|
|
}
|