Introduce models.Entity type

This commit is contained in:
Philipp Wolfer 2023-12-10 14:22:38 +01:00
parent a59a542967
commit c4587b80af
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
6 changed files with 18 additions and 9 deletions

View file

@ -24,6 +24,7 @@ import (
"time"
"github.com/glebarez/sqlite"
"go.uploadedlobster.com/scotty/internal/models"
"golang.org/x/oauth2"
"gorm.io/datatypes"
"gorm.io/gorm"
@ -54,7 +55,7 @@ func New(dsn string) (db Database, err error) {
return
}
func (db Database) GetImportTimestamp(source string, target string, entity string) (time.Time, error) {
func (db Database) GetImportTimestamp(source string, target string, entity models.Entity) (time.Time, error) {
result := ImportTimestamp{
SourceService: source,
TargetService: target,
@ -64,7 +65,7 @@ func (db Database) GetImportTimestamp(source string, target string, entity strin
return result.Timestamp, err
}
func (db Database) SetImportTimestamp(source string, target string, entity string, timestamp time.Time) error {
func (db Database) SetImportTimestamp(source string, target string, entity models.Entity, timestamp time.Time) error {
entry := ImportTimestamp{
SourceService: source,
TargetService: target,