feat(SystemStatistics): add system jumps and kills statistics with toggle functionality
This commit is contained in:
33
app.go
33
app.go
@@ -186,6 +186,39 @@ func (a *App) ToggleCharacterWaypointEnabled(characterID int64) error {
|
||||
return a.ssi.ToggleCharacterWaypointEnabled(characterID)
|
||||
}
|
||||
|
||||
// GetSystemJumps fetches system jump statistics from ESI
|
||||
func (a *App) GetSystemJumps() ([]SystemJumps, error) {
|
||||
fmt.Printf("🔍 App.GetSystemJumps() called - this should ONLY happen when toggle is ON!\n")
|
||||
if a.ssi == nil {
|
||||
return nil, errors.New("ESI not initialised")
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(a.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
return a.ssi.GetSystemJumps(ctx)
|
||||
}
|
||||
|
||||
// GetSystemKills fetches system kill statistics from ESI
|
||||
func (a *App) GetSystemKills() ([]SystemKills, error) {
|
||||
fmt.Printf("🔍 App.GetSystemKills() called - this should ONLY happen when toggle is ON!\n")
|
||||
if a.ssi == nil {
|
||||
return nil, errors.New("ESI not initialised")
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(a.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
return a.ssi.GetSystemKills(ctx)
|
||||
}
|
||||
|
||||
// ResolveSystemIDByName resolves a system name to its ID
|
||||
func (a *App) ResolveSystemIDByName(systemName string) (int64, error) {
|
||||
fmt.Printf("🔍 App.ResolveSystemIDByName() called for system: %s\n", systemName)
|
||||
if a.ssi == nil {
|
||||
return 0, errors.New("ESI not initialised")
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(a.ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
return a.ssi.ResolveSystemIDByName(ctx, systemName)
|
||||
}
|
||||
|
||||
// SystemRegion holds system + region names from local DB
|
||||
type SystemRegion struct {
|
||||
System string `json:"system"`
|
||||
|
Reference in New Issue
Block a user