@@ -1,9 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use como_domain::projects::{
|
||||
queries::{GetProjectQuery, GetProjectsQuery},
|
||||
ProjectDto,
|
||||
use como_domain::{
|
||||
projects::{mutation::CreateProjectMutation, queries::GetProjectQuery, ProjectDto},
|
||||
users::User,
|
||||
};
|
||||
|
||||
pub type DynProjectService = Arc<dyn ProjectService + Send + Sync>;
|
||||
@@ -11,5 +11,10 @@ pub type DynProjectService = Arc<dyn ProjectService + Send + Sync>;
|
||||
#[async_trait]
|
||||
pub trait ProjectService {
|
||||
async fn get_project(&self, query: GetProjectQuery) -> anyhow::Result<ProjectDto>;
|
||||
async fn get_projects(&self, query: GetProjectsQuery) -> anyhow::Result<Vec<ProjectDto>>;
|
||||
async fn get_projects(&self, user: &User) -> anyhow::Result<Vec<ProjectDto>>;
|
||||
async fn create_project(
|
||||
&self,
|
||||
name: CreateProjectMutation,
|
||||
user: &User,
|
||||
) -> anyhow::Result<ProjectDto>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user