blog/backend/feature/auth/src/adapter/gateway/user_db_service.rs
SquidSpirit f986810540
All checks were successful
Frontend CI / build (push) Successful in 1m9s
BLOG-100 User retrieval functionality in authentication module (#102)
### Description

- Endpoint: GET `/me`, returns the whole user data.

### Package Changes

_No response_

### Screenshots

_No response_

### Reference

Resolves #100

### Checklist

- [x] A milestone is set
- [x] The related issuse has been linked to this branch

Reviewed-on: #102
Co-authored-by: SquidSpirit <squid@squidspirit.com>
Co-committed-by: SquidSpirit <squid@squidspirit.com>
2025-08-01 18:42:22 +08:00

19 lines
497 B
Rust

use async_trait::async_trait;
use crate::{
adapter::gateway::user_db_mapper::UserMapper, application::error::auth_error::AuthError,
};
#[async_trait]
pub trait UserDbService: Send + Sync {
async fn get_user_by_id(&self, user_id: i32) -> Result<UserMapper, AuthError>;
async fn get_user_by_source_id(
&self,
issuer: &str,
source_id: &str,
) -> Result<UserMapper, AuthError>;
async fn create_user(&self, user: UserMapper) -> Result<i32, AuthError>;
}