mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: implement diagnostics endpoint (resolve #225)
This commit is contained in:
23
services/diagnostics.go
Normal file
23
services/diagnostics.go
Normal file
@ -0,0 +1,23 @@
|
||||
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) {
|
||||
return srv.repository.Insert(diagnostics)
|
||||
}
|
Reference in New Issue
Block a user