Skip to content

Commit

Permalink
fix: compile error (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzIsGod1019 authored Mar 26, 2024
1 parent 1fa9486 commit e9ced87
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 56 deletions.
22 changes: 11 additions & 11 deletions middleware/flow/src/api/ci/flow_ci_inst_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl FlowCiInstApi {
#[oai(path = "/", method = "post")]
async fn start(&self, add_req: Json<FlowInstStartReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<String> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
let result = FlowInstServ::start(&add_req.0, None, &funs, &ctx.0).await?;
funs.commit().await?;
Expand All @@ -34,7 +34,7 @@ impl FlowCiInstApi {
#[oai(path = "/:flow_inst_id", method = "get")]
async fn get(&self, flow_inst_id: Path<String>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<FlowInstDetailResp> {
let funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let result = FlowInstServ::get(&flow_inst_id.0, &funs, &ctx.0).await?;
TardisResp::ok(result)
}
Expand All @@ -48,7 +48,7 @@ impl FlowCiInstApi {
request: &Request,
) -> TardisApiResult<Vec<FlowInstFindStateAndTransitionsResp>> {
let funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let result = FlowInstServ::find_state_and_next_transitions(&find_req.0, &funs, &ctx.0).await?;
TardisResp::ok(result)
}
Expand All @@ -57,7 +57,7 @@ impl FlowCiInstApi {
#[oai(path = "/:flow_inst_id", method = "put")]
async fn abort(&self, flow_inst_id: Path<String>, abort_req: Json<FlowInstAbortReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Void> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
FlowInstServ::abort(&flow_inst_id.0, &abort_req.0, &funs, &ctx.0).await?;
funs.commit().await?;
Expand All @@ -74,7 +74,7 @@ impl FlowCiInstApi {
request: &Request,
) -> TardisApiResult<FlowInstTransferResp> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let mut transfer = transfer_req.0;
FlowInstServ::check_transfer_vars(&flow_inst_id.0, &mut transfer, &funs, &ctx.0).await?;
funs.begin().await?;
Expand All @@ -93,7 +93,7 @@ impl FlowCiInstApi {
request: &Request,
) -> TardisApiResult<Vec<FlowInstTransferResp>> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let mut result = vec![];
let flow_inst_ids: Vec<_> = flow_inst_ids.split(',').collect();
let raw_transfer_req = transfer_req.0;
Expand Down Expand Up @@ -121,7 +121,7 @@ impl FlowCiInstApi {
request: &Request,
) -> TardisApiResult<Void> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
FlowInstServ::modify_assigned(&flow_inst_id.0, &modify_req.0.current_assigned, &funs, &ctx.0).await?;
funs.commit().await?;
Expand All @@ -138,7 +138,7 @@ impl FlowCiInstApi {
request: &Request,
) -> TardisApiResult<Void> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
FlowInstServ::modify_current_vars(&flow_inst_id.0, &modify_req.0.vars, &funs, &ctx.0).await?;
funs.commit().await?;
Expand All @@ -149,7 +149,7 @@ impl FlowCiInstApi {
#[oai(path = "/bind", method = "post")]
async fn bind(&self, add_req: Json<FlowInstBindReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<String> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let inst_id = FlowInstServ::get_inst_ids_by_rel_business_obj_id(vec![add_req.0.rel_business_obj_id.clone()], &funs, &ctx.0).await?.pop();
let result = if let Some(inst_id) = inst_id {
inst_id
Expand Down Expand Up @@ -177,7 +177,7 @@ impl FlowCiInstApi {
#[oai(path = "/batch_bind", method = "post")]
async fn batch_bind(&self, add_req: Json<FlowInstBatchBindReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Vec<FlowInstBatchBindResp>> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
let result = FlowInstServ::batch_bind(&add_req.0, &funs, &ctx.0).await?;
funs.commit().await?;
Expand All @@ -188,7 +188,7 @@ impl FlowCiInstApi {
#[oai(path = "/find_detail_by_obj_ids", method = "get")]
async fn find_detail_by_obj_ids(&self, obj_ids: Query<String>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Vec<FlowInstDetailResp>> {
let funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let rel_business_obj_ids: Vec<_> = obj_ids.0.split(',').map(|id| id.to_string()).collect();
let inst_ids = FlowInstServ::get_inst_ids_by_rel_business_obj_id(rel_business_obj_ids, &funs, &ctx.0).await?;
let mut result = vec![];
Expand Down
6 changes: 3 additions & 3 deletions middleware/flow/src/api/ci/flow_ci_model_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl FlowCiModelApi {
request: &Request,
) -> TardisApiResult<FlowModelAggResp> {
let funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let model_id = FlowModelServ::find_one_item(
&FlowModelFilterReq {
basic: RbumBasicFilterReq {
Expand Down Expand Up @@ -59,7 +59,7 @@ impl FlowCiModelApi {
request: &Request,
) -> TardisApiResult<Vec<FlowModelFindRelStateResp>> {
let funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let result = FlowModelServ::find_rel_states(tag.0.split(',').collect(), rel_template_id.0, &funs, &ctx.0).await?;

TardisResp::ok(result)
Expand All @@ -74,7 +74,7 @@ impl FlowCiModelApi {
request: &Request,
) -> TardisApiResult<Vec<FlowModelAddCustomModelResp>> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
let proj_template_id = req.0.proj_template_id.unwrap_or_default();
let mut result = vec![];
Expand Down
4 changes: 2 additions & 2 deletions middleware/flow/src/api/ci/flow_ci_state_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl FlowCiStateApi {
request: &Request,
) -> TardisApiResult<TardisPage<FlowStateSummaryResp>> {
let funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;

let (scope_level, with_sub_own_paths) = if let Some(is_global) = is_global.0 {
if is_global {
Expand Down Expand Up @@ -92,7 +92,7 @@ impl FlowCiStateApi {
request: &Request,
) -> TardisApiResult<Vec<FlowStateCountGroupByStateResp>> {
let mut funs = flow_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
let result = FlowStateServ::count_group_by_state(&req.0, &funs, &ctx.0).await?;
funs.commit().await?;
Expand Down
12 changes: 6 additions & 6 deletions support/iam/src/console_interface/api/iam_ci_account_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl IamCiAccountApi {
request: &Request,
) -> TardisApiResult<TardisPage<IamAccountSummaryAggResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?;
add_remote_ip(request, &ctx).await?;
let rel = role_ids.0.map(|role_ids| {
Expand Down Expand Up @@ -127,7 +127,7 @@ impl IamCiAccountApi {
#[oai(path = "/:id/ctx", method = "get")]
async fn get_account_context(&self, id: Path<String>, app_id: Query<Option<String>>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<String> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
let mut ctx_resp = IamIdentCacheServ::get_account_context(&id.0, &app_id.0.unwrap_or((&"").to_string()), &funs).await?;
ctx_resp.own_paths = ctx.0.own_paths;
Expand All @@ -138,7 +138,7 @@ impl IamCiAccountApi {
#[oai(path = "/:id", method = "get")]
async fn get(&self, id: Path<String>, tenant_id: Query<Option<String>>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<IamAccountDetailAggResp> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0)?;
add_remote_ip(request, &ctx).await?;
let result = IamAccountServ::get_account_detail_aggs(
Expand Down Expand Up @@ -174,7 +174,7 @@ impl IamCiAccountApi {
request: &Request,
) -> TardisApiResult<Option<IamAccountDetailResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?;
add_remote_ip(request, &ctx).await?;
let supplier = supplier.0.unwrap_or_default();
Expand Down Expand Up @@ -234,7 +234,7 @@ impl IamCiAccountApi {
request: &Request,
) -> TardisApiResult<Vec<RbumSetItemDetailResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?;
Expand Down Expand Up @@ -301,7 +301,7 @@ impl IamCiAccountApi {
request: &Request,
) -> TardisApiResult<Vec<RbumSetItemDetailResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?;
Expand Down
8 changes: 4 additions & 4 deletions support/iam/src/console_interface/api/iam_ci_app_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl IamCiAppApi {
#[oai(path = "/", method = "post")]
async fn add(&self, add_req: Json<IamAppAggAddReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<String> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
funs.begin().await?;
let result = IamAppServ::add_app_agg(&add_req.0, &funs, &ctx.0).await?;
Expand All @@ -48,7 +48,7 @@ impl IamCiAppApi {
#[oai(path = "/", method = "put")]
async fn modify(&self, modify_req: Json<IamAppAggModifyReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Option<String>> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
funs.begin().await?;

Expand All @@ -72,7 +72,7 @@ impl IamCiAppApi {
request: &Request,
) -> TardisApiResult<Vec<RbumSetItemDetailResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?;
Expand Down Expand Up @@ -139,7 +139,7 @@ impl IamCiAppApi {
request: &Request,
) -> TardisApiResult<Vec<RbumSetItemDetailResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl IamCiAppSetApi {
request: &Request,
) -> TardisApiResult<Vec<RbumSetItemDetailResp>> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?;
Expand Down
18 changes: 9 additions & 9 deletions support/iam/src/console_interface/api/iam_ci_cert_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl IamCiCertManageApi {
#[oai(path = "/aksk", method = "post")]
async fn add_aksk(&self, add_req: Json<IamCertAkSkAddReq>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<IamCertAkSkResp> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, Some(add_req.tenant_id.clone()))?;
add_remote_ip(request, &ctx).await?;
funs.begin().await?;
Expand All @@ -53,7 +53,7 @@ impl IamCiCertManageApi {
#[oai(path = "/aksk", method = "delete")]
async fn delete_aksk(&self, id: Query<String>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Void> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
funs.begin().await?;
IamCiCertAkSkServ::delete_cert(&id.0, &funs, &ctx.0).await?;
Expand Down Expand Up @@ -82,7 +82,7 @@ impl IamCiCertApi {
#[oai(path = "/get/:id", method = "get")]
async fn get_cert_by_id(&self, id: Path<String>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<IamCertAkSkResp> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
let ak = RbumCertServ::find_one_detail_rbum(
&RbumCertFilterReq {
Expand Down Expand Up @@ -117,7 +117,7 @@ impl IamCiCertApi {
request: &Request,
) -> TardisApiResult<RbumCertSummaryWithSkResp> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?;
add_remote_ip(request, &ctx).await?;
let supplier = supplier.0.unwrap_or_default();
Expand Down Expand Up @@ -151,7 +151,7 @@ impl IamCiCertApi {
request: &Request,
) -> TardisApiResult<Void> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
funs.begin().await?;
IamCertServ::add_3th_kind_cert(&mut add_req.0, &account_id.0, &funs, &ctx.0).await?;
Expand All @@ -170,7 +170,7 @@ impl IamCiCertApi {
request: &Request,
) -> TardisApiResult<RbumCertSummaryWithSkResp> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
let rbum_cert = IamCertServ::get_3th_kind_cert_by_rel_rubm_id(&account_id.0, vec![supplier.0], &funs, &ctx.0).await?;
ctx.0.execute_task().await?;
Expand All @@ -183,7 +183,7 @@ impl IamCiCertApi {
#[oai(path = "/sync", method = "get")]
async fn third_integration_sync(&self, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<String> {
let funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
add_remote_ip(request, &ctx.0).await?;
let msg = IamCertServ::third_integration_sync_without_config(&funs, &ctx.0).await?;
ctx.0.execute_task().await?;
Expand All @@ -194,7 +194,7 @@ impl IamCiCertApi {
#[oai(path = "/decode", method = "post")]
async fn decode_certs(&self, body: Json<IamCertDecodeRequest>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<HashMap<String, String>> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
funs.begin().await?;
Expand Down Expand Up @@ -233,7 +233,7 @@ impl IamCiLdapCertApi {
request: &Request,
) -> TardisApiResult<IamCertConfLdapResp> {
let mut funs = iam_constants::get_tardis_inst();
unsafe_fill_ctx(request, &funs, &mut ctx.0).await?;
unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?;
add_remote_ip(request, &ctx).await?;
funs.begin().await?;
Expand Down
Loading

0 comments on commit e9ced87

Please sign in to comment.