更新swag

This commit is contained in:
2025-11-27 21:16:55 +08:00
parent 93f66d844c
commit b368c172c5
2 changed files with 64 additions and 8 deletions

View File

@@ -3186,6 +3186,52 @@
} }
} }
}, },
"/api/v1/feed/recipes/generate-prioritized-stock/{pig_type_id}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据指定的猪类型ID优先使用有库存的原料自动计算并创建一个配方。",
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "使用优先有库存原料的策略生成配方",
"parameters": [
{
"type": "integer",
"description": "猪类型ID",
"name": "pig_type_id",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"description": "业务码为201代表创建成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.GenerateRecipeResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/feed/recipes/{id}": { "/api/v1/feed/recipes/{id}": {
"get": { "get": {
"security": [ "security": [
@@ -3716,7 +3762,6 @@
}, },
{ {
"enum": [ "enum": [
7,
-1, -1,
0, 0,
1, 1,
@@ -3726,12 +3771,12 @@
5, 5,
-1, -1,
5, 5,
6 6,
7
], ],
"type": "integer", "type": "integer",
"format": "int32", "format": "int32",
"x-enum-varnames": [ "x-enum-varnames": [
"_numLevels",
"DebugLevel", "DebugLevel",
"InfoLevel", "InfoLevel",
"WarnLevel", "WarnLevel",
@@ -3741,7 +3786,8 @@
"FatalLevel", "FatalLevel",
"_minLevel", "_minLevel",
"_maxLevel", "_maxLevel",
"InvalidLevel" "InvalidLevel",
"_numLevels"
], ],
"name": "level", "name": "level",
"in": "query" "in": "query"
@@ -10620,7 +10666,6 @@
"type": "integer", "type": "integer",
"format": "int32", "format": "int32",
"enum": [ "enum": [
7,
-1, -1,
0, 0,
1, 1,
@@ -10630,10 +10675,10 @@
5, 5,
-1, -1,
5, 5,
6 6,
7
], ],
"x-enum-varnames": [ "x-enum-varnames": [
"_numLevels",
"DebugLevel", "DebugLevel",
"InfoLevel", "InfoLevel",
"WarnLevel", "WarnLevel",
@@ -10643,7 +10688,8 @@
"FatalLevel", "FatalLevel",
"_minLevel", "_minLevel",
"_maxLevel", "_maxLevel",
"InvalidLevel" "InvalidLevel",
"_numLevels"
] ]
} }
}, },

View File

@@ -647,6 +647,15 @@ export const generateRecipeFromAllMaterials = (pigTypeId) => {
return http.post(`/api/v1/feed/recipes/generate-from-all-materials/${pigTypeId}`); return http.post(`/api/v1/feed/recipes/generate-from-all-materials/${pigTypeId}`);
}; };
/**
* 根据指定的猪类型ID优先使用有库存的原料自动计算并创建一个配方。
* @param {number} pigTypeId - 猪类型ID
* @returns {Promise<Response<GenerateRecipeResponse>>}
*/
export const generatePrioritizedStockRecipe = (pigTypeId) => {
return http.post(`/api/v1/feed/recipes/generate-prioritized-stock/${pigTypeId}`);
};
export const FeedApi = { export const FeedApi = {
getNutrients, getNutrients,
@@ -682,4 +691,5 @@ export const FeedApi = {
updateRecipe, updateRecipe,
deleteRecipe, deleteRecipe,
generateRecipeFromAllMaterials, generateRecipeFromAllMaterials,
generatePrioritizedStockRecipe,
}; };