Refactor character to types

This commit is contained in:
2025-10-10 22:24:10 +02:00
parent ef02bb810e
commit d7d3a6e888
4 changed files with 39 additions and 43 deletions

View File

@@ -4,9 +4,9 @@ import (
"context"
"encoding/json"
"strconv"
"time"
"go-eve-pi/esi"
"go-eve-pi/types"
wh "go-eve-pi/webhook"
logger "git.site.quack-lab.dev/dave/cylogger"
@@ -23,18 +23,7 @@ type RouteHandler struct {
// SSOInterface defines the interface for SSO operations
type SSOInterface interface {
GetCharacter(ctx context.Context, characterName string) (Character, error)
}
// Character represents a character with authentication info
type Character struct {
ID int64 `gorm:"primaryKey"`
CharacterName string `gorm:"uniqueIndex"`
AccessToken string
RefreshToken string
ExpiresAt time.Time
UpdatedAt time.Time
CreatedAt time.Time
GetCharacter(ctx context.Context, characterName string) (types.Character, error)
}
// NewRouteHandler creates a new route handler with dependencies