实现修改原料营养信息

This commit is contained in:
2025-11-22 16:44:22 +08:00
parent f81635f997
commit 9aea487537
11 changed files with 411 additions and 165 deletions

View File

@@ -898,8 +898,6 @@ definitions:
type: object
dto.NutrientResponse:
properties:
created_at:
type: string
description:
type: string
id:
@@ -911,8 +909,6 @@ definitions:
items:
$ref: '#/definitions/dto.NutrientRawMaterialDTO'
type: array
updated_at:
type: string
type: object
dto.PaginationDTO:
properties:
@@ -959,16 +955,12 @@ definitions:
type: object
dto.PigAgeStageResponse:
properties:
created_at:
type: string
description:
type: string
id:
type: integer
name:
type: string
updated_at:
type: string
type: object
dto.PigBatchCreateDTO:
properties:
@@ -1094,8 +1086,6 @@ definitions:
type: string
breed_disadvantages:
type: string
created_at:
type: string
description:
type: string
id:
@@ -1104,8 +1094,6 @@ definitions:
type: string
parent_info:
type: string
updated_at:
type: string
type: object
dto.PigHouseResponse:
properties:
@@ -1118,8 +1106,6 @@ definitions:
type: object
dto.PigNutrientRequirementDTO:
properties:
created_at:
type: string
id:
type: integer
max_requirement:
@@ -1133,8 +1119,6 @@ definitions:
nutrient_name:
description: 营养素名称
type: string
updated_at:
type: string
type: object
dto.PigPurchaseDTO:
properties:
@@ -1252,8 +1236,6 @@ definitions:
breed_name:
description: 猪品种名称
type: string
created_at:
type: string
daily_feed_intake:
type: number
daily_gain_weight:
@@ -1275,8 +1257,6 @@ definitions:
items:
$ref: '#/definitions/dto.PigNutrientRequirementDTO'
type: array
updated_at:
type: string
type: object
dto.PlanExecutionLogDTO:
properties:
@@ -1346,8 +1326,6 @@ definitions:
type: object
dto.RawMaterialNutrientDTO:
properties:
created_at:
type: string
id:
type: integer
nutrient_id:
@@ -1355,16 +1333,24 @@ definitions:
nutrient_name:
description: 营养素名称
type: string
updated_at:
type: string
value:
description: 营养价值含量
type: number
type: object
dto.RawMaterialNutrientItem:
properties:
nutrient_id:
description: 营养素ID
type: integer
value:
description: 含量值必须大于等于0
minimum: 0
type: number
required:
- nutrient_id
type: object
dto.RawMaterialResponse:
properties:
created_at:
type: string
description:
type: string
id:
@@ -1376,8 +1362,6 @@ definitions:
items:
$ref: '#/definitions/dto.RawMaterialNutrientDTO'
type: array
updated_at:
type: string
type: object
dto.ReclassifyPenToNewBatchRequest:
properties:
@@ -1993,6 +1977,15 @@ definitions:
required:
- execution_type
type: object
dto.UpdateRawMaterialNutrientsRequest:
properties:
nutrients:
items:
$ref: '#/definitions/dto.RawMaterialNutrientItem'
type: array
required:
- nutrients
type: object
dto.UpdateRawMaterialRequest:
properties:
description:
@@ -4300,6 +4293,40 @@ paths:
summary: 更新原料
tags:
- 饲料管理
/api/v1/feed/raw-materials/{id}/nutrients:
put:
consumes:
- application/json
description: 根据原料ID替换其所有的营养成分信息。这是一个覆盖操作。
parameters:
- description: 原料ID
in: path
name: id
required: true
type: integer
- description: 新的营养成分列表
in: body
name: nutrients
required: true
schema:
$ref: '#/definitions/dto.UpdateRawMaterialNutrientsRequest'
produces:
- application/json
responses:
"200":
description: 业务码为200代表更新成功
schema:
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/dto.RawMaterialResponse'
type: object
security:
- BearerAuth: []
summary: 全量更新原料的营养成分
tags:
- 饲料管理
/api/v1/monitor/device-command-logs:
get:
description: 根据提供的过滤条件,分页获取设备命令日志