更新猪群对应猪栏接口变更

This commit is contained in:
2025-10-06 23:10:58 +08:00
parent aac0324616
commit 632bd20e7d
8 changed files with 680 additions and 60 deletions

View File

@@ -69,6 +69,8 @@ definitions:
updated_at:
type: string
type: object
dto.AssignEmptyPensToBatchRequest:
type: object
dto.CreateAreaControllerRequest:
properties:
location:
@@ -298,6 +300,22 @@ definitions:
example: testuser
type: string
type: object
dto.MovePigsIntoPenRequest:
properties:
quantity:
description: 移入猪只数量
minimum: 1
type: integer
remarks:
description: 备注
type: string
toPenID:
description: 目标猪栏ID
type: integer
required:
- quantity
- toPenID
type: object
dto.PenResponse:
properties:
capacity:
@@ -398,8 +416,6 @@ definitions:
- $ref: '#/definitions/models.PigBatchStatus'
description: 批次状态,可选
type: object
dto.PigBatchUpdatePensRequest:
type: object
dto.PigHouseResponse:
properties:
description:
@@ -450,6 +466,21 @@ definitions:
$ref: '#/definitions/dto.TaskResponse'
type: array
type: object
dto.ReclassifyPenToNewBatchRequest:
properties:
penID:
description: 待划拨的猪栏ID
type: integer
remarks:
description: 备注
type: string
toBatchID:
description: 目标猪批次ID
type: integer
required:
- penID
- toBatchID
type: object
dto.SubPlanResponse:
properties:
child_plan:
@@ -1373,6 +1404,57 @@ paths:
summary: 创建猪批次
tags:
- 猪批次管理
/api/v1/pig-batches/{batchID}/remove-pen/{penID}:
delete:
description: 将一个空闲猪栏从指定的猪批次中移除
parameters:
- description: 猪批次ID
in: path
name: batchID
required: true
type: integer
- description: 待移除的猪栏ID
in: path
name: penID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: 移除成功
schema:
$ref: '#/definitions/controller.Response'
summary: 从猪批次移除空栏
tags:
- 猪批次管理
/api/v1/pig-batches/{fromBatchID}/reclassify-pen:
post:
consumes:
- application/json
description: 将一个猪栏(连同其中的猪只)从一个批次整体划拨到另一个批次
parameters:
- description: 源猪批次ID
in: path
name: fromBatchID
required: true
type: integer
- description: 划拨请求信息 (包含目标批次ID、猪栏ID和备注)
in: body
name: body
required: true
schema:
$ref: '#/definitions/dto.ReclassifyPenToNewBatchRequest'
produces:
- application/json
responses:
"200":
description: 划拨成功
schema:
$ref: '#/definitions/controller.Response'
summary: 将猪栏划拨到新批次
tags:
- 猪批次管理
/api/v1/pig-batches/{id}:
delete:
description: 根据ID删除一个猪批次
@@ -1446,31 +1528,58 @@ paths:
summary: 更新猪批次
tags:
- 猪批次管理
/api/v1/pig-batches/{id}/pens:
put:
/api/v1/pig-batches/{id}/assign-pens:
post:
consumes:
- application/json
description: 更新指定猪批次当前关联的猪栏列表
description: 将一个或多个空闲猪栏分配给指定猪批次
parameters:
- description: 猪批次ID
in: path
name: id
required: true
type: integer
- description: 猪批次关联的猪栏ID列表
- description: 待分配的猪栏ID列表
in: body
name: body
required: true
schema:
$ref: '#/definitions/dto.PigBatchUpdatePensRequest'
$ref: '#/definitions/dto.AssignEmptyPensToBatchRequest'
produces:
- application/json
responses:
"200":
description: 更新成功
description: 分配成功
schema:
$ref: '#/definitions/controller.Response'
summary: 更新猪批次关联的猪
summary: 猪批次分配空
tags:
- 猪批次管理
/api/v1/pig-batches/{id}/move-pigs-into-pen:
post:
consumes:
- application/json
description: 将指定数量的猪只从批次的“虚拟库存”移入一个已分配的猪栏
parameters:
- description: 猪批次ID
in: path
name: id
required: true
type: integer
- description: 移入猪只请求信息 (包含目标猪栏ID、数量和备注)
in: body
name: body
required: true
schema:
$ref: '#/definitions/dto.MovePigsIntoPenRequest'
produces:
- application/json
responses:
"200":
description: 移入成功
schema:
$ref: '#/definitions/controller.Response'
summary: 将猪只从“虚拟库存”移入指定猪栏
tags:
- 猪批次管理
/api/v1/pig-houses: