修复swagger
This commit is contained in:
2
.swaggo
Normal file
2
.swaggo
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
replace encoding/json.RawMessage object
|
||||||
|
replace git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse device.DeviceResponse
|
||||||
4
Makefile
4
Makefile
@@ -37,7 +37,9 @@ test:
|
|||||||
# 生成swagger文档
|
# 生成swagger文档
|
||||||
.PHONY: swag
|
.PHONY: swag
|
||||||
swag:
|
swag:
|
||||||
swag init
|
if exist docs rmdir /s /q docs
|
||||||
|
swag init --parseInternal --parseDependency
|
||||||
|
|
||||||
|
|
||||||
# 生成protobuf文件
|
# 生成protobuf文件
|
||||||
.PHONY: proto
|
.PHONY: proto
|
||||||
|
|||||||
197
docs/docs.go
197
docs/docs.go
@@ -27,9 +27,24 @@ const docTemplate = `{
|
|||||||
"summary": "获取设备列表",
|
"summary": "获取设备列表",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,9 +74,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,9 +115,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,9 +166,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,7 +205,7 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -174,9 +225,21 @@ const docTemplate = `{
|
|||||||
"summary": "获取计划列表",
|
"summary": "获取计划列表",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 500)",
|
"description": "业务码为200代表成功获取列表",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.ListPlansResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,9 +269,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 500)",
|
"description": "业务码为201代表创建成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.PlanResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,9 +310,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表成功获取",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.PlanResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,9 +361,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表更新成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.PlanResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +400,7 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表删除成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -330,7 +429,7 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表成功启动计划",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -359,7 +458,7 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表成功停止计划",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -393,9 +492,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 409, 500)",
|
"description": "业务码为201代表创建成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/user.CreateUserResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -427,9 +538,21 @@ const docTemplate = `{
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 401, 500)",
|
"description": "业务码为200代表登录成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/user.LoginResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,7 +580,31 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device.CreateDeviceRequest": {
|
"device.CreateDeviceRequest": {
|
||||||
"type": "object"
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"location": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parent_id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"$ref": "#/definitions/controller.Properties"
|
||||||
|
},
|
||||||
|
"sub_type": {
|
||||||
|
"$ref": "#/definitions/models.DeviceSubType"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/definitions/models.DeviceType"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"device.UpdateDeviceRequest": {
|
"device.UpdateDeviceRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|||||||
@@ -16,9 +16,24 @@
|
|||||||
"summary": "获取设备列表",
|
"summary": "获取设备列表",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,9 +63,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,9 +104,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,9 +155,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,7 +194,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -163,9 +214,21 @@
|
|||||||
"summary": "获取计划列表",
|
"summary": "获取计划列表",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 500)",
|
"description": "业务码为200代表成功获取列表",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.ListPlansResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,9 +258,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 500)",
|
"description": "业务码为201代表创建成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.PlanResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,9 +299,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表成功获取",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.PlanResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,9 +350,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表更新成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/plan.PlanResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,7 +389,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表删除成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -319,7 +418,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表成功启动计划",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -348,7 +447,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)",
|
"description": "业务码为200代表成功停止计划",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
@@ -382,9 +481,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 409, 500)",
|
"description": "业务码为201代表创建成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/user.CreateUserResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -416,9 +527,21 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "业务失败,具体错误码和信息见响应体(例如400, 401, 500)",
|
"description": "业务码为200代表登录成功",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/user.LoginResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -446,7 +569,31 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device.CreateDeviceRequest": {
|
"device.CreateDeviceRequest": {
|
||||||
"type": "object"
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"location": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parent_id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"$ref": "#/definitions/controller.Properties"
|
||||||
|
},
|
||||||
|
"sub_type": {
|
||||||
|
"$ref": "#/definitions/models.DeviceSubType"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/definitions/models.DeviceType"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"device.UpdateDeviceRequest": {
|
"device.UpdateDeviceRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|||||||
@@ -13,6 +13,22 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
device.CreateDeviceRequest:
|
device.CreateDeviceRequest:
|
||||||
|
properties:
|
||||||
|
location:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
parent_id:
|
||||||
|
type: integer
|
||||||
|
properties:
|
||||||
|
$ref: '#/definitions/controller.Properties'
|
||||||
|
sub_type:
|
||||||
|
$ref: '#/definitions/models.DeviceSubType'
|
||||||
|
type:
|
||||||
|
$ref: '#/definitions/models.DeviceType'
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- type
|
||||||
type: object
|
type: object
|
||||||
device.UpdateDeviceRequest:
|
device.UpdateDeviceRequest:
|
||||||
properties:
|
properties:
|
||||||
@@ -372,9 +388,16 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse'
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
summary: 获取设备列表
|
summary: 获取设备列表
|
||||||
tags:
|
tags:
|
||||||
- 设备管理
|
- 设备管理
|
||||||
@@ -393,9 +416,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse'
|
||||||
|
type: object
|
||||||
summary: 创建新设备
|
summary: 创建新设备
|
||||||
tags:
|
tags:
|
||||||
- 设备管理
|
- 设备管理
|
||||||
@@ -412,7 +440,7 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
$ref: '#/definitions/controller.Response'
|
||||||
summary: 删除设备
|
summary: 删除设备
|
||||||
@@ -430,9 +458,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse'
|
||||||
|
type: object
|
||||||
summary: 获取设备信息
|
summary: 获取设备信息
|
||||||
tags:
|
tags:
|
||||||
- 设备管理
|
- 设备管理
|
||||||
@@ -456,9 +489,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse'
|
||||||
|
type: object
|
||||||
summary: 更新设备信息
|
summary: 更新设备信息
|
||||||
tags:
|
tags:
|
||||||
- 设备管理
|
- 设备管理
|
||||||
@@ -469,9 +507,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 500)
|
description: 业务码为200代表成功获取列表
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/plan.ListPlansResponse'
|
||||||
|
type: object
|
||||||
summary: 获取计划列表
|
summary: 获取计划列表
|
||||||
tags:
|
tags:
|
||||||
- 计划管理
|
- 计划管理
|
||||||
@@ -490,9 +533,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 500)
|
description: 业务码为201代表创建成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/plan.PlanResponse'
|
||||||
|
type: object
|
||||||
summary: 创建计划
|
summary: 创建计划
|
||||||
tags:
|
tags:
|
||||||
- 计划管理
|
- 计划管理
|
||||||
@@ -509,7 +557,7 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 404, 500)
|
description: 业务码为200代表删除成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
$ref: '#/definitions/controller.Response'
|
||||||
summary: 删除计划
|
summary: 删除计划
|
||||||
@@ -527,9 +575,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 404, 500)
|
description: 业务码为200代表成功获取
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/plan.PlanResponse'
|
||||||
|
type: object
|
||||||
summary: 获取计划详情
|
summary: 获取计划详情
|
||||||
tags:
|
tags:
|
||||||
- 计划管理
|
- 计划管理
|
||||||
@@ -553,9 +606,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 404, 500)
|
description: 业务码为200代表更新成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/plan.PlanResponse'
|
||||||
|
type: object
|
||||||
summary: 更新计划
|
summary: 更新计划
|
||||||
tags:
|
tags:
|
||||||
- 计划管理
|
- 计划管理
|
||||||
@@ -572,7 +630,7 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 404, 500)
|
description: 业务码为200代表成功启动计划
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
$ref: '#/definitions/controller.Response'
|
||||||
summary: 启动计划
|
summary: 启动计划
|
||||||
@@ -591,7 +649,7 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 404, 500)
|
description: 业务码为200代表成功停止计划
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
$ref: '#/definitions/controller.Response'
|
||||||
summary: 停止计划
|
summary: 停止计划
|
||||||
@@ -613,9 +671,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 409, 500)
|
description: 业务码为201代表创建成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/user.CreateUserResponse'
|
||||||
|
type: object
|
||||||
summary: 创建新用户
|
summary: 创建新用户
|
||||||
tags:
|
tags:
|
||||||
- 用户管理
|
- 用户管理
|
||||||
@@ -635,9 +698,14 @@ paths:
|
|||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 业务失败,具体错误码和信息见响应体(例如400, 401, 500)
|
description: 业务码为200代表登录成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
allOf:
|
||||||
|
- $ref: '#/definitions/controller.Response'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/user.LoginResponse'
|
||||||
|
type: object
|
||||||
summary: 用户登录
|
summary: 用户登录
|
||||||
tags:
|
tags:
|
||||||
- 用户管理
|
- 用户管理
|
||||||
|
|||||||
@@ -104,8 +104,7 @@ func newListDeviceResponse(devices []*models.Device) []*DeviceResponse {
|
|||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param device body CreateDeviceRequest true "设备信息"
|
// @Param device body CreateDeviceRequest true "设备信息"
|
||||||
// @Success 200 {object} controller.Response{data=DeviceResponse} "业务码为201代表创建成功"
|
// @Success 200 {object} controller.Response{data=DeviceResponse}
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体"
|
|
||||||
// @Router /api/v1/devices [post]
|
// @Router /api/v1/devices [post]
|
||||||
func (c *Controller) CreateDevice(ctx *gin.Context) {
|
func (c *Controller) CreateDevice(ctx *gin.Context) {
|
||||||
var req CreateDeviceRequest
|
var req CreateDeviceRequest
|
||||||
@@ -139,8 +138,7 @@ func (c *Controller) CreateDevice(ctx *gin.Context) {
|
|||||||
// @Tags 设备管理
|
// @Tags 设备管理
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path string true "设备ID"
|
// @Param id path string true "设备ID"
|
||||||
// @Success 200 {object} controller.Response{data=DeviceResponse} "业务码为200代表获取成功"
|
// @Success 200 {object} controller.Response{data=DeviceResponse}
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体"
|
|
||||||
// @Router /api/v1/devices/{id} [get]
|
// @Router /api/v1/devices/{id} [get]
|
||||||
func (c *Controller) GetDevice(ctx *gin.Context) {
|
func (c *Controller) GetDevice(ctx *gin.Context) {
|
||||||
deviceID := ctx.Param("id")
|
deviceID := ctx.Param("id")
|
||||||
@@ -168,8 +166,7 @@ func (c *Controller) GetDevice(ctx *gin.Context) {
|
|||||||
// @Description 获取系统中所有设备的列表
|
// @Description 获取系统中所有设备的列表
|
||||||
// @Tags 设备管理
|
// @Tags 设备管理
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} controller.Response{data=[]DeviceResponse} "业务码为200代表获取成功"
|
// @Success 200 {object} controller.Response{data=[]DeviceResponse}
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体"
|
|
||||||
// @Router /api/v1/devices [get]
|
// @Router /api/v1/devices [get]
|
||||||
func (c *Controller) ListDevices(ctx *gin.Context) {
|
func (c *Controller) ListDevices(ctx *gin.Context) {
|
||||||
devices, err := c.repo.ListAll()
|
devices, err := c.repo.ListAll()
|
||||||
@@ -190,8 +187,7 @@ func (c *Controller) ListDevices(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path string true "设备ID"
|
// @Param id path string true "设备ID"
|
||||||
// @Param device body UpdateDeviceRequest true "要更新的设备信息"
|
// @Param device body UpdateDeviceRequest true "要更新的设备信息"
|
||||||
// @Success 200 {object} controller.Response{data=DeviceResponse} "业务码为200代表更新成功"
|
// @Success 200 {object} controller.Response{data=DeviceResponse}
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体"
|
|
||||||
// @Router /api/v1/devices/{id} [put]
|
// @Router /api/v1/devices/{id} [put]
|
||||||
func (c *Controller) UpdateDevice(ctx *gin.Context) {
|
func (c *Controller) UpdateDevice(ctx *gin.Context) {
|
||||||
deviceID := ctx.Param("id")
|
deviceID := ctx.Param("id")
|
||||||
@@ -244,8 +240,7 @@ func (c *Controller) UpdateDevice(ctx *gin.Context) {
|
|||||||
// @Tags 设备管理
|
// @Tags 设备管理
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path string true "设备ID"
|
// @Param id path string true "设备ID"
|
||||||
// @Success 200 {object} controller.Response "业务码为200代表删除成功"
|
// @Success 200 {object} controller.Response
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体"
|
|
||||||
// @Router /api/v1/devices/{id} [delete]
|
// @Router /api/v1/devices/{id} [delete]
|
||||||
func (c *Controller) DeleteDevice(ctx *gin.Context) {
|
func (c *Controller) DeleteDevice(ctx *gin.Context) {
|
||||||
deviceID := ctx.Param("id")
|
deviceID := ctx.Param("id")
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ func NewController(logger *logs.Logger, planRepo repository.PlanRepository, anal
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param plan body CreatePlanRequest true "计划信息"
|
// @Param plan body CreatePlanRequest true "计划信息"
|
||||||
// @Success 200 {object} controller.Response{data=plan.PlanResponse} "业务码为201代表创建成功"
|
// @Success 200 {object} controller.Response{data=plan.PlanResponse} "业务码为201代表创建成功"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 500)"
|
|
||||||
// @Router /api/v1/plans [post]
|
// @Router /api/v1/plans [post]
|
||||||
func (c *Controller) CreatePlan(ctx *gin.Context) {
|
func (c *Controller) CreatePlan(ctx *gin.Context) {
|
||||||
var req CreatePlanRequest
|
var req CreatePlanRequest
|
||||||
@@ -159,7 +158,6 @@ func (c *Controller) CreatePlan(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "计划ID"
|
// @Param id path int true "计划ID"
|
||||||
// @Success 200 {object} controller.Response{data=plan.PlanResponse} "业务码为200代表成功获取"
|
// @Success 200 {object} controller.Response{data=plan.PlanResponse} "业务码为200代表成功获取"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 404, 500)"
|
|
||||||
// @Router /api/v1/plans/{id} [get]
|
// @Router /api/v1/plans/{id} [get]
|
||||||
func (c *Controller) GetPlan(ctx *gin.Context) {
|
func (c *Controller) GetPlan(ctx *gin.Context) {
|
||||||
// 1. 从 URL 路径中获取 ID
|
// 1. 从 URL 路径中获取 ID
|
||||||
@@ -197,7 +195,6 @@ func (c *Controller) GetPlan(ctx *gin.Context) {
|
|||||||
// @Tags 计划管理
|
// @Tags 计划管理
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} controller.Response{data=plan.ListPlansResponse} "业务码为200代表成功获取列表"
|
// @Success 200 {object} controller.Response{data=plan.ListPlansResponse} "业务码为200代表成功获取列表"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 500)"
|
|
||||||
// @Router /api/v1/plans [get]
|
// @Router /api/v1/plans [get]
|
||||||
func (c *Controller) ListPlans(ctx *gin.Context) {
|
func (c *Controller) ListPlans(ctx *gin.Context) {
|
||||||
// 1. 调用仓库层获取所有计划
|
// 1. 调用仓库层获取所有计划
|
||||||
@@ -231,7 +228,6 @@ func (c *Controller) ListPlans(ctx *gin.Context) {
|
|||||||
// @Param id path int true "计划ID"
|
// @Param id path int true "计划ID"
|
||||||
// @Param plan body UpdatePlanRequest true "更新后的计划信息"
|
// @Param plan body UpdatePlanRequest true "更新后的计划信息"
|
||||||
// @Success 200 {object} controller.Response{data=plan.PlanResponse} "业务码为200代表更新成功"
|
// @Success 200 {object} controller.Response{data=plan.PlanResponse} "业务码为200代表更新成功"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 404, 500)"
|
|
||||||
// @Router /api/v1/plans/{id} [put]
|
// @Router /api/v1/plans/{id} [put]
|
||||||
func (c *Controller) UpdatePlan(ctx *gin.Context) {
|
func (c *Controller) UpdatePlan(ctx *gin.Context) {
|
||||||
// 1. 从 URL 路径中获取 ID
|
// 1. 从 URL 路径中获取 ID
|
||||||
@@ -303,7 +299,6 @@ func (c *Controller) UpdatePlan(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "计划ID"
|
// @Param id path int true "计划ID"
|
||||||
// @Success 200 {object} controller.Response "业务码为200代表删除成功"
|
// @Success 200 {object} controller.Response "业务码为200代表删除成功"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 404, 500)"
|
|
||||||
// @Router /api/v1/plans/{id} [delete]
|
// @Router /api/v1/plans/{id} [delete]
|
||||||
func (c *Controller) DeletePlan(ctx *gin.Context) {
|
func (c *Controller) DeletePlan(ctx *gin.Context) {
|
||||||
// 1. 从 URL 路径中获取 ID
|
// 1. 从 URL 路径中获取 ID
|
||||||
@@ -332,7 +327,6 @@ func (c *Controller) DeletePlan(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "计划ID"
|
// @Param id path int true "计划ID"
|
||||||
// @Success 200 {object} controller.Response "业务码为200代表成功启动计划"
|
// @Success 200 {object} controller.Response "业务码为200代表成功启动计划"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 404, 500)"
|
|
||||||
// @Router /api/v1/plans/{id}/start [post]
|
// @Router /api/v1/plans/{id}/start [post]
|
||||||
func (c *Controller) StartPlan(ctx *gin.Context) {
|
func (c *Controller) StartPlan(ctx *gin.Context) {
|
||||||
// 占位符:此处应调用服务层或仓库层来启动计划
|
// 占位符:此处应调用服务层或仓库层来启动计划
|
||||||
@@ -347,7 +341,6 @@ func (c *Controller) StartPlan(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "计划ID"
|
// @Param id path int true "计划ID"
|
||||||
// @Success 200 {object} controller.Response "业务码为200代表成功停止计划"
|
// @Success 200 {object} controller.Response "业务码为200代表成功停止计划"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 404, 500)"
|
|
||||||
// @Router /api/v1/plans/{id}/stop [post]
|
// @Router /api/v1/plans/{id}/stop [post]
|
||||||
func (c *Controller) StopPlan(ctx *gin.Context) {
|
func (c *Controller) StopPlan(ctx *gin.Context) {
|
||||||
// 占位符:此处应调用服务层或仓库层来停止计划
|
// 占位符:此处应调用服务层或仓库层来停止计划
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ type LoginResponse struct {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param user body CreateUserRequest true "用户信息"
|
// @Param user body CreateUserRequest true "用户信息"
|
||||||
// @Success 200 {object} controller.Response{data=user.CreateUserResponse} "业务码为201代表创建成功"
|
// @Success 200 {object} controller.Response{data=user.CreateUserResponse} "业务码为201代表创建成功"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 409, 500)"
|
|
||||||
// @Router /api/v1/users [post]
|
// @Router /api/v1/users [post]
|
||||||
func (c *Controller) CreateUser(ctx *gin.Context) {
|
func (c *Controller) CreateUser(ctx *gin.Context) {
|
||||||
var req CreateUserRequest
|
var req CreateUserRequest
|
||||||
@@ -103,7 +102,6 @@ func (c *Controller) CreateUser(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param credentials body LoginRequest true "登录凭证"
|
// @Param credentials body LoginRequest true "登录凭证"
|
||||||
// @Success 200 {object} controller.Response{data=user.LoginResponse} "业务码为200代表登录成功"
|
// @Success 200 {object} controller.Response{data=user.LoginResponse} "业务码为200代表登录成功"
|
||||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 401, 500)"
|
|
||||||
// @Router /api/v1/users/login [post]
|
// @Router /api/v1/users/login [post]
|
||||||
func (c *Controller) Login(ctx *gin.Context) {
|
func (c *Controller) Login(ctx *gin.Context) {
|
||||||
var req LoginRequest
|
var req LoginRequest
|
||||||
|
|||||||
Reference in New Issue
Block a user