平台侧发送和准备工作实现完成
This commit is contained in:
22
docs/docs.go
22
docs/docs.go
@@ -8399,10 +8399,6 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"executed_num": {
|
|
||||||
"description": "已执行步骤数",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"message": {
|
"message": {
|
||||||
"description": "状态消息",
|
"description": "状态消息",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -8410,10 +8406,6 @@ const docTemplate = `{
|
|||||||
"task_id": {
|
"task_id": {
|
||||||
"description": "OTA 升级任务ID",
|
"description": "OTA 升级任务ID",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
|
||||||
"total_num": {
|
|
||||||
"description": "总步骤数",
|
|
||||||
"type": "integer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -10516,20 +10508,24 @@ const docTemplate = `{
|
|||||||
"进行中",
|
"进行中",
|
||||||
"成功",
|
"成功",
|
||||||
"版本已是最新",
|
"版本已是最新",
|
||||||
|
"准备升级失败",
|
||||||
"预检失败",
|
"预检失败",
|
||||||
"下载或校验失败",
|
"下载或校验失败",
|
||||||
"固件回滚",
|
"固件回滚",
|
||||||
"超时",
|
"超时",
|
||||||
"平台内部错误"
|
"平台内部错误",
|
||||||
|
"手动停止"
|
||||||
],
|
],
|
||||||
"x-enum-comments": {
|
"x-enum-comments": {
|
||||||
"OTATaskStatusAlreadyUpToDate": "设备报告版本已是最新,未执行升级",
|
"OTATaskStatusAlreadyUpToDate": "设备报告版本已是最新,未执行升级",
|
||||||
"OTATaskStatusFailedDownload": "设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
"OTATaskStatusFailedDownload": "设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
||||||
"OTATaskStatusFailedPreCheck": "设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
"OTATaskStatusFailedPreCheck": "设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
||||||
|
"OTATaskStatusFailedPreparation": "平台在解压、生成清单等文件操作阶段发生错误",
|
||||||
"OTATaskStatusFailedRollback": "新固件启动失败,设备自动回滚",
|
"OTATaskStatusFailedRollback": "新固件启动失败,设备自动回滚",
|
||||||
"OTATaskStatusInProgress": "任务已下发,设备正在处理",
|
"OTATaskStatusInProgress": "任务已下发,设备正在处理",
|
||||||
"OTATaskStatusPending": "任务已创建,等待下发",
|
"OTATaskStatusPending": "任务已创建,等待下发",
|
||||||
"OTATaskStatusPlatformError": "平台处理过程中发生的非设备报告错误",
|
"OTATaskStatusPlatformError": "平台处理过程中发生的非设备报告错误",
|
||||||
|
"OTATaskStatusStopped": "手动停止",
|
||||||
"OTATaskStatusSuccess": "设备报告升级成功,新固件已运行",
|
"OTATaskStatusSuccess": "设备报告升级成功,新固件已运行",
|
||||||
"OTATaskStatusTimedOut": "平台在超时后仍未收到最终报告"
|
"OTATaskStatusTimedOut": "平台在超时后仍未收到最终报告"
|
||||||
},
|
},
|
||||||
@@ -10538,22 +10534,26 @@ const docTemplate = `{
|
|||||||
"任务已下发,设备正在处理",
|
"任务已下发,设备正在处理",
|
||||||
"设备报告升级成功,新固件已运行",
|
"设备报告升级成功,新固件已运行",
|
||||||
"设备报告版本已是最新,未执行升级",
|
"设备报告版本已是最新,未执行升级",
|
||||||
|
"平台在解压、生成清单等文件操作阶段发生错误",
|
||||||
"设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
"设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
||||||
"设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
"设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
||||||
"新固件启动失败,设备自动回滚",
|
"新固件启动失败,设备自动回滚",
|
||||||
"平台在超时后仍未收到最终报告",
|
"平台在超时后仍未收到最终报告",
|
||||||
"平台处理过程中发生的非设备报告错误"
|
"平台处理过程中发生的非设备报告错误",
|
||||||
|
"手动停止"
|
||||||
],
|
],
|
||||||
"x-enum-varnames": [
|
"x-enum-varnames": [
|
||||||
"OTATaskStatusPending",
|
"OTATaskStatusPending",
|
||||||
"OTATaskStatusInProgress",
|
"OTATaskStatusInProgress",
|
||||||
"OTATaskStatusSuccess",
|
"OTATaskStatusSuccess",
|
||||||
"OTATaskStatusAlreadyUpToDate",
|
"OTATaskStatusAlreadyUpToDate",
|
||||||
|
"OTATaskStatusFailedPreparation",
|
||||||
"OTATaskStatusFailedPreCheck",
|
"OTATaskStatusFailedPreCheck",
|
||||||
"OTATaskStatusFailedDownload",
|
"OTATaskStatusFailedDownload",
|
||||||
"OTATaskStatusFailedRollback",
|
"OTATaskStatusFailedRollback",
|
||||||
"OTATaskStatusTimedOut",
|
"OTATaskStatusTimedOut",
|
||||||
"OTATaskStatusPlatformError"
|
"OTATaskStatusPlatformError",
|
||||||
|
"OTATaskStatusStopped"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"models.Operator": {
|
"models.Operator": {
|
||||||
|
|||||||
@@ -8391,10 +8391,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"executed_num": {
|
|
||||||
"description": "已执行步骤数",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"message": {
|
"message": {
|
||||||
"description": "状态消息",
|
"description": "状态消息",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -8402,10 +8398,6 @@
|
|||||||
"task_id": {
|
"task_id": {
|
||||||
"description": "OTA 升级任务ID",
|
"description": "OTA 升级任务ID",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
|
||||||
"total_num": {
|
|
||||||
"description": "总步骤数",
|
|
||||||
"type": "integer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -10508,20 +10500,24 @@
|
|||||||
"进行中",
|
"进行中",
|
||||||
"成功",
|
"成功",
|
||||||
"版本已是最新",
|
"版本已是最新",
|
||||||
|
"准备升级失败",
|
||||||
"预检失败",
|
"预检失败",
|
||||||
"下载或校验失败",
|
"下载或校验失败",
|
||||||
"固件回滚",
|
"固件回滚",
|
||||||
"超时",
|
"超时",
|
||||||
"平台内部错误"
|
"平台内部错误",
|
||||||
|
"手动停止"
|
||||||
],
|
],
|
||||||
"x-enum-comments": {
|
"x-enum-comments": {
|
||||||
"OTATaskStatusAlreadyUpToDate": "设备报告版本已是最新,未执行升级",
|
"OTATaskStatusAlreadyUpToDate": "设备报告版本已是最新,未执行升级",
|
||||||
"OTATaskStatusFailedDownload": "设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
"OTATaskStatusFailedDownload": "设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
||||||
"OTATaskStatusFailedPreCheck": "设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
"OTATaskStatusFailedPreCheck": "设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
||||||
|
"OTATaskStatusFailedPreparation": "平台在解压、生成清单等文件操作阶段发生错误",
|
||||||
"OTATaskStatusFailedRollback": "新固件启动失败,设备自动回滚",
|
"OTATaskStatusFailedRollback": "新固件启动失败,设备自动回滚",
|
||||||
"OTATaskStatusInProgress": "任务已下发,设备正在处理",
|
"OTATaskStatusInProgress": "任务已下发,设备正在处理",
|
||||||
"OTATaskStatusPending": "任务已创建,等待下发",
|
"OTATaskStatusPending": "任务已创建,等待下发",
|
||||||
"OTATaskStatusPlatformError": "平台处理过程中发生的非设备报告错误",
|
"OTATaskStatusPlatformError": "平台处理过程中发生的非设备报告错误",
|
||||||
|
"OTATaskStatusStopped": "手动停止",
|
||||||
"OTATaskStatusSuccess": "设备报告升级成功,新固件已运行",
|
"OTATaskStatusSuccess": "设备报告升级成功,新固件已运行",
|
||||||
"OTATaskStatusTimedOut": "平台在超时后仍未收到最终报告"
|
"OTATaskStatusTimedOut": "平台在超时后仍未收到最终报告"
|
||||||
},
|
},
|
||||||
@@ -10530,22 +10526,26 @@
|
|||||||
"任务已下发,设备正在处理",
|
"任务已下发,设备正在处理",
|
||||||
"设备报告升级成功,新固件已运行",
|
"设备报告升级成功,新固件已运行",
|
||||||
"设备报告版本已是最新,未执行升级",
|
"设备报告版本已是最新,未执行升级",
|
||||||
|
"平台在解压、生成清单等文件操作阶段发生错误",
|
||||||
"设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
"设备报告升级前检查失败 (如拒绝降级、准备分区失败)",
|
||||||
"设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
"设备报告文件下载或校验失败 (包括清单文件和固件文件)",
|
||||||
"新固件启动失败,设备自动回滚",
|
"新固件启动失败,设备自动回滚",
|
||||||
"平台在超时后仍未收到最终报告",
|
"平台在超时后仍未收到最终报告",
|
||||||
"平台处理过程中发生的非设备报告错误"
|
"平台处理过程中发生的非设备报告错误",
|
||||||
|
"手动停止"
|
||||||
],
|
],
|
||||||
"x-enum-varnames": [
|
"x-enum-varnames": [
|
||||||
"OTATaskStatusPending",
|
"OTATaskStatusPending",
|
||||||
"OTATaskStatusInProgress",
|
"OTATaskStatusInProgress",
|
||||||
"OTATaskStatusSuccess",
|
"OTATaskStatusSuccess",
|
||||||
"OTATaskStatusAlreadyUpToDate",
|
"OTATaskStatusAlreadyUpToDate",
|
||||||
|
"OTATaskStatusFailedPreparation",
|
||||||
"OTATaskStatusFailedPreCheck",
|
"OTATaskStatusFailedPreCheck",
|
||||||
"OTATaskStatusFailedDownload",
|
"OTATaskStatusFailedDownload",
|
||||||
"OTATaskStatusFailedRollback",
|
"OTATaskStatusFailedRollback",
|
||||||
"OTATaskStatusTimedOut",
|
"OTATaskStatusTimedOut",
|
||||||
"OTATaskStatusPlatformError"
|
"OTATaskStatusPlatformError",
|
||||||
|
"OTATaskStatusStopped"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"models.Operator": {
|
"models.Operator": {
|
||||||
|
|||||||
@@ -1000,18 +1000,12 @@ definitions:
|
|||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/models.OTATaskStatus'
|
- $ref: '#/definitions/models.OTATaskStatus'
|
||||||
description: 当前阶段
|
description: 当前阶段
|
||||||
executed_num:
|
|
||||||
description: 已执行步骤数
|
|
||||||
type: integer
|
|
||||||
message:
|
message:
|
||||||
description: 状态消息
|
description: 状态消息
|
||||||
type: string
|
type: string
|
||||||
task_id:
|
task_id:
|
||||||
description: OTA 升级任务ID
|
description: OTA 升级任务ID
|
||||||
type: integer
|
type: integer
|
||||||
total_num:
|
|
||||||
description: 总步骤数
|
|
||||||
type: integer
|
|
||||||
type: object
|
type: object
|
||||||
dto.OtaUpgradeResponse:
|
dto.OtaUpgradeResponse:
|
||||||
properties:
|
properties:
|
||||||
@@ -2453,20 +2447,24 @@ definitions:
|
|||||||
- 进行中
|
- 进行中
|
||||||
- 成功
|
- 成功
|
||||||
- 版本已是最新
|
- 版本已是最新
|
||||||
|
- 准备升级失败
|
||||||
- 预检失败
|
- 预检失败
|
||||||
- 下载或校验失败
|
- 下载或校验失败
|
||||||
- 固件回滚
|
- 固件回滚
|
||||||
- 超时
|
- 超时
|
||||||
- 平台内部错误
|
- 平台内部错误
|
||||||
|
- 手动停止
|
||||||
type: string
|
type: string
|
||||||
x-enum-comments:
|
x-enum-comments:
|
||||||
OTATaskStatusAlreadyUpToDate: 设备报告版本已是最新,未执行升级
|
OTATaskStatusAlreadyUpToDate: 设备报告版本已是最新,未执行升级
|
||||||
OTATaskStatusFailedDownload: 设备报告文件下载或校验失败 (包括清单文件和固件文件)
|
OTATaskStatusFailedDownload: 设备报告文件下载或校验失败 (包括清单文件和固件文件)
|
||||||
OTATaskStatusFailedPreCheck: 设备报告升级前检查失败 (如拒绝降级、准备分区失败)
|
OTATaskStatusFailedPreCheck: 设备报告升级前检查失败 (如拒绝降级、准备分区失败)
|
||||||
|
OTATaskStatusFailedPreparation: 平台在解压、生成清单等文件操作阶段发生错误
|
||||||
OTATaskStatusFailedRollback: 新固件启动失败,设备自动回滚
|
OTATaskStatusFailedRollback: 新固件启动失败,设备自动回滚
|
||||||
OTATaskStatusInProgress: 任务已下发,设备正在处理
|
OTATaskStatusInProgress: 任务已下发,设备正在处理
|
||||||
OTATaskStatusPending: 任务已创建,等待下发
|
OTATaskStatusPending: 任务已创建,等待下发
|
||||||
OTATaskStatusPlatformError: 平台处理过程中发生的非设备报告错误
|
OTATaskStatusPlatformError: 平台处理过程中发生的非设备报告错误
|
||||||
|
OTATaskStatusStopped: 手动停止
|
||||||
OTATaskStatusSuccess: 设备报告升级成功,新固件已运行
|
OTATaskStatusSuccess: 设备报告升级成功,新固件已运行
|
||||||
OTATaskStatusTimedOut: 平台在超时后仍未收到最终报告
|
OTATaskStatusTimedOut: 平台在超时后仍未收到最终报告
|
||||||
x-enum-descriptions:
|
x-enum-descriptions:
|
||||||
@@ -2474,21 +2472,25 @@ definitions:
|
|||||||
- 任务已下发,设备正在处理
|
- 任务已下发,设备正在处理
|
||||||
- 设备报告升级成功,新固件已运行
|
- 设备报告升级成功,新固件已运行
|
||||||
- 设备报告版本已是最新,未执行升级
|
- 设备报告版本已是最新,未执行升级
|
||||||
|
- 平台在解压、生成清单等文件操作阶段发生错误
|
||||||
- 设备报告升级前检查失败 (如拒绝降级、准备分区失败)
|
- 设备报告升级前检查失败 (如拒绝降级、准备分区失败)
|
||||||
- 设备报告文件下载或校验失败 (包括清单文件和固件文件)
|
- 设备报告文件下载或校验失败 (包括清单文件和固件文件)
|
||||||
- 新固件启动失败,设备自动回滚
|
- 新固件启动失败,设备自动回滚
|
||||||
- 平台在超时后仍未收到最终报告
|
- 平台在超时后仍未收到最终报告
|
||||||
- 平台处理过程中发生的非设备报告错误
|
- 平台处理过程中发生的非设备报告错误
|
||||||
|
- 手动停止
|
||||||
x-enum-varnames:
|
x-enum-varnames:
|
||||||
- OTATaskStatusPending
|
- OTATaskStatusPending
|
||||||
- OTATaskStatusInProgress
|
- OTATaskStatusInProgress
|
||||||
- OTATaskStatusSuccess
|
- OTATaskStatusSuccess
|
||||||
- OTATaskStatusAlreadyUpToDate
|
- OTATaskStatusAlreadyUpToDate
|
||||||
|
- OTATaskStatusFailedPreparation
|
||||||
- OTATaskStatusFailedPreCheck
|
- OTATaskStatusFailedPreCheck
|
||||||
- OTATaskStatusFailedDownload
|
- OTATaskStatusFailedDownload
|
||||||
- OTATaskStatusFailedRollback
|
- OTATaskStatusFailedRollback
|
||||||
- OTATaskStatusTimedOut
|
- OTATaskStatusTimedOut
|
||||||
- OTATaskStatusPlatformError
|
- OTATaskStatusPlatformError
|
||||||
|
- OTATaskStatusStopped
|
||||||
models.Operator:
|
models.Operator:
|
||||||
enum:
|
enum:
|
||||||
- <
|
- <
|
||||||
|
|||||||
@@ -120,7 +120,5 @@ type OtaUpgradeResponse struct {
|
|||||||
type OtaUpgradeProgressResponse struct {
|
type OtaUpgradeProgressResponse struct {
|
||||||
TaskID uint32 `json:"task_id"` // OTA 升级任务ID
|
TaskID uint32 `json:"task_id"` // OTA 升级任务ID
|
||||||
CurrentStage models.OTATaskStatus `json:"current_stage"` // 当前阶段
|
CurrentStage models.OTATaskStatus `json:"current_stage"` // 当前阶段
|
||||||
ExecutedNum uint32 `json:"executed_num"` // 已执行步骤数
|
|
||||||
TotalNum uint32 `json:"total_num"` // 总步骤数
|
|
||||||
Message string `json:"message"` // 状态消息
|
Message string `json:"message"` // 状态消息
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ type AreaControllerService interface {
|
|||||||
type areaControllerService struct {
|
type areaControllerService struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
areaControllerRepo repository.AreaControllerRepository
|
areaControllerRepo repository.AreaControllerRepository
|
||||||
|
otaRepo repository.OtaRepository
|
||||||
thresholdAlarmService ThresholdAlarmService
|
thresholdAlarmService ThresholdAlarmService
|
||||||
otaService device.OtaService
|
otaService device.OtaService
|
||||||
}
|
}
|
||||||
@@ -45,12 +46,14 @@ type areaControllerService struct {
|
|||||||
func NewAreaControllerService(
|
func NewAreaControllerService(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
areaControllerRepo repository.AreaControllerRepository,
|
areaControllerRepo repository.AreaControllerRepository,
|
||||||
|
otaRepo repository.OtaRepository,
|
||||||
thresholdAlarmService ThresholdAlarmService,
|
thresholdAlarmService ThresholdAlarmService,
|
||||||
otaService device.OtaService,
|
otaService device.OtaService,
|
||||||
) AreaControllerService {
|
) AreaControllerService {
|
||||||
return &areaControllerService{
|
return &areaControllerService{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
areaControllerRepo: areaControllerRepo,
|
areaControllerRepo: areaControllerRepo,
|
||||||
|
otaRepo: otaRepo,
|
||||||
thresholdAlarmService: thresholdAlarmService,
|
thresholdAlarmService: thresholdAlarmService,
|
||||||
otaService: otaService,
|
otaService: otaService,
|
||||||
}
|
}
|
||||||
@@ -197,18 +200,27 @@ func (s *areaControllerService) StartUpgrade(ctx context.Context, areaController
|
|||||||
|
|
||||||
// GetUpgradeProgress 用于查询指定 OTA 任务的进度。
|
// GetUpgradeProgress 用于查询指定 OTA 任务的进度。
|
||||||
func (s *areaControllerService) GetUpgradeProgress(ctx context.Context, taskID uint32) (*dto.OtaUpgradeProgressResponse, error) {
|
func (s *areaControllerService) GetUpgradeProgress(ctx context.Context, taskID uint32) (*dto.OtaUpgradeProgressResponse, error) {
|
||||||
executed, total, currentStage, err := s.otaService.GetUpgradeProgress(ctx, taskID)
|
serviceCtx := logs.AddFuncName(ctx, s.ctx, "GetUpgradeProgress")
|
||||||
|
|
||||||
|
// 直接调用 otaRepo 查询任务状态
|
||||||
|
task, err := s.otaRepo.FindByID(serviceCtx, taskID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("获取升级进度失败: %w", err)
|
return nil, fmt.Errorf("查找 OTA 任务失败: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &dto.OtaUpgradeProgressResponse{
|
// 构造响应 DTO
|
||||||
TaskID: taskID,
|
response := &dto.OtaUpgradeProgressResponse{
|
||||||
CurrentStage: currentStage,
|
TaskID: task.ID,
|
||||||
ExecutedNum: executed,
|
CurrentStage: task.Status,
|
||||||
TotalNum: total,
|
Message: string(task.Status), // 默认使用状态作为消息
|
||||||
Message: fmt.Sprintf("当前状态: %s", currentStage),
|
}
|
||||||
}, nil
|
|
||||||
|
// 如果任务失败,使用更详细的错误信息
|
||||||
|
if task.ErrorMessage != "" {
|
||||||
|
response.Message = task.ErrorMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopUpgrade 用于请求停止一个正在进行的 OTA 升级任务。
|
// StopUpgrade 用于请求停止一个正在进行的 OTA 升级任务。
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ func initAppServices(ctx context.Context, infra *Infrastructure, domainServices
|
|||||||
areaControllerService := service.NewAreaControllerService(
|
areaControllerService := service.NewAreaControllerService(
|
||||||
logs.AddCompName(baseCtx, "AreaControllerService"),
|
logs.AddCompName(baseCtx, "AreaControllerService"),
|
||||||
infra.repos.areaControllerRepo,
|
infra.repos.areaControllerRepo,
|
||||||
|
infra.repos.otaRepo,
|
||||||
thresholdAlarmService,
|
thresholdAlarmService,
|
||||||
domainServices.otaService,
|
domainServices.otaService,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -82,11 +82,6 @@ type OtaService interface {
|
|||||||
// 返回创建的 OTA 任务 ID 和可能发生的错误。
|
// 返回创建的 OTA 任务 ID 和可能发生的错误。
|
||||||
StartUpgrade(ctx context.Context, areaControllerID uint32, firmwarePath string) (uint32, error)
|
StartUpgrade(ctx context.Context, areaControllerID uint32, firmwarePath string) (uint32, error)
|
||||||
|
|
||||||
// GetUpgradeProgress 用于查询指定 OTA 任务的进度。
|
|
||||||
// taskID: 要查询的 OTA 任务 ID。
|
|
||||||
// 返回 OTA 任务的已执行步骤数和总步骤数和当前阶段和可能发生的错误。
|
|
||||||
GetUpgradeProgress(ctx context.Context, taskID uint32) (executed, total uint32, CurrentStage models.OTATaskStatus, err error)
|
|
||||||
|
|
||||||
// StopUpgrade 用于请求停止一个正在进行的 OTA 升级任务。
|
// StopUpgrade 用于请求停止一个正在进行的 OTA 升级任务。
|
||||||
// taskID: 要停止的 OTA 任务 ID。
|
// taskID: 要停止的 OTA 任务 ID。
|
||||||
// 注意:这只是一个尽力而为的操作。如果设备已开始下载或处理,可能无法立即中止。
|
// 注意:这只是一个尽力而为的操作。如果设备已开始下载或处理,可能无法立即中止。
|
||||||
|
|||||||
@@ -210,11 +210,6 @@ func (o *otaServiceImpl) StartUpgrade(ctx context.Context, areaControllerID uint
|
|||||||
return task.ID, nil
|
return task.ID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *otaServiceImpl) GetUpgradeProgress(ctx context.Context, taskID uint32) (executed, total uint32, CurrentStage models.OTATaskStatus, err error) {
|
|
||||||
//TODO implement me
|
|
||||||
panic("implement me")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *otaServiceImpl) StopUpgrade(ctx context.Context, taskID uint32) error {
|
func (o *otaServiceImpl) StopUpgrade(ctx context.Context, taskID uint32) error {
|
||||||
serviceCtx, logger := logs.Trace(ctx, o.ctx, "StopUpgrade")
|
serviceCtx, logger := logs.Trace(ctx, o.ctx, "StopUpgrade")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user