Skip to content

Commit e5c62eb

Browse files
authored
fix: reach ci add unsafe fill ctx (#757)
1 parent 945765c commit e5c62eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/supports/reach/src/api/reach_api_ci/reach_api_ci_message.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
use bios_basic::rbum::helper::rbum_scope_helper::check_without_owner_and_unsafe_fill_ctx;
12
use tardis::log as tracing;
23

34
use tardis::web::context_extractor::TardisContextExtractor;
45

6+
use tardis::web::poem::Request;
57
use tardis::web::poem_openapi;
68
use tardis::web::poem_openapi::payload::Json;
79
use tardis::web::web_resp::{TardisApiResult, TardisResp, Void};
@@ -24,10 +26,11 @@ impl ReachMessageCiApi {
2426
/// 根据模板id发送信息
2527
#[oai(method = "put", path = "/send")]
2628
#[tardis::log::instrument(skip_all, fields(module = "reach"))]
27-
pub async fn message_send(&self, body: Json<ReachMsgSendReq>, ctx: TardisContextExtractor) -> TardisApiResult<Void> {
28-
let ctx = ctx.0;
29+
pub async fn message_send(&self, body: Json<ReachMsgSendReq>, request: &Request, ctx: TardisContextExtractor) -> TardisApiResult<Void> {
30+
let mut ctx = ctx.0;
2931
let funs = get_tardis_inst();
3032
let body = body.0;
33+
check_without_owner_and_unsafe_fill_ctx(request, &funs, &mut ctx)?;
3134
message_send(body, &funs, &ctx).await?;
3235
TardisResp::ok(VOID)
3336
}

0 commit comments

Comments
 (0)