定义控制器和注册路由(服务层和领域层没实现)
This commit is contained in:
@@ -18,6 +18,13 @@ type AreaControllerService interface {
|
||||
ListAreaControllers(ctx context.Context) ([]*dto.AreaControllerResponse, error)
|
||||
UpdateAreaController(ctx context.Context, id uint32, req *dto.UpdateAreaControllerRequest) (*dto.AreaControllerResponse, error)
|
||||
DeleteAreaController(ctx context.Context, id uint32) error
|
||||
|
||||
// StartUpgrade 用于启动一个 OTA 升级任务。
|
||||
StartUpgrade(ctx context.Context, areaControllerID uint32, firmware *dto.OtaUpgradeRequest) (*dto.OtaUpgradeResponse, error)
|
||||
// GetUpgradeProgress 用于查询指定 OTA 任务的进度。
|
||||
GetUpgradeProgress(ctx context.Context, taskID uint32) (*dto.OtaUpgradeProgressResponse, error)
|
||||
// StopUpgrade 用于请求停止一个正在进行的 OTA 升级任务。
|
||||
StopUpgrade(ctx context.Context, taskID uint32) error
|
||||
}
|
||||
|
||||
// areaControllerService 是 AreaControllerService 接口的具体实现。
|
||||
@@ -138,3 +145,21 @@ func (s *areaControllerService) DeleteAreaController(ctx context.Context, id uin
|
||||
// 3. 执行删除
|
||||
return s.areaControllerRepo.Delete(serviceCtx, id)
|
||||
}
|
||||
|
||||
// StartUpgrade 用于启动一个 OTA 升级任务。
|
||||
func (s *areaControllerService) StartUpgrade(ctx context.Context, areaControllerID uint32, firmware *dto.OtaUpgradeRequest) (*dto.OtaUpgradeResponse, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
// GetUpgradeProgress 用于查询指定 OTA 任务的进度。
|
||||
func (s *areaControllerService) GetUpgradeProgress(ctx context.Context, taskID uint32) (*dto.OtaUpgradeProgressResponse, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
// StopUpgrade 用于请求停止一个正在进行的 OTA 升级任务。
|
||||
func (s *areaControllerService) StopUpgrade(ctx context.Context, taskID uint32) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user