修复swagger

This commit is contained in:
2025-09-19 23:51:13 +08:00
parent 88e0fbfb64
commit cb63437e0e
8 changed files with 446 additions and 94 deletions

View File

@@ -13,6 +13,22 @@ definitions:
type: string
type: object
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
device.UpdateDeviceRequest:
properties:
@@ -372,9 +388,16 @@ paths:
- application/json
responses:
"200":
description: 业务失败,具体错误码和信息见响应体
description: OK
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: 获取设备列表
tags:
- 设备管理
@@ -393,9 +416,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败,具体错误码和信息见响应体
description: OK
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: 创建新设备
tags:
- 设备管理
@@ -412,7 +440,7 @@ paths:
- application/json
responses:
"200":
description: 业务失败,具体错误码和信息见响应体
description: OK
schema:
$ref: '#/definitions/controller.Response'
summary: 删除设备
@@ -430,9 +458,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败,具体错误码和信息见响应体
description: OK
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: 获取设备信息
tags:
- 设备管理
@@ -456,9 +489,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败,具体错误码和信息见响应体
description: OK
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: 更新设备信息
tags:
- 设备管理
@@ -469,9 +507,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 500
description: 业务码为200代表成功获取列表
schema:
$ref: '#/definitions/controller.Response'
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/plan.ListPlansResponse'
type: object
summary: 获取计划列表
tags:
- 计划管理
@@ -490,9 +533,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 500
description: 业务码为201代表创建成功
schema:
$ref: '#/definitions/controller.Response'
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/plan.PlanResponse'
type: object
summary: 创建计划
tags:
- 计划管理
@@ -509,7 +557,7 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 404, 500
description: 业务码为200代表删除成功
schema:
$ref: '#/definitions/controller.Response'
summary: 删除计划
@@ -527,9 +575,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 404, 500
description: 业务码为200代表成功获取
schema:
$ref: '#/definitions/controller.Response'
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/plan.PlanResponse'
type: object
summary: 获取计划详情
tags:
- 计划管理
@@ -553,9 +606,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 404, 500
description: 业务码为200代表更新成功
schema:
$ref: '#/definitions/controller.Response'
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/plan.PlanResponse'
type: object
summary: 更新计划
tags:
- 计划管理
@@ -572,7 +630,7 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 404, 500
description: 业务码为200代表成功启动计划
schema:
$ref: '#/definitions/controller.Response'
summary: 启动计划
@@ -591,7 +649,7 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 404, 500
description: 业务码为200代表成功停止计划
schema:
$ref: '#/definitions/controller.Response'
summary: 停止计划
@@ -613,9 +671,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 409, 500
description: 业务码为201代表创建成功
schema:
$ref: '#/definitions/controller.Response'
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/user.CreateUserResponse'
type: object
summary: 创建新用户
tags:
- 用户管理
@@ -635,9 +698,14 @@ paths:
- application/json
responses:
"200":
description: 业务失败具体错误码和信息见响应体例如400, 401, 500
description: 业务码为200代表登录成功
schema:
$ref: '#/definitions/controller.Response'
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/user.LoginResponse'
type: object
summary: 用户登录
tags:
- 用户管理