Add context reqruied later for authentication
This commit is contained in:
parent
9a367c9260
commit
20828fb4a1
14 changed files with 463 additions and 330 deletions
14
service/src/user_service.rs
Normal file
14
service/src/user_service.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use mockall::automock;
|
||||
|
||||
use crate::ServiceError;
|
||||
|
||||
#[automock(type Context=();)]
|
||||
#[async_trait]
|
||||
pub trait UserService {
|
||||
type Context: Clone + Send + Sync + 'static;
|
||||
|
||||
async fn current_user(&self, context: Self::Context) -> Result<Arc<str>, ServiceError>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue