33 lines
1.0 KiB
Rust
33 lines
1.0 KiB
Rust
//! External data providers: place search, geocoding and photo/text sources.
|
|
//!
|
|
//! * Official APIs: [`kakao_local`], [`ncp_geocode`]
|
|
//! * In-process scrapers: [`naver_map`], [`naver_place`], [`naver_blog`], [`kakao_place`]
|
|
//! * Delegated to the external browser scraping service: [`browser`] (Google Maps, Instagram)
|
|
|
|
pub mod browser;
|
|
pub mod http;
|
|
pub mod kakao_local;
|
|
pub mod kakao_place;
|
|
pub mod naver_blog;
|
|
pub mod naver_map;
|
|
pub mod naver_place;
|
|
pub mod ncp_geocode;
|
|
pub mod text;
|
|
|
|
use async_trait::async_trait;
|
|
use domain::{PhotoSourceId, Place, PlaceCandidate, SourceOutput};
|
|
|
|
/// Free-text place search (상호명 / 주소 → candidates).
|
|
#[async_trait]
|
|
pub trait PlaceSearch: Send + Sync {
|
|
fn name(&self) -> &'static str;
|
|
async fn search(&self, query: &str) -> anyhow::Result<Vec<PlaceCandidate>>;
|
|
}
|
|
|
|
/// A source of photos and text evidence for a resolved place.
|
|
#[async_trait]
|
|
pub trait PhotoSource: Send + Sync {
|
|
fn id(&self) -> PhotoSourceId;
|
|
async fn collect(&self, place: &Place, limit: usize) -> anyhow::Result<SourceOutput>;
|
|
}
|