2022-10-03 23:00:31 +02:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
use async_trait::async_trait;
|
2022-10-04 22:39:57 +02:00
|
|
|
use como_domain::projects::{
|
|
|
|
queries::{GetProjectQuery, GetProjectsQuery},
|
|
|
|
ProjectDto,
|
|
|
|
};
|
2022-10-03 23:00:31 +02:00
|
|
|
|
|
|
|
pub type DynProjectService = Arc<dyn ProjectService + Send + Sync>;
|
|
|
|
|
|
|
|
#[async_trait]
|
2022-10-04 22:39:57 +02:00
|
|
|
pub trait ProjectService {
|
|
|
|
async fn get_project(&self, query: GetProjectQuery) -> anyhow::Result<ProjectDto>;
|
|
|
|
async fn get_projects(&self, query: GetProjectsQuery) -> anyhow::Result<Vec<ProjectDto>>;
|
|
|
|
}
|