Skip to content

Commit

Permalink
flow: fix error (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzIsGod1019 authored Mar 21, 2024
1 parent 0967d5e commit 3c6c664
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ 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.10" }
# tardis = { version = "0.1.0-rc.10" }
# tardis = { path = "../tardis/tardis" }
# tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "6312e3305c322d48b084e14c23a8de2a879a738a" }
tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "191f3ec6220c6020b8183f2417cbe7a2ce38b1d9" }
#spacegate

# spacegate-kernel = { git = "https://github.com/ideal-world/spacegate.git", rev = "f37a81a", features = [
Expand Down
6 changes: 3 additions & 3 deletions middleware/flow/src/dto/flow_state_dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
use tardis::{
basic::field::TrimString,
chrono::{DateTime, Utc},
db::sea_orm,
db::sea_orm::{self, EnumIter},
serde_json::Value,
web::poem_openapi,
};
Expand Down Expand Up @@ -111,7 +111,7 @@ pub struct FlowStateDetailResp {
pub disabled: bool,
}

#[derive(Clone, Default, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, sea_orm::strum::EnumIter, sea_orm::DeriveActiveEnum)]
#[derive(Clone, Default, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(255))")]
pub enum FlowSysStateKind {
#[default]
Expand All @@ -123,7 +123,7 @@ pub enum FlowSysStateKind {
Finish,
}

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, sea_orm::strum::EnumIter, sea_orm::DeriveActiveEnum)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(255))")]
pub enum FlowStateKind {
#[sea_orm(string_value = "simple")]
Expand Down
6 changes: 3 additions & 3 deletions middleware/flow/src/dto/flow_transition_dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bios_basic::dto::BasicQueryCondInfo;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use strum::Display;
use tardis::{basic::field::TrimString, db::sea_orm, serde_json::Value, web::poem_openapi, TardisFuns};
use tardis::{basic::field::TrimString, db::sea_orm::{self, EnumIter}, serde_json::Value, web::poem_openapi, TardisFuns};

use super::flow_var_dto::FlowVarInfo;

Expand Down Expand Up @@ -255,7 +255,7 @@ pub struct FlowTransitionActionChangeAgg {
pub state_change_info: Option<FlowTransitionActionByStateChangeInfo>,
}

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, strum::EnumIter, sea_orm::DeriveActiveEnum)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(255))")]
pub enum FlowTransitionActionChangeKind {
#[sea_orm(string_value = "var")]
Expand All @@ -275,7 +275,7 @@ pub struct FlowTransitionActionByVarChangeInfo {
pub changed_kind: Option<FlowTransitionActionByVarChangeInfoChangedKind>,
}

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, strum::EnumIter, sea_orm::DeriveActiveEnum)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(255))")]
pub enum FlowTransitionActionByVarChangeInfoChangedKind {
#[sea_orm(string_value = "clean")]
Expand Down
3 changes: 2 additions & 1 deletion middleware/flow/src/dto/flow_var_dto.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use serde::{Deserialize, Serialize};
use std::str::FromStr;
use strum::Display;
use tardis::{
db::sea_orm::{self, strum::Display, DbErr, QueryResult, TryGetError, TryGetable},
db::sea_orm::{self, DbErr, QueryResult, TryGetError, TryGetable},
serde_json::Value,
web::poem_openapi,
};
Expand Down
2 changes: 1 addition & 1 deletion middleware/flow/src/serv/flow_rel_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bios_basic::rbum::{
};
use serde::{Deserialize, Serialize};

use tardis::db::sea_orm::strum::Display;
use strum::Display;
use tardis::{
basic::{dto::TardisContext, result::TardisResult},
chrono::{Duration, Utc},
Expand Down
4 changes: 2 additions & 2 deletions support/iam/src/basic/serv/iam_cert_ldap_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ impl IamCertLdapServ {
let _ = IamLogClient::add_ctx_task(
LogParamTag::IamAccount,
Some(ctx.owner.clone()),
"绑定5A账号".to_string(),
Some("Bind5aAccount".to_string()),
"绑定账号".to_string(),
Some("BindAccount".to_string()),
ctx,
)
.await;
Expand Down
9 changes: 5 additions & 4 deletions support/iam/src/console_interface/api/iam_ci_account_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ impl IamCiAccountApi {
ctx: TardisContextExtractor,
request: &Request,
) -> TardisApiResult<Option<IamAccountDetailResp>> {
add_remote_ip(request, &ctx.0).await?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?;
add_remote_ip(request, &ctx).await?;
let funs = iam_constants::get_tardis_inst();
let supplier = supplier.0.unwrap_or_default();
let kind = kind.0.unwrap_or_else(|| "UserPwd".to_string());
Expand All @@ -187,7 +188,7 @@ impl IamCiAccountApi {
..Default::default()
},
&funs,
&ctx.0,
&ctx,
)
.await?
{
Expand All @@ -203,7 +204,7 @@ impl IamCiAccountApi {
..Default::default()
},
&funs,
&ctx.0,
&ctx,
)
.await?,
)
Expand All @@ -214,7 +215,7 @@ impl IamCiAccountApi {
None
};

ctx.0.execute_task().await?;
ctx.execute_task().await?;
TardisResp::ok(result)
}

Expand Down
9 changes: 5 additions & 4 deletions support/iam/src/console_interface/api/iam_ci_cert_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ impl IamCiCertApi {
ctx: TardisContextExtractor,
request: &Request,
) -> TardisApiResult<RbumCertSummaryWithSkResp> {
add_remote_ip(request, &ctx.0).await?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?;
add_remote_ip(request, &ctx).await?;
let funs = iam_constants::get_tardis_inst();
let supplier = supplier.0.unwrap_or_default();
let kind = kind.0.unwrap_or_else(|| "UserPwd".to_string());
let kind = if kind.is_empty() { "UserPwd".to_string() } else { kind };

let true_tenant_id = if IamAccountServ::is_global_account(&account_id.0, &funs, &ctx.0).await? {
let true_tenant_id = if IamAccountServ::is_global_account(&account_id.0, &funs, &ctx).await? {
None
} else {
tenant_id.0
Expand All @@ -129,8 +130,8 @@ impl IamCiCertApi {
};
let ldap_dn = ldap_origin.0.unwrap_or_default();
let cert =
IamCertServ::get_cert_by_relrubmid_kind_supplier(&account_id.0, &kind, vec![supplier], conf_id, &true_tenant_id.unwrap_or_default(), ldap_dn, &funs, &ctx.0).await?;
ctx.0.execute_task().await?;
IamCertServ::get_cert_by_relrubmid_kind_supplier(&account_id.0, &kind, vec![supplier], conf_id, &true_tenant_id.unwrap_or_default(), ldap_dn, &funs, &ctx).await?;
ctx.execute_task().await?;
TardisResp::ok(cert)
}

Expand Down

0 comments on commit 3c6c664

Please sign in to comment.