refactor: DDD/CQRS architecture, unified crate layout
- crates: common→application, api→presentation, infrastructure/*→adapters/* - new crates: api-types, infra-wiring - domain: errors/, models/, value_objects/, ports/, services/ - application: CQRS use cases (songs/, tabs/) w/ commands, queries, deps - unified DomainError replaces RepositoryError - workspace deps, unused dep cleanup - fix: parse plain-text chord lines (UG drops spans mid-song) - tests extracted to separate modules (tests/ dirs)
This commit is contained in:
14
crates/application/src/songs/search_songs.rs
Normal file
14
crates/application/src/songs/search_songs.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use domain::errors::DomainError;
|
||||
use domain::models::SongSummary;
|
||||
|
||||
use super::deps::SongQueryDeps;
|
||||
use super::queries::SearchSongsQuery;
|
||||
|
||||
pub async fn execute(
|
||||
deps: &SongQueryDeps,
|
||||
query: SearchSongsQuery,
|
||||
) -> Result<Vec<SongSummary>, DomainError> {
|
||||
deps.search
|
||||
.search(&query.query, query.sort, query.order)
|
||||
.await
|
||||
}
|
||||
Reference in New Issue
Block a user