61 lines
922 B
Go
61 lines
922 B
Go
package interfaces
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.konchin.com/go2025/backend/models"
|
|
)
|
|
|
|
type Database interface {
|
|
GetSessionByLoginToken(
|
|
ctx context.Context,
|
|
loginToken string,
|
|
) (models.Session, error)
|
|
|
|
GetSessionByUserId(
|
|
ctx context.Context,
|
|
userId string,
|
|
) (models.Session, error)
|
|
|
|
UpdateRefreshToken(
|
|
ctx context.Context,
|
|
userId string,
|
|
) (models.Session, error)
|
|
|
|
UpsertLoginToken(
|
|
ctx context.Context,
|
|
userId string,
|
|
) (string, error)
|
|
|
|
GetAliases(
|
|
ctx context.Context,
|
|
) ([]models.Alias, error)
|
|
|
|
GetImages(
|
|
ctx context.Context,
|
|
imageIds []int64,
|
|
aliasIds []int64,
|
|
) ([]models.Image, error)
|
|
|
|
UpdateAliases(
|
|
ctx context.Context,
|
|
imageId int64,
|
|
aliasNames []string,
|
|
) error
|
|
|
|
InsertImage(
|
|
ctx context.Context,
|
|
image *models.Image,
|
|
) error
|
|
|
|
DeleteImage(
|
|
ctx context.Context,
|
|
imageId int64,
|
|
) error
|
|
|
|
DeleteAlias(
|
|
ctx context.Context,
|
|
aliasId int64,
|
|
) error
|
|
}
|