实现修改猪营养需求
This commit is contained in:
110
docs/docs.go
110
docs/docs.go
@@ -2653,6 +2653,64 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feed/pig-types/{id}/nutrient-requirements": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "根据猪类型ID,替换其所有的营养需求信息。这是一个覆盖操作。",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"饲料管理"
|
||||
],
|
||||
"summary": "全量更新猪类型的营养需求",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "猪类型ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "新的营养需求列表",
|
||||
"name": "nutrientRequirements",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.UpdatePigTypeNutrientRequirementsRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "业务码为200代表更新成功",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/controller.Response"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/dto.PigTypeResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feed/raw-materials": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -3144,6 +3202,7 @@ const docTemplate = `{
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
7,
|
||||
-1,
|
||||
0,
|
||||
1,
|
||||
@@ -3153,12 +3212,12 @@ const docTemplate = `{
|
||||
5,
|
||||
-1,
|
||||
5,
|
||||
6,
|
||||
7
|
||||
6
|
||||
],
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-enum-varnames": [
|
||||
"_numLevels",
|
||||
"DebugLevel",
|
||||
"InfoLevel",
|
||||
"WarnLevel",
|
||||
@@ -3168,8 +3227,7 @@ const docTemplate = `{
|
||||
"FatalLevel",
|
||||
"_minLevel",
|
||||
"_maxLevel",
|
||||
"InvalidLevel",
|
||||
"_numLevels"
|
||||
"InvalidLevel"
|
||||
],
|
||||
"name": "level",
|
||||
"in": "query"
|
||||
@@ -7764,6 +7822,28 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.PigNutrientRequirementItem": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"nutrient_id"
|
||||
],
|
||||
"properties": {
|
||||
"max_requirement": {
|
||||
"description": "最高营养需求量",
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
},
|
||||
"min_requirement": {
|
||||
"description": "最低营养需求量",
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
},
|
||||
"nutrient_id": {
|
||||
"description": "营养素ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.PigPurchaseDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -8933,6 +9013,20 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePigTypeNutrientRequirementsRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"nutrient_requirements"
|
||||
],
|
||||
"properties": {
|
||||
"nutrient_requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/dto.PigNutrientRequirementItem"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePigTypeRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -9705,6 +9799,7 @@ const docTemplate = `{
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"enum": [
|
||||
7,
|
||||
-1,
|
||||
0,
|
||||
1,
|
||||
@@ -9714,10 +9809,10 @@ const docTemplate = `{
|
||||
5,
|
||||
-1,
|
||||
5,
|
||||
6,
|
||||
7
|
||||
6
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"_numLevels",
|
||||
"DebugLevel",
|
||||
"InfoLevel",
|
||||
"WarnLevel",
|
||||
@@ -9727,8 +9822,7 @@ const docTemplate = `{
|
||||
"FatalLevel",
|
||||
"_minLevel",
|
||||
"_maxLevel",
|
||||
"InvalidLevel",
|
||||
"_numLevels"
|
||||
"InvalidLevel"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2645,6 +2645,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feed/pig-types/{id}/nutrient-requirements": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "根据猪类型ID,替换其所有的营养需求信息。这是一个覆盖操作。",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"饲料管理"
|
||||
],
|
||||
"summary": "全量更新猪类型的营养需求",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "猪类型ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "新的营养需求列表",
|
||||
"name": "nutrientRequirements",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.UpdatePigTypeNutrientRequirementsRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "业务码为200代表更新成功",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/controller.Response"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/dto.PigTypeResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feed/raw-materials": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -3136,6 +3194,7 @@
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
7,
|
||||
-1,
|
||||
0,
|
||||
1,
|
||||
@@ -3145,12 +3204,12 @@
|
||||
5,
|
||||
-1,
|
||||
5,
|
||||
6,
|
||||
7
|
||||
6
|
||||
],
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-enum-varnames": [
|
||||
"_numLevels",
|
||||
"DebugLevel",
|
||||
"InfoLevel",
|
||||
"WarnLevel",
|
||||
@@ -3160,8 +3219,7 @@
|
||||
"FatalLevel",
|
||||
"_minLevel",
|
||||
"_maxLevel",
|
||||
"InvalidLevel",
|
||||
"_numLevels"
|
||||
"InvalidLevel"
|
||||
],
|
||||
"name": "level",
|
||||
"in": "query"
|
||||
@@ -7756,6 +7814,28 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.PigNutrientRequirementItem": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"nutrient_id"
|
||||
],
|
||||
"properties": {
|
||||
"max_requirement": {
|
||||
"description": "最高营养需求量",
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
},
|
||||
"min_requirement": {
|
||||
"description": "最低营养需求量",
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
},
|
||||
"nutrient_id": {
|
||||
"description": "营养素ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.PigPurchaseDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -8925,6 +9005,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePigTypeNutrientRequirementsRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"nutrient_requirements"
|
||||
],
|
||||
"properties": {
|
||||
"nutrient_requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/dto.PigNutrientRequirementItem"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePigTypeRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -9697,6 +9791,7 @@
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"enum": [
|
||||
7,
|
||||
-1,
|
||||
0,
|
||||
1,
|
||||
@@ -9706,10 +9801,10 @@
|
||||
5,
|
||||
-1,
|
||||
5,
|
||||
6,
|
||||
7
|
||||
6
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"_numLevels",
|
||||
"DebugLevel",
|
||||
"InfoLevel",
|
||||
"WarnLevel",
|
||||
@@ -9719,8 +9814,7 @@
|
||||
"FatalLevel",
|
||||
"_minLevel",
|
||||
"_maxLevel",
|
||||
"InvalidLevel",
|
||||
"_numLevels"
|
||||
"InvalidLevel"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1120,6 +1120,22 @@ definitions:
|
||||
description: 营养素名称
|
||||
type: string
|
||||
type: object
|
||||
dto.PigNutrientRequirementItem:
|
||||
properties:
|
||||
max_requirement:
|
||||
description: 最高营养需求量
|
||||
minimum: 0
|
||||
type: number
|
||||
min_requirement:
|
||||
description: 最低营养需求量
|
||||
minimum: 0
|
||||
type: number
|
||||
nutrient_id:
|
||||
description: 营养素ID
|
||||
type: integer
|
||||
required:
|
||||
- nutrient_id
|
||||
type: object
|
||||
dto.PigPurchaseDTO:
|
||||
properties:
|
||||
created_at:
|
||||
@@ -1913,6 +1929,15 @@ definitions:
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
dto.UpdatePigTypeNutrientRequirementsRequest:
|
||||
properties:
|
||||
nutrient_requirements:
|
||||
items:
|
||||
$ref: '#/definitions/dto.PigNutrientRequirementItem'
|
||||
type: array
|
||||
required:
|
||||
- nutrient_requirements
|
||||
type: object
|
||||
dto.UpdatePigTypeRequest:
|
||||
properties:
|
||||
age_stage_id:
|
||||
@@ -2510,6 +2535,7 @@ definitions:
|
||||
- PlanTypeFilterSystem
|
||||
zapcore.Level:
|
||||
enum:
|
||||
- 7
|
||||
- -1
|
||||
- 0
|
||||
- 1
|
||||
@@ -2520,10 +2546,10 @@ definitions:
|
||||
- -1
|
||||
- 5
|
||||
- 6
|
||||
- 7
|
||||
format: int32
|
||||
type: integer
|
||||
x-enum-varnames:
|
||||
- _numLevels
|
||||
- DebugLevel
|
||||
- InfoLevel
|
||||
- WarnLevel
|
||||
@@ -2534,7 +2560,6 @@ definitions:
|
||||
- _minLevel
|
||||
- _maxLevel
|
||||
- InvalidLevel
|
||||
- _numLevels
|
||||
info:
|
||||
contact:
|
||||
email: divano@example.com
|
||||
@@ -4145,6 +4170,40 @@ paths:
|
||||
summary: 更新猪类型
|
||||
tags:
|
||||
- 饲料管理
|
||||
/api/v1/feed/pig-types/{id}/nutrient-requirements:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 根据猪类型ID,替换其所有的营养需求信息。这是一个覆盖操作。
|
||||
parameters:
|
||||
- description: 猪类型ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: 新的营养需求列表
|
||||
in: body
|
||||
name: nutrientRequirements
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.UpdatePigTypeNutrientRequirementsRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: 业务码为200代表更新成功
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/controller.Response'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/dto.PigTypeResponse'
|
||||
type: object
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 全量更新猪类型的营养需求
|
||||
tags:
|
||||
- 饲料管理
|
||||
/api/v1/feed/raw-materials:
|
||||
get:
|
||||
description: 获取所有原料的列表,支持分页和过滤。
|
||||
@@ -4425,6 +4484,7 @@ paths:
|
||||
name: end_time
|
||||
type: string
|
||||
- enum:
|
||||
- 7
|
||||
- -1
|
||||
- 0
|
||||
- 1
|
||||
@@ -4435,12 +4495,12 @@ paths:
|
||||
- -1
|
||||
- 5
|
||||
- 6
|
||||
- 7
|
||||
format: int32
|
||||
in: query
|
||||
name: level
|
||||
type: integer
|
||||
x-enum-varnames:
|
||||
- _numLevels
|
||||
- DebugLevel
|
||||
- InfoLevel
|
||||
- WarnLevel
|
||||
@@ -4451,7 +4511,6 @@ paths:
|
||||
- _minLevel
|
||||
- _maxLevel
|
||||
- InvalidLevel
|
||||
- _numLevels
|
||||
- enum:
|
||||
- 邮件
|
||||
- 企业微信
|
||||
|
||||
Reference in New Issue
Block a user