删除原有食物逻辑和模型

新增原料和营养价值表和原料库存日志和营养表定义
This commit is contained in:
2025-11-18 22:22:31 +08:00
parent 200a358933
commit e1399be538
15 changed files with 289 additions and 1898 deletions

View File

@@ -56,13 +56,13 @@ const docTemplate = `{
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -172,13 +172,13 @@ const docTemplate = `{
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -453,13 +453,13 @@ const docTemplate = `{
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -740,13 +740,13 @@ const docTemplate = `{
"parameters": [
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -1719,85 +1719,6 @@ const docTemplate = `{
}
}
},
"/api/v1/monitor/feed-usage-records": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据提供的过滤条件,分页获取饲料使用记录",
"produces": [
"application/json"
],
"tags": [
"数据监控"
],
"summary": "获取饲料使用记录列表",
"parameters": [
{
"type": "string",
"name": "end_time",
"in": "query"
},
{
"type": "integer",
"name": "feed_formula_id",
"in": "query"
},
{
"type": "integer",
"name": "operator_id",
"in": "query"
},
{
"type": "string",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"name": "pen_id",
"in": "query"
},
{
"type": "string",
"name": "start_time",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListFeedUsageRecordResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/monitor/medication-logs": {
"get": {
"security": [
@@ -1905,6 +1826,7 @@ const docTemplate = `{
},
{
"enum": [
7,
-1,
0,
1,
@@ -1914,12 +1836,12 @@ const docTemplate = `{
5,
-1,
5,
6,
7
6
],
"type": "integer",
"format": "int32",
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -1929,8 +1851,7 @@ const docTemplate = `{
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel",
"_numLevels"
"InvalidLevel"
],
"name": "level",
"in": "query"
@@ -2588,159 +2509,6 @@ const docTemplate = `{
}
}
},
"/api/v1/monitor/raw-material-purchases": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据提供的过滤条件,分页获取原料采购记录",
"produces": [
"application/json"
],
"tags": [
"数据监控"
],
"summary": "获取原料采购记录列表",
"parameters": [
{
"type": "string",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"name": "raw_material_id",
"in": "query"
},
{
"type": "string",
"name": "start_time",
"in": "query"
},
{
"type": "string",
"name": "supplier",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListRawMaterialPurchaseResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/monitor/raw-material-stock-logs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据提供的过滤条件,分页获取原料库存日志",
"produces": [
"application/json"
],
"tags": [
"数据监控"
],
"summary": "获取原料库存日志列表",
"parameters": [
{
"type": "string",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"name": "raw_material_id",
"in": "query"
},
{
"type": "integer",
"name": "source_id",
"in": "query"
},
{
"type": "string",
"name": "source_type",
"in": "query"
},
{
"type": "string",
"name": "start_time",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListRawMaterialStockLogResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/monitor/sensor-data": {
"get": {
"security": [
@@ -5645,49 +5413,6 @@ const docTemplate = `{
}
}
},
"dto.FeedFormulaDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.FeedUsageRecordDTO": {
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"feed_formula": {
"$ref": "#/definitions/dto.FeedFormulaDTO"
},
"feed_formula_id": {
"type": "integer"
},
"id": {
"type": "integer"
},
"operator_id": {
"type": "integer"
},
"pen": {
"$ref": "#/definitions/dto.PenDTO"
},
"pen_id": {
"type": "integer"
},
"recorded_at": {
"type": "string"
},
"remarks": {
"type": "string"
}
}
},
"dto.HistoricalAlarmDTO": {
"type": "object",
"properties": {
@@ -5782,20 +5507,6 @@ const docTemplate = `{
}
}
},
"dto.ListFeedUsageRecordResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.FeedUsageRecordDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListHistoricalAlarmResponse": {
"type": "object",
"properties": {
@@ -5951,34 +5662,6 @@ const docTemplate = `{
}
}
},
"dto.ListRawMaterialPurchaseResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.RawMaterialPurchaseDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListRawMaterialStockLogResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.RawMaterialStockLogDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListSensorDataResponse": {
"type": "object",
"properties": {
@@ -6216,17 +5899,6 @@ const docTemplate = `{
}
}
},
"dto.PenDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.PenResponse": {
"type": "object",
"properties": {
@@ -6733,75 +6405,6 @@ const docTemplate = `{
}
}
},
"dto.RawMaterialDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.RawMaterialPurchaseDTO": {
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"purchase_date": {
"type": "string"
},
"raw_material": {
"$ref": "#/definitions/dto.RawMaterialDTO"
},
"raw_material_id": {
"type": "integer"
},
"supplier": {
"type": "string"
},
"total_price": {
"type": "number"
},
"unit_price": {
"type": "number"
}
}
},
"dto.RawMaterialStockLogDTO": {
"type": "object",
"properties": {
"change_amount": {
"type": "number"
},
"happened_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"raw_material_id": {
"type": "integer"
},
"remarks": {
"type": "string"
},
"source_id": {
"type": "integer"
},
"source_type": {
"$ref": "#/definitions/models.StockLogSourceType"
}
}
},
"dto.ReclassifyPenToNewBatchRequest": {
"type": "object",
"required": [
@@ -8140,13 +7743,13 @@ const docTemplate = `{
"models.SeverityLevel": {
"type": "string",
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"x-enum-varnames": [
"DebugLevel",
@@ -8158,25 +7761,6 @@ const docTemplate = `{
"FatalLevel"
]
},
"models.StockLogSourceType": {
"type": "string",
"enum": [
"采购入库",
"饲喂出库",
"变质出库",
"售卖出库",
"杂用领取",
"手动盘点"
],
"x-enum-varnames": [
"StockLogSourcePurchase",
"StockLogSourceFeeding",
"StockLogSourceDeteriorate",
"StockLogSourceSale",
"StockLogSourceMiscellaneous",
"StockLogSourceManual"
]
},
"models.TaskType": {
"type": "string",
"enum": [
@@ -8185,6 +7769,7 @@ const docTemplate = `{
"下料",
"全量采集",
"告警通知",
"通知刷新",
"设备阈值检查",
"区域阈值检查"
],
@@ -8194,6 +7779,7 @@ const docTemplate = `{
"TaskTypeAreaCollectorThresholdCheck": "区域阈值检查任务",
"TaskTypeDeviceThresholdCheck": "设备阈值检查任务",
"TaskTypeFullCollection": "新增的全量采集任务",
"TaskTypeNotificationRefresh": "通知刷新任务",
"TaskTypeReleaseFeedWeight": "下料口释放指定重量任务",
"TaskTypeWaiting": "等待任务"
},
@@ -8203,6 +7789,7 @@ const docTemplate = `{
"下料口释放指定重量任务",
"新增的全量采集任务",
"告警通知任务",
"通知刷新任务",
"设备阈值检查任务",
"区域阈值检查任务"
],
@@ -8212,6 +7799,7 @@ const docTemplate = `{
"TaskTypeReleaseFeedWeight",
"TaskTypeFullCollection",
"TaskTypeAlarmNotification",
"TaskTypeNotificationRefresh",
"TaskTypeDeviceThresholdCheck",
"TaskTypeAreaCollectorThresholdCheck"
]
@@ -8249,6 +7837,7 @@ const docTemplate = `{
"type": "integer",
"format": "int32",
"enum": [
7,
-1,
0,
1,
@@ -8258,10 +7847,10 @@ const docTemplate = `{
5,
-1,
5,
6,
7
6
],
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -8271,8 +7860,7 @@ const docTemplate = `{
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel",
"_numLevels"
"InvalidLevel"
]
}
},