added import of the new module

This commit is contained in:
filipriec
2025-03-01 12:35:40 +01:00
parent 87b009464c
commit 720d74ddc8
4 changed files with 14 additions and 4 deletions

View File

@@ -13,8 +13,10 @@ pub mod proto {
pub mod uctovnictvo {
include!("proto/multieko2.uctovnictvo.rs");
}
pub mod table_definition {
include!("proto/multieko2.table_definition.rs");
}
pub const FILE_DESCRIPTOR_SET: &[u8] =
include_bytes!("proto/descriptor.bin");
}
}

View File

@@ -5,6 +5,7 @@ pub mod adresar;
pub mod uctovnictvo;
pub mod shared;
pub mod table_structure;
pub mod table_definition;
// Re-export run_server from the inner server module:
pub use server::run_server;

View File

@@ -6,11 +6,13 @@ use common::proto::multieko2::FILE_DESCRIPTOR_SET;
use crate::server::services::{
AdresarService,
UctovnictvoService,
TableStructureHandler
TableStructureHandler,
TableDefinitionService
};
use common::proto::multieko2::adresar::adresar_server::AdresarServer;
use common::proto::multieko2::uctovnictvo::uctovnictvo_server::UctovnictvoServer;
use common::proto::multieko2::table_structure::table_structure_service_server::TableStructureServiceServer;
use common::proto::multieko2::table_definition::table_definition_server::TableDefinitionServer;
pub async fn run_server(db_pool: sqlx::PgPool) -> Result<(), Box<dyn std::error::Error>> {
let addr = "[::1]:50051".parse()?;
@@ -19,10 +21,14 @@ pub async fn run_server(db_pool: sqlx::PgPool) -> Result<(), Box<dyn std::error:
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build_v1()?;
// Initialize the TableDefinitionService
let table_definition_service = TableDefinitionService { db_pool: db_pool.clone() };
Server::builder()
.add_service(AdresarServer::new(AdresarService { db_pool: db_pool.clone() }))
.add_service(UctovnictvoServer::new(UctovnictvoService { db_pool: db_pool.clone() }))
.add_service(TableStructureServiceServer::new(TableStructureHandler { db_pool }))
.add_service(TableStructureServiceServer::new(TableStructureHandler { db_pool: db_pool.clone() }))
.add_service(TableDefinitionServer::new(table_definition_service)) // Add the service here
.add_service(reflection_service)
.serve(addr)
.await?;

View File

@@ -3,8 +3,9 @@
pub mod adresar_service;
pub mod table_structure_service;
pub mod uctovnictvo_service;
pub mod table_definition_service;
pub use adresar_service::AdresarService;
pub use table_structure_service::TableStructureHandler;
pub use uctovnictvo_service::UctovnictvoService;
pub use table_definition_service::TableDefinitionService;