feat(nex-servers): add nex token get stub and start working on grpc server

This commit is contained in:
DJMrTV 2025-03-07 15:14:43 +01:00
commit 02c46fca1d
10 changed files with 347 additions and 12 deletions

30
src/grpc/mod.rs Normal file
View file

@ -0,0 +1,30 @@
use tonic::{async_trait, Request, Response, Status};
use crate::grpc::grpc::{ExchangeTokenForUserDataRequest, GetNexDataRequest, GetNexDataResponse, GetNexPasswordRequest, GetNexPasswordResponse, GetUserDataRequest, GetUserDataResponse, UpdatePnidPermissionsRequest};
use crate::Pool;
mod grpc {
tonic::include_proto!("account");
}
pub struct AccountService(pub Pool);
#[async_trait]
impl grpc::account_server::Account for AccountService{
async fn exchange_token_for_user_data(&self, request: Request<ExchangeTokenForUserDataRequest>) -> Result<Response<GetUserDataResponse>, Status> {
todo!()
}
async fn get_nex_data(&self, request: Request<GetNexDataRequest>) -> Result<Response<GetNexDataResponse>, Status> {
todo!()
}
async fn get_nex_password(&self, request: Request<GetNexPasswordRequest>) -> Result<Response<GetNexPasswordResponse>, Status> {
todo!()
}
async fn update_pnid_permissions(&self, request: Request<UpdatePnidPermissionsRequest>) -> Result<Response<()>, Status> {
todo!()
}
async fn get_user_data(&self, request: Request<GetUserDataRequest>) -> Result<Response<GetUserDataResponse>, Status> {
todo!()
}
}