Some kinda bullshit idk
This commit is contained in:
16
db.go
16
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{}
|
||||
|
||||
|
||||
43
types.go
43
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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user