更新swag
This commit is contained in:
@@ -10,8 +10,6 @@ import {PaginationDTO, Response} from '../enums';
|
||||
* @property {number} id
|
||||
* @property {string} name
|
||||
* @property {string} description
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
* @property {Array<NutrientRawMaterialDTO>} raw_materials - 包含此营养的原料列表
|
||||
*/
|
||||
|
||||
@@ -56,8 +54,6 @@ import {PaginationDTO, Response} from '../enums';
|
||||
* @property {number} id
|
||||
* @property {string} name
|
||||
* @property {string} description
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -97,8 +93,6 @@ import {PaginationDTO, Response} from '../enums';
|
||||
* @property {string} [appearance_features]
|
||||
* @property {string} [breed_advantages]
|
||||
* @property {string} [breed_disadvantages]
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -144,8 +138,6 @@ import {PaginationDTO, Response} from '../enums';
|
||||
* @property {string} nutrient_name
|
||||
* @property {number} min_requirement
|
||||
* @property {number} max_requirement
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -163,8 +155,6 @@ import {PaginationDTO, Response} from '../enums';
|
||||
* @property {number} [daily_gain_weight]
|
||||
* @property {number} [daily_feed_intake]
|
||||
* @property {Array<PigNutrientRequirementDTO>} pig_nutrient_requirements
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -212,14 +202,23 @@ import {PaginationDTO, Response} from '../enums';
|
||||
|
||||
// --- RawMaterial ---
|
||||
|
||||
/**
|
||||
* @typedef {object} RawMaterialNutrientItem
|
||||
* @property {number} nutrient_id - 营养素ID
|
||||
* @property {number} value - 含量值,必须大于等于0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} UpdateRawMaterialNutrientsRequest
|
||||
* @property {Array<RawMaterialNutrientItem>} nutrients
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} RawMaterialNutrientDTO
|
||||
* @property {number} id
|
||||
* @property {number} nutrient_id
|
||||
* @property {string} nutrient_name
|
||||
* @property {number} value
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -228,8 +227,6 @@ import {PaginationDTO, Response} from '../enums';
|
||||
* @property {string} name
|
||||
* @property {string} description
|
||||
* @property {Array<RawMaterialNutrientDTO>} raw_material_nutrients
|
||||
* @property {string} created_at
|
||||
* @property {string} updated_at
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -502,6 +499,16 @@ export const deleteRawMaterial = (id) => {
|
||||
return http.delete(`/api/v1/feed/raw-materials/${id}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* 全量更新原料的营养成分
|
||||
* @param {number} id - 原料ID
|
||||
* @param {UpdateRawMaterialNutrientsRequest} data - 新的营养成分列表
|
||||
* @returns {Promise<Response<RawMaterialResponse>>}
|
||||
*/
|
||||
export const updateRawMaterialNutrients = (id, data) => {
|
||||
return http.put(`/api/v1/feed/raw-materials/${id}/nutrients`, data);
|
||||
};
|
||||
|
||||
|
||||
export const FeedApi = {
|
||||
getNutrients,
|
||||
@@ -529,4 +536,5 @@ export const FeedApi = {
|
||||
getRawMaterialById,
|
||||
updateRawMaterial,
|
||||
deleteRawMaterial,
|
||||
updateRawMaterialNutrients,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user