2021-08-07 11:16:50 +03:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/muety/wakapi/config"
|
|
|
|
"github.com/muety/wakapi/models"
|
|
|
|
"github.com/muety/wakapi/repositories"
|
|
|
|
)
|
|
|
|
|
|
|
|
type DiagnosticsService struct {
|
|
|
|
config *config.Config
|
|
|
|
repository repositories.IDiagnosticsRepository
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDiagnosticsService(diagnosticsRepo repositories.IDiagnosticsRepository) *DiagnosticsService {
|
|
|
|
return &DiagnosticsService{
|
|
|
|
config: config.Get(),
|
|
|
|
repository: diagnosticsRepo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (srv *DiagnosticsService) Create(diagnostics *models.Diagnostics) (*models.Diagnostics, error) {
|
2022-05-13 17:12:18 +03:00
|
|
|
diagnostics.ID = 0
|
2021-08-07 11:16:50 +03:00
|
|
|
return srv.repository.Insert(diagnostics)
|
|
|
|
}
|