From ee4f498db0d1bd47c5e8dc6dc71e7487abc1fc26 Mon Sep 17 00:00:00 2001 From: huang <1724659546@qq.com> Date: Sat, 20 Sep 2025 16:37:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger.json | 120 +++++++++--- src/components/DeviceForm.vue | 332 ++++++++++++++++++++++++++++++++++ src/components/DeviceList.vue | 84 ++------- 3 files changed, 449 insertions(+), 87 deletions(-) create mode 100644 src/components/DeviceForm.vue diff --git a/docs/swagger.json b/docs/swagger.json index 037d4973..e987a0a2 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -220,9 +220,21 @@ "summary": "获取计划列表", "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 500)", + "description": "业务码为200代表成功获取列表", "schema": { - "$ref": "#/definitions/controller.Response" + "allOf": [ + { + "$ref": "#/definitions/controller.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/plan.ListPlansResponse" + } + } + } + ] } } } @@ -252,9 +264,21 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 500)", + "description": "业务码为201代表创建成功", "schema": { - "$ref": "#/definitions/controller.Response" + "allOf": [ + { + "$ref": "#/definitions/controller.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/plan.PlanResponse" + } + } + } + ] } } } @@ -281,9 +305,21 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)", + "description": "业务码为200代表成功获取", "schema": { - "$ref": "#/definitions/controller.Response" + "allOf": [ + { + "$ref": "#/definitions/controller.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/plan.PlanResponse" + } + } + } + ] } } } @@ -320,9 +356,21 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)", + "description": "业务码为200代表更新成功", "schema": { - "$ref": "#/definitions/controller.Response" + "allOf": [ + { + "$ref": "#/definitions/controller.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/plan.PlanResponse" + } + } + } + ] } } } @@ -347,7 +395,7 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)", + "description": "业务码为200代表删除成功", "schema": { "$ref": "#/definitions/controller.Response" } @@ -376,7 +424,7 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)", + "description": "业务码为200代表成功启动计划", "schema": { "$ref": "#/definitions/controller.Response" } @@ -405,7 +453,7 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 404, 500)", + "description": "业务码为200代表成功停止计划", "schema": { "$ref": "#/definitions/controller.Response" } @@ -439,9 +487,21 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 409, 500)", + "description": "业务码为201代表创建成功", "schema": { - "$ref": "#/definitions/controller.Response" + "allOf": [ + { + "$ref": "#/definitions/controller.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/user.CreateUserResponse" + } + } + } + ] } } } @@ -473,9 +533,21 @@ ], "responses": { "200": { - "description": "业务失败,具体错误码和信息见响应体(例如400, 401, 500)", + "description": "业务码为200代表登录成功", "schema": { - "$ref": "#/definitions/controller.Response" + "allOf": [ + { + "$ref": "#/definitions/controller.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/user.LoginResponse" + } + } + } + ] } } } @@ -483,9 +555,6 @@ } }, "definitions": { - "controller.Properties": { - "type": "object" - }, "controller.Response": { "type": "object", "properties": { @@ -519,7 +588,8 @@ "type": "integer" }, "properties": { - "$ref": "#/definitions/controller.Properties" + "type": "object", + "additionalProperties": true }, "sub_type": { "$ref": "#/definitions/models.DeviceSubType" @@ -546,7 +616,8 @@ "type": "integer" }, "properties": { - "$ref": "#/definitions/controller.Properties" + "type": "object", + "additionalProperties": true }, "sub_type": { "$ref": "#/definitions/models.DeviceSubType" @@ -575,7 +646,8 @@ "type": "integer" }, "properties": { - "$ref": "#/definitions/controller.Properties" + "type": "object", + "additionalProperties": true }, "sub_type": { "$ref": "#/definitions/models.DeviceSubType" @@ -875,7 +947,8 @@ "example": "打开风扇" }, "parameters": { - "$ref": "#/definitions/controller.Properties" + "type": "object", + "additionalProperties": true }, "type": { "allOf": [ @@ -907,7 +980,8 @@ "example": "打开风扇" }, "parameters": { - "$ref": "#/definitions/controller.Properties" + "type": "object", + "additionalProperties": true }, "plan_id": { "type": "integer", diff --git a/src/components/DeviceForm.vue b/src/components/DeviceForm.vue new file mode 100644 index 00000000..66b75be0 --- /dev/null +++ b/src/components/DeviceForm.vue @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + + \ No newline at end of file diff --git a/src/components/DeviceList.vue b/src/components/DeviceList.vue index 6302af45..6bbdfa48 100644 --- a/src/components/DeviceList.vue +++ b/src/components/DeviceList.vue @@ -48,41 +48,26 @@ - - - - - - - - - - - - - - - - - - - - - - - 取消 - 保存 - - - + +