计划监控增加计划名

This commit is contained in:
2025-10-29 17:52:07 +08:00
parent 2910c9186a
commit af8689d627
9 changed files with 271 additions and 61 deletions

View File

@@ -998,7 +998,6 @@ const docTemplate = `{
},
{
"enum": [
7,
-1,
0,
1,
@@ -1008,12 +1007,12 @@ const docTemplate = `{
5,
-1,
5,
6
6,
7
],
"type": "integer",
"format": "int32",
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -1023,7 +1022,8 @@ const docTemplate = `{
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel"
"InvalidLevel",
"_numLevels"
],
"name": "level",
"in": "query"
@@ -3600,7 +3600,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "获取所有计划的列表",
"description": "获取所有计划的列表,支持按类型过滤和分页",
"produces": [
"application/json"
],
@@ -3608,6 +3608,26 @@ const docTemplate = `{
"计划管理"
],
"summary": "获取计划列表",
"parameters": [
{
"type": "integer",
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页大小",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"description": "计划类型 (all, custom, system),默认为 custom",
"name": "planType",
"in": "query"
}
],
"responses": {
"200": {
"description": "业务码为200代表成功获取列表",
@@ -3620,10 +3640,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.PlanResponse"
}
"$ref": "#/definitions/dto.ListPlansResponse"
}
}
}
@@ -3733,7 +3750,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "根据计划ID更新计划的详细信息。",
"description": "根据计划ID更新计划的详细信息。系统计划不允许修改。",
"consumes": [
"application/json"
],
@@ -3789,7 +3806,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "根据计划ID删除计划。软删除",
"description": "根据计划ID删除计划。软删除系统计划不允许删除。",
"produces": [
"application/json"
],
@@ -3823,7 +3840,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "根据计划ID启动一个计划的执行。",
"description": "根据计划ID启动一个计划的执行。系统计划不允许手动启动。",
"produces": [
"application/json"
],
@@ -3857,7 +3874,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "根据计划ID停止一个正在执行的计划。",
"description": "根据计划ID停止一个正在执行的计划。系统计划不能被停止。",
"produces": [
"application/json"
],
@@ -4154,6 +4171,7 @@ const docTemplate = `{
2001,
4000,
4001,
4003,
4004,
4009,
5000,
@@ -4163,6 +4181,7 @@ const docTemplate = `{
"CodeBadRequest": "请求参数错误",
"CodeConflict": "资源冲突",
"CodeCreated": "创建成功",
"CodeForbidden": "禁止访问",
"CodeInternalError": "服务器内部错误",
"CodeNotFound": "资源未找到",
"CodeServiceUnavailable": "服务不可用",
@@ -4174,6 +4193,7 @@ const docTemplate = `{
"创建成功",
"请求参数错误",
"未授权",
"禁止访问",
"资源未找到",
"资源冲突",
"服务器内部错误",
@@ -4184,6 +4204,7 @@ const docTemplate = `{
"CodeCreated",
"CodeBadRequest",
"CodeUnauthorized",
"CodeForbidden",
"CodeNotFound",
"CodeConflict",
"CodeInternalError",
@@ -4744,6 +4765,21 @@ const docTemplate = `{
}
}
},
"dto.ListPlansResponse": {
"type": "object",
"properties": {
"plans": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.PlanResponse"
}
},
"total": {
"type": "integer",
"example": 100
}
}
},
"dto.ListRawMaterialPurchaseResponse": {
"type": "object",
"properties": {
@@ -5439,6 +5475,9 @@ const docTemplate = `{
"plan_id": {
"type": "integer"
},
"plan_name": {
"type": "string"
},
"started_at": {
"type": "string"
},
@@ -5493,6 +5532,14 @@ const docTemplate = `{
"type": "string",
"example": "猪舍温度控制计划"
},
"plan_type": {
"allOf": [
{
"$ref": "#/definitions/models.PlanType"
}
],
"example": "自定义任务"
},
"status": {
"allOf": [
{
@@ -6737,6 +6784,17 @@ const docTemplate = `{
"PlanStatusFailed"
]
},
"models.PlanType": {
"type": "string",
"enum": [
"自定义任务",
"系统任务"
],
"x-enum-varnames": [
"PlanTypeCustom",
"PlanTypeSystem"
]
},
"models.SensorType": {
"type": "string",
"enum": [
@@ -6792,22 +6850,26 @@ const docTemplate = `{
"enum": [
"计划分析",
"等待",
"下料"
"下料",
"全量采集"
],
"x-enum-comments": {
"TaskPlanAnalysis": "解析Plan的Task列表并添加到待执行队列的特殊任务",
"TaskTypeFullCollection": "新增的全量采集任务",
"TaskTypeReleaseFeedWeight": "下料口释放指定重量任务",
"TaskTypeWaiting": "等待任务"
},
"x-enum-descriptions": [
"解析Plan的Task列表并添加到待执行队列的特殊任务",
"等待任务",
"下料口释放指定重量任务"
"下料口释放指定重量任务",
"新增的全量采集任务"
],
"x-enum-varnames": [
"TaskPlanAnalysis",
"TaskTypeWaiting",
"TaskTypeReleaseFeedWeight"
"TaskTypeReleaseFeedWeight",
"TaskTypeFullCollection"
]
},
"models.ValueDescriptor": {
@@ -6845,7 +6907,6 @@ const docTemplate = `{
"type": "integer",
"format": "int32",
"enum": [
7,
-1,
0,
1,
@@ -6855,10 +6916,10 @@ const docTemplate = `{
5,
-1,
5,
6
6,
7
],
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -6868,7 +6929,8 @@ const docTemplate = `{
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel"
"InvalidLevel",
"_numLevels"
]
}
},