Files
pig-farm-controller/internal/domain/device/ota_service.go

38 lines
1.0 KiB
Go

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 string) (uint32, error) {
//TODO implement me
panic("implement me")
}
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 {
//TODO implement me
panic("implement me")
}