Refactor and improve
This commit is contained in:
parent
1f148b2185
commit
242acff987
22 changed files with 754 additions and 1053 deletions
|
|
@ -1,14 +1,6 @@
|
|||
use rustc_hash::FxHashMap;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::data::{POIData, PropertyData};
|
||||
use crate::grid_index::GridIndex;
|
||||
|
||||
#[derive(Serialize, Clone)]
|
||||
pub struct POICategoryGroup {
|
||||
pub name: String,
|
||||
pub categories: Vec<String>,
|
||||
}
|
||||
use crate::data::{POICategoryGroup, POIData, PropertyData};
|
||||
use crate::routes::FeaturesResponse;
|
||||
use crate::utils::GridIndex;
|
||||
|
||||
pub struct AppState {
|
||||
pub data: PropertyData,
|
||||
|
|
@ -18,18 +10,14 @@ pub struct AppState {
|
|||
pub h3_cells: Vec<u64>,
|
||||
pub poi_data: POIData,
|
||||
pub poi_grid: GridIndex,
|
||||
/// Precomputed JSON key names: "min_{feature_name}" for each numeric feature
|
||||
/// Precomputed JSON key names: "min_{feature_name}" for each feature
|
||||
pub min_keys: Vec<String>,
|
||||
/// Precomputed JSON key names: "max_{feature_name}" for each numeric feature
|
||||
/// Precomputed JSON key names: "max_{feature_name}" for each feature
|
||||
pub max_keys: Vec<String>,
|
||||
/// Precomputed JSON key names: "min_{enum_name}" for each enum feature
|
||||
pub enum_min_keys: Vec<String>,
|
||||
/// Precomputed JSON key names: "max_{enum_name}" for each enum feature
|
||||
pub enum_max_keys: Vec<String>,
|
||||
/// Precomputed POI category groups (sorted)
|
||||
pub poi_category_groups: Vec<POICategoryGroup>,
|
||||
/// Precomputed map from enum feature name to index in data.enum_features
|
||||
pub enum_name_to_idx: FxHashMap<String, usize>,
|
||||
/// Precomputed features response for /api/features endpoint
|
||||
pub features_response: FeaturesResponse,
|
||||
/// URL of the OG screenshot sidecar service (e.g. http://og-screenshot:8002)
|
||||
pub og_sidecar_url: Option<String>,
|
||||
/// Public-facing URL for absolute og:image URLs (e.g. https://narrowit.schmelczer.dev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue