- removed: api-service

- removed: session-service
- updated: moved health check out of consul registration
- updated: get service info to pull the service from the default namespace for the service account
- updated: the rest of the services to be able to handle the new database tables
This commit is contained in:
2025-03-20 22:53:49 -04:00
parent b9ebdd7080
commit 4046f56191
60 changed files with 233 additions and 30588 deletions

View File

@@ -0,0 +1,25 @@
use crate::grpc::database_service::MyDatabaseService;
use crate::grpc::session_service_server::SessionService;
use tonic::{Request, Response, Status};
use tracing::debug;
use crate::grpc::{GetSessionRequest, GetSessionResponse};
#[tonic::async_trait]
impl SessionService for MyDatabaseService {
async fn get_session(
&self,
request: Request<GetSessionRequest>,
) -> Result<Response<GetSessionResponse>, Status> {
let req = request.into_inner();
debug!("get_session: {:?}", req);
let session = self.db.session_repo.get_session(&req.session_id).await
.map_err(|_| Status::not_found("Session not found"))?;
debug!("session: {:?}", session);
Ok(Response::new(GetSessionResponse {
session_id: session.id,
user_id: session.user_id,
}))
}
}