feat: add SongSearchService and GET /songs?q= search endpoint
This commit is contained in:
@@ -9,5 +9,5 @@ pub use chord::Chord;
|
||||
pub use song::{ChordPosition, LyricLine, Section, SectionKind, SongMeta, Song};
|
||||
pub use song::{song_preview_chords, StoredSong, SongSummary};
|
||||
pub use ports::{FetchError, ParseError, TabFetcherPort, TabParserPort, TabSource};
|
||||
pub use ports::{RepositoryError, SongRepositoryPort};
|
||||
pub use ports::{RepositoryError, SongRepositoryPort, SongSearchPort};
|
||||
pub use transposer::{ChordTransposer, TransposeError};
|
||||
|
||||
@@ -54,3 +54,8 @@ pub trait SongRepositoryPort: Send + Sync {
|
||||
async fn get(&self, id: Uuid) -> Result<Option<Song>, RepositoryError>;
|
||||
async fn delete(&self, id: Uuid) -> Result<(), RepositoryError>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait SongSearchPort: Send + Sync {
|
||||
async fn search(&self, query: &str) -> Result<Vec<SongSummary>, RepositoryError>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user