mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 09:34:04 +00:00 
			
		
		
		
	database_structure => constants
This commit is contained in:
		
							
								
								
									
										17
									
								
								src/constants.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/constants.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					//! Project constants
 | 
				
			||||||
 | 
					//!
 | 
				
			||||||
 | 
					//! This module contains all the hard-coded value that might be used everywhere in the project.
 | 
				
			||||||
 | 
					//!
 | 
				
			||||||
 | 
					//! @author Pierre Hubert
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// The name of the tables
 | 
				
			||||||
 | 
					pub mod database_tables_names {
 | 
				
			||||||
 | 
					    /// API services tokens table
 | 
				
			||||||
 | 
					    pub const SERVICES_TABLES: &str = "comunic_api_services_tokens";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /// User access tokens table
 | 
				
			||||||
 | 
					    pub const USER_ACCESS_TOKENS_TABLE: &str = "comunic_api_users_tokens";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /// User table
 | 
				
			||||||
 | 
					    pub const USERS_TABLE: &str = "utilisateurs";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,12 +0,0 @@
 | 
				
			|||||||
/// Database structure information
 | 
					 | 
				
			||||||
///
 | 
					 | 
				
			||||||
/// @author Pierre Hubert
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/// API services tokens table
 | 
					 | 
				
			||||||
pub const SERVICES_TABLES : &str = "comunic_api_services_tokens";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/// User access tokens table
 | 
					 | 
				
			||||||
pub const USER_ACCESS_TOKENS_TABLE: &str = "comunic_api_users_tokens";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/// User table
 | 
					 | 
				
			||||||
pub const USERS_TABLE : &str = "utilisateurs";
 | 
					 | 
				
			||||||
@@ -2,7 +2,7 @@ use crate::data::api_client::APIClient;
 | 
				
			|||||||
use crate::data::error::{ExecError, ResultBoxError};
 | 
					use crate::data::error::{ExecError, ResultBoxError};
 | 
				
			||||||
use crate::data::user::UserID;
 | 
					use crate::data::user::UserID;
 | 
				
			||||||
use crate::data::user_token::UserAccessToken;
 | 
					use crate::data::user_token::UserAccessToken;
 | 
				
			||||||
use crate::database_structure::USER_ACCESS_TOKENS_TABLE;
 | 
					use crate::constants::database_tables_names::USER_ACCESS_TOKENS_TABLE;
 | 
				
			||||||
use crate::helpers::{database, user_helper};
 | 
					use crate::helpers::{database, user_helper};
 | 
				
			||||||
use crate::helpers::database::{QueryInfo, InsertQuery, DeleteQuery};
 | 
					use crate::helpers::database::{QueryInfo, InsertQuery, DeleteQuery};
 | 
				
			||||||
use crate::utils::crypt_utils::{crypt_pass, rand_str};
 | 
					use crate::utils::crypt_utils::{crypt_pass, rand_str};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
use crate::data::api_client::APIClient;
 | 
					use crate::data::api_client::APIClient;
 | 
				
			||||||
use crate::helpers::database;
 | 
					use crate::helpers::database;
 | 
				
			||||||
use crate::helpers::database::QueryInfo;
 | 
					use crate::helpers::database::QueryInfo;
 | 
				
			||||||
use crate::database_structure::SERVICES_TABLES;
 | 
					use crate::constants::database_tables_names::SERVICES_TABLES;
 | 
				
			||||||
use crate::data::error::ResultBoxError;
 | 
					use crate::data::error::ResultBoxError;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// API helper
 | 
					/// API helper
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
use crate::data::error::ResultBoxError;
 | 
					use crate::data::error::ResultBoxError;
 | 
				
			||||||
use crate::data::user::{User, UserID, UserPageStatus, AccountImageVisibility};
 | 
					use crate::data::user::{User, UserID, UserPageStatus, AccountImageVisibility};
 | 
				
			||||||
use crate::helpers::database;
 | 
					use crate::helpers::database;
 | 
				
			||||||
use crate::database_structure::USERS_TABLE;
 | 
					use crate::constants::database_tables_names::USERS_TABLE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// User helper
 | 
					/// User helper
 | 
				
			||||||
///
 | 
					///
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,4 +4,4 @@ pub mod controllers;
 | 
				
			|||||||
pub mod api_data;
 | 
					pub mod api_data;
 | 
				
			||||||
pub mod utils;
 | 
					pub mod utils;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub mod database_structure;
 | 
					pub mod constants;
 | 
				
			||||||
		Reference in New Issue
	
	Block a user