All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m40s
Background poller fetches emails via IMAP or Microsoft Graph API, classifies them with Claude Haiku, and creates/updates JobApplication records automatically. Includes manual sync endpoint and OAuth callback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.1 KiB
Go
51 lines
1.1 KiB
Go
package handlers
|
|
|
|
import (
|
|
"time"
|
|
|
|
"adam-french.co.uk/backend/services"
|
|
"github.com/anthropics/anthropic-sdk-go"
|
|
"github.com/zmb3/spotify/v2"
|
|
spotifyauth "github.com/zmb3/spotify/v2/auth"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Store struct {
|
|
DB *gorm.DB
|
|
SpotifyAuth *spotifyauth.Authenticator
|
|
SpotifyClient *spotify.Client
|
|
ClaudeClient *anthropic.Client
|
|
Auth *services.Auth
|
|
Notes *services.Notes
|
|
LoginLimiter *services.RateLimiter
|
|
EmailSync *services.EmailSyncService
|
|
|
|
RecentSongs *[]spotify.RecentlyPlayedItem
|
|
RecentSongsFetchedAt time.Time
|
|
|
|
GiteaHost string
|
|
GiteaPort string
|
|
GiteaFeed *services.GiteaFeedResponse
|
|
GiteaFeedFetchedAt time.Time
|
|
|
|
SteamAPIKey string
|
|
SteamID string
|
|
SteamRecentGames []services.SteamRecentGame
|
|
SteamOnline bool
|
|
SteamFetchedAt time.Time
|
|
}
|
|
|
|
func (s *Store) GiteaFeedFresh() bool {
|
|
if s.GiteaFeed == nil {
|
|
return false
|
|
}
|
|
return time.Since(s.GiteaFeedFetchedAt) < time.Minute
|
|
}
|
|
|
|
func (s *Store) SteamFresh() bool {
|
|
if s.SteamRecentGames == nil {
|
|
return false
|
|
}
|
|
return time.Since(s.SteamFetchedAt) < 5*time.Minute
|
|
}
|