diff --git a/Cargo.toml b/Cargo.toml index 82e018813..1b0abad37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,8 +60,8 @@ run_script = { version = "0.10" } testcontainers-modules = { version = "0.3", features = ["redis"] } strum = { version = "0.26", features = ["derive"] } # tardis -# tardis = { version = "0.1.0-rc.13" } -tardis = { path = "../tardis/tardis" } +tardis = { version = "0.1.0-rc.15" } +# tardis = { path = "../tardis/tardis" } # tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "694ff92" } #spacegate diff --git a/backend/middlewares/event/src/api/event_listener_api.rs b/backend/middlewares/event/src/api/event_listener_api.rs index e680af42b..0035906bd 100644 --- a/backend/middlewares/event/src/api/event_listener_api.rs +++ b/backend/middlewares/event/src/api/event_listener_api.rs @@ -10,11 +10,13 @@ use crate::serv::event_listener_serv; pub struct EventListenerApi; /// Event Listener API +/// /// 事件监听器API #[poem_openapi::OpenApi(prefix_path = "/listener")] impl EventListenerApi { /// Register event listener + /// /// 注册事件监听器 #[oai(path = "/", method = "post")] async fn register(&self, listener: Json) -> TardisApiResult { @@ -24,6 +26,7 @@ impl EventListenerApi { } /// Remove event listener + /// /// 移除事件监听器 #[oai(path = "/:listener_code", method = "delete")] async fn remove(&self, listener_code: Path, token: Query) -> TardisApiResult { diff --git a/backend/middlewares/event/src/api/event_proc_api.rs b/backend/middlewares/event/src/api/event_proc_api.rs index 58c7aed94..32a8ea0e9 100644 --- a/backend/middlewares/event/src/api/event_proc_api.rs +++ b/backend/middlewares/event/src/api/event_proc_api.rs @@ -8,11 +8,13 @@ use crate::serv::event_proc_serv; pub struct EventProcApi; /// Event Process API +/// /// 事件处理API #[poem_openapi::OpenApi(prefix_path = "/proc")] impl EventProcApi { /// Process event + /// /// 处理事件 #[oai(path = "/:listener_code", method = "get")] async fn ws_process(&self, listener_code: Path, token: Query, websocket: WebSocket) -> BoxWebSocketUpgraded { diff --git a/backend/middlewares/event/src/api/event_topic_api.rs b/backend/middlewares/event/src/api/event_topic_api.rs index cb8870b4d..aca7f0a54 100644 --- a/backend/middlewares/event/src/api/event_topic_api.rs +++ b/backend/middlewares/event/src/api/event_topic_api.rs @@ -13,10 +13,12 @@ use crate::serv::event_topic_serv::EventDefServ; pub struct EventTopicApi; /// Event Topic API +/// /// 事件主题API #[poem_openapi::OpenApi(prefix_path = "/topic")] impl EventTopicApi { /// Add Event Definition + /// /// 添加事件主题 #[oai(path = "/", method = "post")] async fn add(&self, mut add_or_modify_req: Json, ctx: TardisContextExtractor) -> TardisApiResult { @@ -26,6 +28,7 @@ impl EventTopicApi { } /// Modify Event Definition + /// /// 修改事件主题 #[oai(path = "/:id", method = "put")] async fn modify(&self, id: Path, mut add_or_modify_req: Json, ctx: TardisContextExtractor) -> TardisApiResult { @@ -35,6 +38,7 @@ impl EventTopicApi { } /// Delete Event Definition + /// /// 删除事件主题 #[oai(path = "/:id", method = "delete")] async fn delete(&self, id: Path, ctx: TardisContextExtractor) -> TardisApiResult { @@ -44,6 +48,7 @@ impl EventTopicApi { } /// Find Event Definitions + /// /// 查找事件主题 #[oai(path = "/", method = "get")] async fn paginate( diff --git a/backend/middlewares/event/src/domain/event_topic.rs b/backend/middlewares/event/src/domain/event_topic.rs index 63ba782ed..07eb00c83 100644 --- a/backend/middlewares/event/src/domain/event_topic.rs +++ b/backend/middlewares/event/src/domain/event_topic.rs @@ -5,24 +5,29 @@ use tardis::db::sea_orm::sea_query::{ColumnDef, IndexCreateStatement, Table, Tab use tardis::db::sea_orm::*; /// Event Topic model +/// /// 事件主题模型 #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "event_topic")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: String, - /// 是否保存消息 /// Whether to save messages + /// + /// 是否保存消息 pub save_message: bool, - /// 是否需要管理节点 /// Whether a management node is required + /// + /// 是否需要管理节点 pub need_mgr: bool, pub queue_size: i32, - /// 如果 need_mgr 为 false,则在注册时使用该sk /// If need_mgr is false, this field is used when registering + /// + /// 如果 need_mgr 为 false,则在注册时使用该sk pub use_sk: String, - /// 如果 need_mgr 为 true,则在注册时使用该sk /// If need_mgr is true, this field is used when registering + /// + /// 如果 need_mgr 为 true,则在注册时使用该sk pub mgr_sk: String, pub own_paths: String, diff --git a/backend/middlewares/schedule/src/serv/schedule_job_serv.rs b/backend/middlewares/schedule/src/serv/schedule_job_serv.rs index 16d7cd9ea..e58e50ac3 100644 --- a/backend/middlewares/schedule/src/serv/schedule_job_serv.rs +++ b/backend/middlewares/schedule/src/serv/schedule_job_serv.rs @@ -42,11 +42,11 @@ fn service() -> Arc { /// still not good, should manage to merge it with `OwnedScheduleTaskServ::add` /// same as `delete` pub(crate) async fn add_or_modify(add_or_modify: ScheduleJobAddOrModifyReq, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { - let code = &add_or_modify.code.to_string(); + let code = add_or_modify.code.to_string(); // if exist delete it first // 如果存在,先删除 - if service().code_uuid.write().await.get(code).is_some() { - delete(code, funs, ctx).await?; + if service().code_uuid.write().await.get(&code).is_some() { + delete(&code, funs, ctx).await?; } // 1. log add operation // 1. 记录添加操作 diff --git a/backend/supports/iam/src/basic/domain/iam_account.rs b/backend/supports/iam/src/basic/domain/iam_account.rs index 3a0d44209..5d88cf37d 100644 --- a/backend/supports/iam/src/basic/domain/iam_account.rs +++ b/backend/supports/iam/src/basic/domain/iam_account.rs @@ -9,21 +9,26 @@ pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: String, pub icon: String, - // 状态 /// [data type Kind](crate::iam_enumeration::IamAccountStatusKind) pub status: i16, - /// Marking of temporary status / 临时状态的标记 + /// Marking of temporary status + /// + /// 临时状态的标记 pub temporary: bool, /// [data type Kind](crate::iam_enumeration::IamAccountLockStateKind) pub lock_status: i16, - /// Expanded fields with index / 索引扩展字段 idx 1-3 + /// Expanded fields with index + /// + /// 索引扩展字段 idx 1-3 #[index] pub ext1_idx: String, #[index] pub ext2_idx: String, #[index] pub ext3_idx: String, - /// Expanded fields / 普通扩展字段 4-9 + /// Expanded fields + /// + /// 普通扩展字段 4-9 pub ext4: String, pub ext5: String, pub ext6: String, @@ -33,6 +38,11 @@ pub struct Model { #[sea_orm(extra = "DEFAULT CURRENT_TIMESTAMP")] pub effective_time: chrono::DateTime, + #[sea_orm(extra = "DEFAULT CURRENT_TIMESTAMP")] + pub logout_time: chrono::DateTime, + /// [data type Kind](crate::iam_enumeration::IamAccountLogoutTypeKind) + pub logout_type: String, + #[fill_ctx(fill = "own_paths")] pub own_paths: String, } diff --git a/backend/supports/iam/src/basic/dto/iam_account_dto.rs b/backend/supports/iam/src/basic/dto/iam_account_dto.rs index 1154cd0b9..8db2dc3bf 100644 --- a/backend/supports/iam/src/basic/dto/iam_account_dto.rs +++ b/backend/supports/iam/src/basic/dto/iam_account_dto.rs @@ -2,13 +2,13 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use tardis::basic::field::TrimString; -use tardis::chrono::{DateTime, Utc}; +use tardis::chrono::{self, DateTime, Utc}; use tardis::db::sea_orm; use tardis::web::poem_openapi; use crate::basic::dto::iam_cert_conf_dto::IamCertConfLdapResp; use crate::basic::serv::iam_cert_ldap_serv::ldap::LdapSearchResp; -use crate::iam_enumeration::{IamAccountLockStateKind, IamAccountStatusKind}; +use crate::iam_enumeration::{IamAccountLockStateKind, IamAccountLogoutTypeKind, IamAccountStatusKind}; use bios_basic::rbum::rbum_enumeration::{RbumCertStatusKind, RbumScopeLevelKind}; #[derive(poem_openapi::Object, Serialize, Deserialize, Debug)] @@ -31,6 +31,7 @@ pub struct IamAccountAggAddReq { pub scope_level: Option, pub disabled: Option, + pub logout_type: Option, pub temporary: Option, @@ -48,6 +49,7 @@ pub struct IamAccountAddReq { pub name: TrimString, pub scope_level: Option, pub disabled: Option, + pub logout_type: Option, pub temporary: Option, pub lock_status: Option, pub status: Option, @@ -61,6 +63,7 @@ pub struct IamAccountAggModifyReq { pub name: Option, pub scope_level: Option, pub disabled: Option, + pub logout_type: Option, pub temporary: Option, pub status: Option, #[oai(validator(min_length = "2", max_length = "1000"))] @@ -83,6 +86,7 @@ pub struct IamAccountModifyReq { pub name: Option, pub scope_level: Option, pub disabled: Option, + pub logout_type: Option, pub temporary: Option, pub lock_status: Option, @@ -97,6 +101,7 @@ pub struct IamAccountSelfModifyReq { #[oai(validator(min_length = "2", max_length = "255"))] pub name: Option, pub disabled: Option, + pub logout_type: Option, // #[oai(validator(min_length = "2", max_length = "1000"))] pub icon: Option, @@ -123,6 +128,8 @@ pub struct IamAccountSummaryResp { pub scope_level: RbumScopeLevelKind, pub disabled: bool, + pub logout_time: chrono::DateTime, + pub logout_type: String, pub temporary: bool, pub lock_status: IamAccountLockStateKind, @@ -144,6 +151,8 @@ pub struct IamAccountDetailResp { pub scope_level: RbumScopeLevelKind, pub disabled: bool, + pub logout_time: chrono::DateTime, + pub logout_type: String, pub temporary: bool, pub lock_status: IamAccountLockStateKind, @@ -160,6 +169,8 @@ pub struct IamAccountSummaryAggResp { pub create_time: DateTime, pub update_time: DateTime, pub effective_time: DateTime, + pub logout_time: chrono::DateTime, + pub logout_type: String, pub scope_level: RbumScopeLevelKind, pub disabled: bool, @@ -186,6 +197,8 @@ pub struct IamAccountDetailAggResp { pub create_time: DateTime, pub update_time: DateTime, pub effective_time: DateTime, + pub logout_time: chrono::DateTime, + pub logout_type: String, pub scope_level: RbumScopeLevelKind, pub disabled: bool, diff --git a/backend/supports/iam/src/basic/middleware/encrypt_mw.rs b/backend/supports/iam/src/basic/middleware/encrypt_mw.rs index d1bff8a2d..e987ee696 100644 --- a/backend/supports/iam/src/basic/middleware/encrypt_mw.rs +++ b/backend/supports/iam/src/basic/middleware/encrypt_mw.rs @@ -1,6 +1,5 @@ use std::collections::HashMap; -use async_trait::async_trait; use serde::{Deserialize, Serialize}; use tardis::web::poem_openapi; use tardis::{ @@ -27,13 +26,12 @@ impl Middleware> for EncryptMW { type Output = BoxEndpoint<'static>; fn transform(&self, ep: BoxEndpoint<'static>) -> Self::Output { - Box::new(EncryptMWImpl(ep)) + Box::new(poem::endpoint::ToDynEndpoint(EncryptMWImpl(ep))) } } pub struct EncryptMWImpl(E); -#[async_trait] impl Endpoint for EncryptMWImpl { type Output = Response; diff --git a/backend/supports/iam/src/basic/serv/clients/iam_log_client.rs b/backend/supports/iam/src/basic/serv/clients/iam_log_client.rs index d327feba9..a6be44fd5 100644 --- a/backend/supports/iam/src/basic/serv/clients/iam_log_client.rs +++ b/backend/supports/iam/src/basic/serv/clients/iam_log_client.rs @@ -118,7 +118,7 @@ impl IamLogClient { ctx: &TardisContext, ) -> TardisResult<()> { let mut content = content.clone(); - // find operater info + // find operates info if let Ok(cert) = IamCertServ::get_cert_detail_by_id_and_kind(ctx.owner.as_str(), &IamCertKernelKind::UserPwd, funs, ctx).await { content.ak = cert.ak; content.name = cert.owner_name.unwrap_or("".to_string()); diff --git a/backend/supports/iam/src/basic/serv/clients/iam_search_client.rs b/backend/supports/iam/src/basic/serv/clients/iam_search_client.rs index 9157ae8c1..b7d846aab 100644 --- a/backend/supports/iam/src/basic/serv/clients/iam_search_client.rs +++ b/backend/supports/iam/src/basic/serv/clients/iam_search_client.rs @@ -10,6 +10,8 @@ use itertools::Itertools; use tardis::{ basic::{dto::TardisContext, field::TrimString, result::TardisResult}, + chrono::Utc, + db::sea_orm::prelude::DateTimeUtc, serde_json::json, tokio, TardisFunsInst, }; @@ -180,6 +182,8 @@ impl IamSearchClient { "icon":account_resp.icon, "logout_msg":logout_msg, "disabled":account_resp.disabled, + "logout_time":account_resp.logout_time, + "logout_type":account_resp.logout_type, "scope_level":account_resp.scope_level })), ext_override: Some(true), @@ -224,6 +228,8 @@ impl IamSearchClient { "icon":account_resp.icon, "logout_msg":logout_msg, "disabled":account_resp.disabled, + "logout_time":account_resp.logout_time, + "logout_type":account_resp.logout_type, "scope_level":account_resp.scope_level })), visit_keys: Some(SearchItemVisitKeysReq { diff --git a/backend/supports/iam/src/basic/serv/iam_account_serv.rs b/backend/supports/iam/src/basic/serv/iam_account_serv.rs index ce7b7426a..8319de26b 100644 --- a/backend/supports/iam/src/basic/serv/iam_account_serv.rs +++ b/backend/supports/iam/src/basic/serv/iam_account_serv.rs @@ -43,7 +43,7 @@ use crate::basic::serv::iam_role_serv::IamRoleServ; use crate::basic::serv::iam_set_serv::IamSetServ; use crate::basic::serv::iam_tenant_serv::IamTenantServ; use crate::iam_config::{IamBasicInfoManager, IamConfig}; -use crate::iam_enumeration::{IamAccountLockStateKind, IamAccountStatusKind, IamCertKernelKind, IamRelKind, IamSetKind}; +use crate::iam_enumeration::{IamAccountLockStateKind, IamAccountLogoutTypeKind, IamAccountStatusKind, IamCertKernelKind, IamRelKind, IamSetKind}; use super::clients::iam_log_client::{IamLogClient, LogParamTag}; use super::clients::iam_search_client::IamSearchClient; @@ -84,6 +84,11 @@ impl RbumItemCrudOperation Some(false), - IamAccountStatusKind::Dormant => Some(true), + IamAccountStatusKind::Dormant => Some(false), IamAccountStatusKind::Logout => Some(true), } } else { @@ -141,6 +146,10 @@ impl RbumItemCrudOperation TardisResult<(String, Stri status: Some(RbumCertStatusKind::Pending), temporary: None, lock_status: None, + logout_type: None, }, false, funs, @@ -376,6 +377,7 @@ pub async fn init_rbum_data(funs: &TardisFunsInst) -> TardisResult<(String, Stri cert_phone: None, cert_mail: None, temporary: None, + logout_type: None, }, funs, &ctx, diff --git a/backend/supports/reach/src/api.rs b/backend/supports/reach/src/api.rs index 4faefa806..a4eeaabcd 100644 --- a/backend/supports/reach/src/api.rs +++ b/backend/supports/reach/src/api.rs @@ -9,7 +9,7 @@ mod reach_api_ci; pub use reach_api_ci::*; use tardis::{basic::result::TardisResult, web::web_server::TardisWebServer}; -use crate::reach_consts::DOMAIN_CODE; +use crate::reach_constants::DOMAIN_CODE; pub type ReachApi = (ReachCcApi, ReachCtApi, ReachMessageCiApi); pub async fn init(web_server: &TardisWebServer) -> TardisResult<()> { diff --git a/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_message.rs b/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_message.rs index a8087eb77..72d8bec2d 100644 --- a/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_message.rs +++ b/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_message.rs @@ -11,7 +11,7 @@ use tardis::web::web_resp::{TardisApiResult, TardisResp, Void}; use crate::dto::*; use crate::reach_config::ReachConfig; -use crate::reach_consts::*; +use crate::reach_constants::*; use crate::reach_init::REACH_SEND_CHANNEL_MAP; #[cfg(feature = "simple-client")] use crate::reach_invoke::Client; diff --git a/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_trigger_scene.rs b/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_trigger_scene.rs index b3bc667d4..c2dfe6888 100644 --- a/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_trigger_scene.rs +++ b/backend/supports/reach/src/api/reach_api_cc/reach_api_cc_trigger_scene.rs @@ -7,7 +7,7 @@ use tardis::web::poem_openapi::param::Query; use tardis::web::web_resp::{TardisApiResult, TardisResp}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; #[cfg(feature = "simple-client")] use crate::reach_invoke::Client; use crate::serv::*; diff --git a/backend/supports/reach/src/api/reach_api_ci/reach_api_ci_message.rs b/backend/supports/reach/src/api/reach_api_ci/reach_api_ci_message.rs index a214afe13..cdef16d21 100644 --- a/backend/supports/reach/src/api/reach_api_ci/reach_api_ci_message.rs +++ b/backend/supports/reach/src/api/reach_api_ci/reach_api_ci_message.rs @@ -7,7 +7,7 @@ use tardis::web::poem_openapi::payload::Json; use tardis::web::web_resp::{TardisApiResult, TardisResp, Void}; use crate::dto::*; -use crate::reach_consts::*; +use crate::reach_constants::*; #[cfg(feature = "simple-client")] use crate::reach_invoke::Client; use crate::serv::*; diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_message.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_message.rs index b72f262d4..9aa743935 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_message.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_message.rs @@ -8,7 +8,7 @@ use tardis::web::poem_openapi::payload::Json; use tardis::web::web_resp::{TardisApiResult, TardisPage, TardisResp}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; #[cfg(feature = "simple-client")] use crate::reach_invoke::Client; use crate::serv::*; diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_log.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_log.rs index 0a659fcc6..3fb81e717 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_log.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_log.rs @@ -1,5 +1,5 @@ use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; #[cfg(feature = "simple-client")] use crate::reach_invoke::Client; use crate::serv::*; diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_signature.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_signature.rs index 058cea7d2..7307f6a99 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_signature.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_signature.rs @@ -8,7 +8,7 @@ use tardis::web::poem_openapi; use tardis::web::web_resp::{TardisApiResult, TardisPage, TardisResp}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; use crate::serv::*; #[cfg(feature = "simple-client")] diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_template.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_template.rs index 2c06802c5..5c1994e79 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_template.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_msg_template.rs @@ -8,7 +8,7 @@ use tardis::web::poem_openapi; use tardis::web::web_resp::{TardisApiResult, TardisPage, TardisResp}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; use crate::serv::*; #[cfg(feature = "simple-client")] diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_global.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_global.rs index 9b1e02763..5b59ad67a 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_global.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_global.rs @@ -7,7 +7,7 @@ use tardis::web::poem_openapi; use tardis::web::web_resp::{TardisApiResult, TardisResp, Void}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; use crate::serv::*; #[cfg(feature = "simple-client")] diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_instance.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_instance.rs index d40849515..5efd3e9df 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_instance.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_trigger_instance.rs @@ -8,7 +8,7 @@ use tardis::web::poem_openapi::payload::Json; use tardis::web::web_resp::{TardisApiResult, TardisResp, Void}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; use crate::serv::*; #[cfg(feature = "simple-client")] diff --git a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_vcode_strategy.rs b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_vcode_strategy.rs index ed0043626..93373a869 100644 --- a/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_vcode_strategy.rs +++ b/backend/supports/reach/src/api/reach_api_ct/reach_api_ct_vcode_strategy.rs @@ -6,7 +6,7 @@ use tardis::web::poem_openapi::payload::Json; use tardis::web::web_resp::{TardisApiResult, TardisResp, Void}; use crate::dto::*; -use crate::reach_consts::get_tardis_inst; +use crate::reach_constants::get_tardis_inst; use crate::serv::*; #[cfg(feature = "simple-client")] diff --git a/backend/supports/reach/src/lib.rs b/backend/supports/reach/src/lib.rs index dec279d14..3a07e3cd4 100644 --- a/backend/supports/reach/src/lib.rs +++ b/backend/supports/reach/src/lib.rs @@ -5,7 +5,7 @@ mod api; mod domain; pub mod dto; pub mod reach_config; -pub mod reach_consts; +pub mod reach_constants; mod reach_init; pub mod reach_send_channel; diff --git a/backend/supports/reach/src/reach_consts.rs b/backend/supports/reach/src/reach_constants.rs similarity index 100% rename from backend/supports/reach/src/reach_consts.rs rename to backend/supports/reach/src/reach_constants.rs diff --git a/backend/supports/reach/src/reach_init.rs b/backend/supports/reach/src/reach_init.rs index 234715220..3b05cf716 100644 --- a/backend/supports/reach/src/reach_init.rs +++ b/backend/supports/reach/src/reach_init.rs @@ -16,7 +16,7 @@ use crate::{ api, dto::ReachTriggerSceneTree, reach_config::ReachConfig, - reach_consts::{get_tardis_inst, DOMAIN_CODE, DOMAIN_REACH_ID, RBUM_EXT_TABLE_REACH_MESSAGE, RBUM_KIND_CODE_REACH_MESSAGE, REACH_INIT_OWNER}, + reach_constants::{get_tardis_inst, DOMAIN_CODE, DOMAIN_REACH_ID, RBUM_EXT_TABLE_REACH_MESSAGE, RBUM_KIND_CODE_REACH_MESSAGE, REACH_INIT_OWNER}, reach_send_channel::SendChannelMap, task, }; diff --git a/backend/supports/reach/src/reach_invoke.rs b/backend/supports/reach/src/reach_invoke.rs index f320f15b7..57d6cc070 100644 --- a/backend/supports/reach/src/reach_invoke.rs +++ b/backend/supports/reach/src/reach_invoke.rs @@ -14,7 +14,7 @@ impl<'a> Client<'a> { } impl SimpleInvokeClient for Client<'_> { - const DOMAIN_CODE: &'static str = crate::reach_consts::DOMAIN_CODE; + const DOMAIN_CODE: &'static str = crate::reach_constants::DOMAIN_CODE; fn get_ctx(&self) -> &tardis::basic::dto::TardisContext { self.ctx diff --git a/backend/supports/reach/src/serv/message_send.rs b/backend/supports/reach/src/serv/message_send.rs index a5fe8a14e..55b87a4f0 100644 --- a/backend/supports/reach/src/serv/message_send.rs +++ b/backend/supports/reach/src/serv/message_send.rs @@ -7,7 +7,7 @@ use tardis::{ TardisFunsInst, }; -use crate::{domain, dto::*, reach_consts::*, serv::*}; +use crate::{domain, dto::*, reach_constants::*, serv::*}; pub async fn message_send(send_req: ReachMsgSendReq, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { tardis::tracing::debug!("[BIOS.Reach] input: {:?}", send_req); diff --git a/backend/supports/reach/src/task/message_send_listener.rs b/backend/supports/reach/src/task/message_send_listener.rs index 8b511805d..86d1befc2 100644 --- a/backend/supports/reach/src/task/message_send_listener.rs +++ b/backend/supports/reach/src/task/message_send_listener.rs @@ -1,6 +1,6 @@ use std::{collections::HashSet, sync::Arc}; -use crate::{domain::*, dto::*, reach_config::ReachConfig, reach_consts::*, reach_init::get_reach_send_channel_map, reach_send_channel::*, serv::*}; +use crate::{domain::*, dto::*, reach_config::ReachConfig, reach_constants::*, reach_init::get_reach_send_channel_map, reach_send_channel::*, serv::*}; use bios_basic::rbum::{helper::rbum_scope_helper, serv::rbum_crud_serv::RbumCrudOperation}; use bios_sdk_invoke::clients::iam_client::IamClient; use tardis::{ diff --git a/backend/supports/reach/tests/test_message_send.rs b/backend/supports/reach/tests/test_message_send.rs index 9b9c22219..f582375ce 100644 --- a/backend/supports/reach/tests/test_message_send.rs +++ b/backend/supports/reach/tests/test_message_send.rs @@ -2,7 +2,7 @@ use bios_basic::rbum::dto::rbum_item_dto::RbumItemAddReq; use tardis::{basic::result::TardisResult, log, serde_json::json, testcontainers, tokio}; mod test_reach_common; -use bios_reach::{dto::*, reach_consts::*, reach_invoke}; +use bios_reach::{dto::*, reach_constants::*, reach_invoke}; use test_reach_common::*; #[tokio::test(flavor = "multi_thread")] pub async fn test_ct_api() -> TardisResult<()> { diff --git a/backend/supports/reach/tests/test_reach_common.rs b/backend/supports/reach/tests/test_reach_common.rs index 8f401dfc4..603e5a6d5 100644 --- a/backend/supports/reach/tests/test_reach_common.rs +++ b/backend/supports/reach/tests/test_reach_common.rs @@ -7,7 +7,7 @@ use bios_basic::rbum::serv::rbum_item_serv::RbumItemServ; use bios_basic::rbum::serv::rbum_kind_serv::RbumKindServ; use bios_basic::{rbum::rbum_config::RbumConfig, test::test_http_client::TestHttpClient}; use bios_client_hwsms::{SmsId, SmsResponse}; -use bios_reach::reach_consts::{get_tardis_inst, DOMAIN_CODE, IAM_KEY_PHONE_V_CODE, RBUM_KIND_CODE_REACH_MESSAGE, REACH_INIT_OWNER}; +use bios_reach::reach_constants::{get_tardis_inst, DOMAIN_CODE, IAM_KEY_PHONE_V_CODE, RBUM_KIND_CODE_REACH_MESSAGE, REACH_INIT_OWNER}; use bios_reach::reach_send_channel::SendChannelMap; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/backend/supports/reach/tests/test_send_client.rs b/backend/supports/reach/tests/test_send_client.rs index 276901cec..7af8dab04 100644 --- a/backend/supports/reach/tests/test_send_client.rs +++ b/backend/supports/reach/tests/test_send_client.rs @@ -4,7 +4,7 @@ use std::time::Duration; use tardis::{basic::result::TardisResult, testcontainers, tokio}; mod test_reach_common; -use bios_reach::{reach_consts::*, reach_invoke}; +use bios_reach::{reach_constants::*, reach_invoke}; use test_reach_common::*; #[derive(Deserialize)] pub struct TestConfig { diff --git a/frontend/clients/hwsms/src/ext/reach.rs b/frontend/clients/hwsms/src/ext/reach.rs index 712a3021d..bb84947ff 100644 --- a/frontend/clients/hwsms/src/ext/reach.rs +++ b/frontend/clients/hwsms/src/ext/reach.rs @@ -6,7 +6,7 @@ use std::{ use bios_reach::{ dto::{ContentReplace, ReachChannelKind}, reach_config::ReachConfig, - reach_consts::MODULE_CODE, + reach_constants::MODULE_CODE, reach_send_channel::{GenericTemplate, SendChannel}, }; use tardis::{