更新swag
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"schemes": [],
|
|
||||||
"swagger": "2.0",
|
"swagger": "2.0",
|
||||||
"info": {
|
"info": {
|
||||||
"description": "这是一个用于管理猪场设备的后端服务。",
|
"description": "这是一个用于管理猪场设备的后端服务。",
|
||||||
@@ -15,8 +14,6 @@
|
|||||||
},
|
},
|
||||||
"version": "1.0"
|
"version": "1.0"
|
||||||
},
|
},
|
||||||
"host": "",
|
|
||||||
"basePath": "",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"/api/v1/alarm/threshold/active-alarms": {
|
"/api/v1/alarm/threshold/active-alarms": {
|
||||||
"get": {
|
"get": {
|
||||||
@@ -3366,6 +3363,59 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/feed/recipes/{id}/ai-diagnose": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "使用AI对指定配方进行点评,并针对目标猪类型给出建议。",
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"饲料管理-配方"
|
||||||
|
],
|
||||||
|
"summary": "AI点评配方",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "配方ID",
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "猪类型ID",
|
||||||
|
"name": "pig_type_id",
|
||||||
|
"in": "query",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "业务码为200代表AI点评成功",
|
||||||
|
"schema": {
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/controller.Response"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/dto.ReviewRecipeResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/inventory/stock/adjust": {
|
"/api/v1/inventory/stock/adjust": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
@@ -9160,6 +9210,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"dto.ReviewRecipeResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"ai_model": {
|
||||||
|
"description": "使用的 AI 模型",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/models.AIModel"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"review_message": {
|
||||||
|
"description": "点评内容",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"dto.SellPigsRequest": {
|
"dto.SellPigsRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
@@ -10079,6 +10146,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.AIModel": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Gemini"
|
||||||
|
],
|
||||||
|
"x-enum-varnames": [
|
||||||
|
"AI_MODEL_GEMINI"
|
||||||
|
]
|
||||||
|
},
|
||||||
"models.AlarmCode": {
|
"models.AlarmCode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|||||||
@@ -327,6 +327,17 @@ import {PaginationDTO, Response} from '../enums';
|
|||||||
* @property {string} description - 新生成的配方描述
|
* @property {string} description - 新生成的配方描述
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {string} AIModel - AI模型枚举
|
||||||
|
* @enum {string}
|
||||||
|
* @property {"Gemini"} Gemini - Gemini模型
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {object} ReviewRecipeResponse
|
||||||
|
* @property {AIModel} ai_model - 使用的 AI 模型
|
||||||
|
* @property {string} review_message - 点评内容
|
||||||
|
*/
|
||||||
|
|
||||||
// --- API Functions ---
|
// --- API Functions ---
|
||||||
|
|
||||||
@@ -656,6 +667,16 @@ export const generatePrioritizedStockRecipe = (pigTypeId) => {
|
|||||||
return http.post(`/api/v1/feed/recipes/generate-prioritized-stock/${pigTypeId}`);
|
return http.post(`/api/v1/feed/recipes/generate-prioritized-stock/${pigTypeId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用AI对指定配方进行点评,并针对目标猪类型给出建议。
|
||||||
|
* @param {number} id - 配方ID
|
||||||
|
* @param {number} pigTypeId - 猪类型ID
|
||||||
|
* @returns {Promise<Response<ReviewRecipeResponse>>}
|
||||||
|
*/
|
||||||
|
export const aiDiagnoseRecipe = (id, pigTypeId) => {
|
||||||
|
return http.get(`/api/v1/feed/recipes/${id}/ai-diagnose`, {params: {pig_type_id: pigTypeId}});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
export const FeedApi = {
|
export const FeedApi = {
|
||||||
getNutrients,
|
getNutrients,
|
||||||
@@ -692,4 +713,5 @@ export const FeedApi = {
|
|||||||
deleteRecipe,
|
deleteRecipe,
|
||||||
generateRecipeFromAllMaterials,
|
generateRecipeFromAllMaterials,
|
||||||
generatePrioritizedStockRecipe,
|
generatePrioritizedStockRecipe,
|
||||||
|
aiDiagnoseRecipe,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -330,6 +330,14 @@ export const AlarmSourceType = {
|
|||||||
SYSTEM: '系统',
|
SYSTEM: '系统',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AI模型
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
export const AIModel = {
|
||||||
|
GEMINI: 'Gemini',
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作符
|
* 操作符
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
|
|||||||
Reference in New Issue
Block a user