Update all the shit
This commit is contained in:
@ -18,6 +18,7 @@ type Persistence interface {
|
||||
DeleteCapture(context.Context, int64) error
|
||||
|
||||
GetRecentMapScore(context.Context, int64) (*MapScore, error)
|
||||
SetMapScoreConted(context.Context, int64, bool) error
|
||||
CreateMapScore(context.Context, *MapScore) error
|
||||
|
||||
CreateOrUpdateScores(context.Context, []Score) error
|
||||
@ -105,6 +106,14 @@ func (s *SQLitePersistence) GetRecentMapScore(ctx context.Context, captureid int
|
||||
return &scores[0], nil
|
||||
}
|
||||
|
||||
func (s *SQLitePersistence) SetMapScoreConted(ctx context.Context, mapscoreid int64, counted bool) error {
|
||||
mapscore := MapScore{
|
||||
ID: mapscoreid,
|
||||
}
|
||||
_, err := s.db.NewUpdate().Model(&mapscore).WherePK().Set("counted = ?", counted).Exec(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *SQLitePersistence) CreateMapScore(ctx context.Context, mapscore *MapScore) error {
|
||||
_, err := s.db.NewInsert().Model(mapscore).Exec(ctx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user