重构设备控制器
This commit is contained in:
@@ -1 +1,37 @@
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/repository"
|
||||
)
|
||||
|
||||
// otaServiceImpl 是 OtaService 接口的实现。
|
||||
type otaServiceImpl struct {
|
||||
otaRepo repository.OtaRepository
|
||||
deviceRepo repository.DeviceRepository
|
||||
}
|
||||
|
||||
// NewOtaService 创建一个新的 OtaService 实例。
|
||||
func NewOtaService(otaRepo repository.OtaRepository, deviceRepo repository.DeviceRepository) OtaService {
|
||||
return &otaServiceImpl{
|
||||
otaRepo: otaRepo,
|
||||
deviceRepo: deviceRepo,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *otaServiceImpl) StartUpgrade(ctx context.Context, areaControllerID uint32, firmwarePath, targetVersion string) (uint32, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *otaServiceImpl) GetUpgradeProgress(ctx context.Context, taskID uint32) (status models.OTATaskStatus, err error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *otaServiceImpl) StopUpgrade(ctx context.Context, taskID uint32) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user