添加区域主控相关路由
This commit is contained in:
@@ -2,53 +2,54 @@ definitions:
|
||||
controller.Response:
|
||||
properties:
|
||||
code:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.ResponseCode'
|
||||
description: 业务状态码
|
||||
type: integer
|
||||
data:
|
||||
description: 业务数据
|
||||
message:
|
||||
description: 提示信息
|
||||
type: string
|
||||
type: object
|
||||
device.CreateDeviceRequest:
|
||||
properties:
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
parent_id:
|
||||
type: integer
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
sub_type:
|
||||
$ref: '#/definitions/models.DeviceSubType'
|
||||
type:
|
||||
$ref: '#/definitions/models.DeviceType'
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
device.UpdateDeviceRequest:
|
||||
properties:
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
parent_id:
|
||||
type: integer
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
sub_type:
|
||||
$ref: '#/definitions/models.DeviceSubType'
|
||||
type:
|
||||
$ref: '#/definitions/models.DeviceType'
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse:
|
||||
controller.ResponseCode:
|
||||
enum:
|
||||
- 2000
|
||||
- 2001
|
||||
- 4000
|
||||
- 4001
|
||||
- 4004
|
||||
- 4009
|
||||
- 5000
|
||||
- 5003
|
||||
type: integer
|
||||
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:
|
||||
properties:
|
||||
created_at:
|
||||
type: string
|
||||
@@ -58,46 +59,106 @@ definitions:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
parent_id:
|
||||
type: integer
|
||||
network_id:
|
||||
type: string
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
status:
|
||||
type: string
|
||||
updated_at:
|
||||
type: string
|
||||
type: object
|
||||
device.CreateAreaControllerRequest:
|
||||
properties:
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
network_id:
|
||||
type: string
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- network_id
|
||||
type: object
|
||||
device.CreateDeviceRequest:
|
||||
properties:
|
||||
area_controller_id:
|
||||
type: integer
|
||||
device_template_id:
|
||||
type: integer
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
required:
|
||||
- area_controller_id
|
||||
- device_template_id
|
||||
- name
|
||||
type: object
|
||||
device.UpdateAreaControllerRequest:
|
||||
properties:
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
network_id:
|
||||
type: string
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- network_id
|
||||
type: object
|
||||
device.UpdateDeviceRequest:
|
||||
properties:
|
||||
area_controller_id:
|
||||
type: integer
|
||||
device_template_id:
|
||||
type: integer
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
required:
|
||||
- area_controller_id
|
||||
- device_template_id
|
||||
- name
|
||||
type: object
|
||||
git_huangwc_com_pig_pig-farm-controller_internal_app_controller_device.DeviceResponse:
|
||||
properties:
|
||||
area_controller_id:
|
||||
type: integer
|
||||
area_controller_name:
|
||||
type: string
|
||||
created_at:
|
||||
type: string
|
||||
device_template_id:
|
||||
type: integer
|
||||
device_template_name:
|
||||
type: string
|
||||
id:
|
||||
type: integer
|
||||
location:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
properties:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
sub_type:
|
||||
$ref: '#/definitions/models.DeviceSubType'
|
||||
type:
|
||||
$ref: '#/definitions/models.DeviceType'
|
||||
updated_at:
|
||||
type: string
|
||||
type: object
|
||||
models.DeviceSubType:
|
||||
enum:
|
||||
- ""
|
||||
- temperature
|
||||
- humidity
|
||||
- ammonia
|
||||
- weight
|
||||
- feed_valve
|
||||
- fan
|
||||
- water_curtain
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- SubTypeNone
|
||||
- SubTypeSensorTemp
|
||||
- SubTypeSensorHumidity
|
||||
- SubTypeSensorAmmonia
|
||||
- SubTypeSensorWeight
|
||||
- SubTypeValveFeed
|
||||
- SubTypeFan
|
||||
- SubTypeWaterCurtain
|
||||
models.DeviceType:
|
||||
enum:
|
||||
- area_controller
|
||||
- device
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- DeviceTypeAreaController
|
||||
- DeviceTypeDevice
|
||||
models.PlanContentType:
|
||||
enum:
|
||||
- sub_plans
|
||||
@@ -358,17 +419,46 @@ definitions:
|
||||
example: newuser
|
||||
type: string
|
||||
type: object
|
||||
user.LoginRequest:
|
||||
user.HistoryResponse:
|
||||
properties:
|
||||
password:
|
||||
example: password123
|
||||
action_type:
|
||||
example: 更新设备
|
||||
type: string
|
||||
description:
|
||||
example: 设备更新成功
|
||||
type: string
|
||||
target_resource: {}
|
||||
time:
|
||||
type: string
|
||||
user_id:
|
||||
example: 101
|
||||
type: integer
|
||||
username:
|
||||
example: testuser
|
||||
type: string
|
||||
type: object
|
||||
user.ListHistoryResponse:
|
||||
properties:
|
||||
history:
|
||||
items:
|
||||
$ref: '#/definitions/user.HistoryResponse'
|
||||
type: array
|
||||
total:
|
||||
example: 100
|
||||
type: integer
|
||||
type: object
|
||||
user.LoginRequest:
|
||||
properties:
|
||||
identifier:
|
||||
description: Identifier 可以是用户名、邮箱、手机号、微信号或飞书账号
|
||||
example: testuser
|
||||
type: string
|
||||
password:
|
||||
example: password123
|
||||
type: string
|
||||
required:
|
||||
- identifier
|
||||
- password
|
||||
- username
|
||||
type: object
|
||||
user.LoginResponse:
|
||||
properties:
|
||||
@@ -385,6 +475,125 @@ definitions:
|
||||
info:
|
||||
contact: {}
|
||||
paths:
|
||||
/api/v1/area-controllers:
|
||||
get:
|
||||
description: 获取系统中所有区域主控的列表
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.Response'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/device.AreaControllerResponse'
|
||||
type: array
|
||||
type: object
|
||||
summary: 获取所有区域主控列表
|
||||
tags:
|
||||
- 区域主控管理
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 根据提供的信息创建一个新区域主控
|
||||
parameters:
|
||||
- description: 区域主控信息
|
||||
in: body
|
||||
name: areaController
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/device.CreateAreaControllerRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.Response'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/device.AreaControllerResponse'
|
||||
type: object
|
||||
summary: 创建新区域主控
|
||||
tags:
|
||||
- 区域主控管理
|
||||
/api/v1/area-controllers/{id}:
|
||||
delete:
|
||||
description: 根据ID删除一个区域主控(软删除)
|
||||
parameters:
|
||||
- description: 区域主控ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/controller.Response'
|
||||
summary: 删除区域主控
|
||||
tags:
|
||||
- 区域主控管理
|
||||
get:
|
||||
description: 根据ID获取单个区域主控的详细信息
|
||||
parameters:
|
||||
- description: 区域主控ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.Response'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/device.AreaControllerResponse'
|
||||
type: object
|
||||
summary: 获取区域主控信息
|
||||
tags:
|
||||
- 区域主控管理
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 根据ID更新一个已存在的区域主控信息
|
||||
parameters:
|
||||
- description: 区域主控ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: 要更新的区域主控信息
|
||||
in: body
|
||||
name: areaController
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/device.UpdateAreaControllerRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.Response'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/device.AreaControllerResponse'
|
||||
type: object
|
||||
summary: 更新区域主控信息
|
||||
tags:
|
||||
- 区域主控管理
|
||||
/api/v1/devices:
|
||||
get:
|
||||
description: 获取系统中所有设备的列表
|
||||
@@ -550,7 +759,7 @@ paths:
|
||||
- 计划管理
|
||||
/api/v1/plans/{id}:
|
||||
delete:
|
||||
description: 根据计划ID删除计划。
|
||||
description: 根据计划ID删除计划。(软删除)
|
||||
parameters:
|
||||
- description: 计划ID
|
||||
in: path
|
||||
@@ -686,11 +895,49 @@ paths:
|
||||
summary: 创建新用户
|
||||
tags:
|
||||
- 用户管理
|
||||
/api/v1/users/{id}/history:
|
||||
get:
|
||||
description: 根据用户ID,分页获取该用户的操作审计日志。
|
||||
parameters:
|
||||
- description: 用户ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- default: 1
|
||||
description: 页码
|
||||
in: query
|
||||
name: page
|
||||
type: integer
|
||||
- default: 10
|
||||
description: 每页大小
|
||||
in: query
|
||||
name: page_size
|
||||
type: integer
|
||||
- description: 按操作类型过滤
|
||||
in: query
|
||||
name: action_type
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: 业务码为200代表成功获取
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.Response'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/user.ListHistoryResponse'
|
||||
type: object
|
||||
summary: 获取指定用户的操作历史
|
||||
tags:
|
||||
- 用户管理
|
||||
/api/v1/users/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 用户使用用户名和密码登录,成功后返回 JWT 令牌。
|
||||
description: 用户可以使用用户名、邮箱、手机号、微信号或飞书账号进行登录,成功后返回 JWT 令牌。
|
||||
parameters:
|
||||
- description: 登录凭证
|
||||
in: body
|
||||
|
||||
Reference in New Issue
Block a user