From e449cd31acb6692894f4d58dd41b2dbeb1e9e043 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 24 Jan 2026 21:12:59 +0100 Subject: [PATCH] Some kinda bullshit idk --- db.go | 16 +++++++++++++++- types.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/db.go b/db.go index ec62cca..3653076 100644 --- a/db.go +++ b/db.go @@ -28,6 +28,7 @@ type DB interface { SearchModules(query string, limit int) ([]models.InvType, error) SearchGroups(query string, limit int) ([]models.InvGroup, error) + // Non retarded APIs below GetItemTypes(itemIDs []int64) ([]models.InvType, error) GetSolarSystems(systemIDs []int64) ([]models.MapSolarSystem, error) ExpandGroupsIntoItemTypeIds(groups []int64) ([]int64, error) @@ -337,11 +338,24 @@ func (db *DBWrapper) QueryFits(params QueryParams) (*FitStatistics, error) { } } + // DISABLE CACHING TEMPORARILY TO TEST + // // Cache the results + // jsonData, err := json.Marshal(stats) + // if err != nil { + // flog.Debug("Failed to marshal results for caching: %v", err) + // } else { + // if cacheErr := db.CacheSet(cacheKey, jsonData); cacheErr != nil { + // flog.Debug("Failed to cache results: %v", cacheErr) + // } else { + // flog.Debug("Cached results for key: %s", cacheKey) + // } + // } + return stats, nil } func (db *DBWrapper) buildBaseFilterQuery(params QueryParams) (string, []interface{}) { - query := `SELECT killmail_id, solar_system_id, victim_ship_type_id FROM zkill.killmails` + query := `SELECT killmail_id, solar_system_id, victim_ship_type_id FROM killmails` args := []interface{}{} conditions := []string{} diff --git a/types.go b/types.go index fde5e88..561d92b 100644 --- a/types.go +++ b/types.go @@ -157,3 +157,46 @@ type FitStatistics struct { Drones map[int32]int64 KillmailIDs []int64 } + +import "time" + +type Character struct { + AllianceID int64 `json:"alliance_id"` + Birthday time.Time `json:"birthday"` + BloodlineID int64 `json:"bloodline_id"` + CorporationID int64 `json:"corporation_id"` + Description string `json:"description"` + Gender string `json:"gender"` + Name string `json:"name"` + RaceID int64 `json:"race_id"` + SecurityStatus float64 `json:"security_status"` +} + +import "time" + +type Corporation struct { + AllianceID int64 `json:"alliance_id"` + CeoID int64 `json:"ceo_id"` + CreatorID int64 `json:"creator_id"` + DateFounded time.Time `json:"date_founded"` + Description string `json:"description"` + HomeStationID int64 `json:"home_station_id"` + MemberCount int64 `json:"member_count"` + Name string `json:"name"` + Shares int64 `json:"shares"` + TaxRate float64 `json:"tax_rate"` + Ticker string `json:"ticker"` + URL string `json:"url"` + WarEligible bool `json:"war_eligible"` +} + +import "time" + +type Alliance struct { + CreatorCorporationID int64 `json:"creator_corporation_id"` + CreatorID int64 `json:"creator_id"` + DateFounded time.Time `json:"date_founded"` + ExecutorCorporationID int64 `json:"executor_corporation_id"` + Name string `json:"name"` + Ticker string `json:"ticker"` +}