mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
type FingerprintVote string
|
|
|
|
const (
|
|
FingerprintVoteValid FingerprintVote = "VALID"
|
|
FingerprintVoteInvalid FingerprintVote = "INVALID"
|
|
)
|
|
|
|
func (e FingerprintVote) IsValid() bool {
|
|
switch e {
|
|
case FingerprintVoteValid, FingerprintVoteInvalid:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e FingerprintVote) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
type FingerprintSubmission struct {
|
|
Endpoint string `json:"endpoint"`
|
|
StashID string `json:"stash_id"`
|
|
SceneID int `json:"scene_id"`
|
|
Vote FingerprintVote `json:"vote"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type FingerprintSubmissionReader interface {
|
|
FindByEndpoint(ctx context.Context, endpoint string) ([]*FingerprintSubmission, error)
|
|
}
|
|
|
|
type FingerprintSubmissionWriter interface {
|
|
Create(ctx context.Context, newObject *FingerprintSubmission) error
|
|
Delete(ctx context.Context, endpoint string, stashID string) error
|
|
}
|
|
|
|
type FingerprintSubmissionReaderWriter interface {
|
|
FingerprintSubmissionReader
|
|
FingerprintSubmissionWriter
|
|
}
|