更新swag

This commit is contained in:
2025-11-24 13:44:41 +08:00
parent cd27d2242d
commit 72ea3fe634
2 changed files with 537 additions and 0 deletions

View File

@@ -3016,6 +3016,252 @@
}
}
},
"/api/v1/feed/recipes": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "获取所有配方的列表,支持分页和过滤。",
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "获取配方列表",
"parameters": [
{
"type": "string",
"description": "按名称模糊查询",
"name": "name",
"in": "query"
},
{
"type": "string",
"description": "排序字段,例如 \"id DESC\"",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "业务码为200代表成功获取列表",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListRecipeResponse"
}
}
}
]
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "创建一个新的配方,包含其原料组成。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "创建配方",
"parameters": [
{
"description": "配方信息",
"name": "recipe",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.CreateRecipeRequest"
}
}
],
"responses": {
"200": {
"description": "业务码为201代表创建成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.RecipeResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/feed/recipes/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID获取单个配方的详细信息。",
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "获取配方详情",
"parameters": [
{
"type": "integer",
"description": "配方ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "业务码为200代表成功获取",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.RecipeResponse"
}
}
}
]
}
}
}
},
"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": "recipe",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UpdateRecipeRequest"
}
}
],
"responses": {
"200": {
"description": "业务码为200代表更新成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.RecipeResponse"
}
}
}
]
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID删除配方。",
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "删除配方",
"parameters": [
{
"type": "integer",
"description": "配方ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "业务码为200代表删除成功",
"schema": {
"$ref": "#/definitions/controller.Response"
}
}
}
}
},
"/api/v1/monitor/device-command-logs": {
"get": {
"security": [
@@ -6756,6 +7002,31 @@
}
}
},
"dto.CreateRecipeRequest": {
"type": "object",
"required": [
"name"
],
"properties": {
"description": {
"description": "配方描述",
"type": "string",
"maxLength": 255
},
"name": {
"description": "配方名称",
"type": "string",
"maxLength": 100
},
"recipe_ingredients": {
"description": "配方原料组成",
"type": "array",
"items": {
"$ref": "#/definitions/dto.RecipeIngredientDto"
}
}
}
},
"dto.CreateUserRequest": {
"type": "object",
"required": [
@@ -7236,6 +7507,20 @@
}
}
},
"dto.ListRecipeResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.RecipeResponse"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListSensorDataResponse": {
"type": "object",
"properties": {
@@ -8209,6 +8494,44 @@
}
}
},
"dto.RecipeIngredientDto": {
"type": "object",
"required": [
"raw_material_id"
],
"properties": {
"percentage": {
"description": "原料在配方中的百分比 (0-1之间)",
"type": "number",
"maximum": 1,
"minimum": 0
},
"raw_material_id": {
"description": "原料ID",
"type": "integer"
}
}
},
"dto.RecipeResponse": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"recipe_ingredients": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.RecipeIngredientDto"
}
}
}
},
"dto.ReclassifyPenToNewBatchRequest": {
"type": "object",
"required": [
@@ -9145,6 +9468,31 @@
}
}
},
"dto.UpdateRecipeRequest": {
"type": "object",
"required": [
"name"
],
"properties": {
"description": {
"description": "配方描述",
"type": "string",
"maxLength": 255
},
"name": {
"description": "配方名称",
"type": "string",
"maxLength": 100
},
"recipe_ingredients": {
"description": "配方原料组成",
"type": "array",
"items": {
"$ref": "#/definitions/dto.RecipeIngredientDto"
}
}
}
},
"dto.UserActionLogDTO": {
"type": "object",
"properties": {