mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
19 lines
403 B
Go
19 lines
403 B
Go
|
package repositories
|
||
|
|
||
|
import (
|
||
|
"github.com/muety/wakapi/models"
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
type DiagnosticsRepository struct {
|
||
|
db *gorm.DB
|
||
|
}
|
||
|
|
||
|
func NewDiagnosticsRepository(db *gorm.DB) *DiagnosticsRepository {
|
||
|
return &DiagnosticsRepository{db: db}
|
||
|
}
|
||
|
|
||
|
func (r *DiagnosticsRepository) Insert(diagnostics *models.Diagnostics) (*models.Diagnostics, error) {
|
||
|
return diagnostics, r.db.Create(diagnostics).Error
|
||
|
}
|