Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed May 27, 2024
2 parents 9af69d3 + e5c62eb commit f944133
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub async fn add(add_req: &mut SearchItemAddReq, funs: &TardisFunsInst, ctx: &Ta
"{} {} {} {}",
add_req.title.as_str(),
pinyin_vec.clone().into_iter().map(|pinyin| pinyin.chars().next().unwrap_or_default()).join(""),
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
generate_word_combinations_with_symbol(add_req.title.as_str(), vec!["-", "_"]).join(" "),
generate_word_combinations(pinyin_vec).join(" ")
)));
} else {
Expand All @@ -55,7 +55,7 @@ pub async fn add(add_req: &mut SearchItemAddReq, funs: &TardisFunsInst, ctx: &Ta
generate_word_combinations_with_length(content, 1).join(" "),
generate_word_combinations_with_length(content, 2).join(" "),
generate_word_combinations_with_length(content, 3).join(" "),
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
generate_word_combinations_with_symbol(add_req.title.as_str(), vec!["-", "_"]).join(" "),
generate_word_combinations(pinyin_vec).join(" ")
)));
}
Expand Down Expand Up @@ -133,7 +133,7 @@ pub async fn modify(tag: &str, key: &str, modify_req: &mut SearchItemModifyReq,
"{} {} {} {}",
title,
pinyin_vec.clone().into_iter().map(|pinyin| pinyin.chars().next().unwrap_or_default()).join(""),
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
generate_word_combinations_with_symbol(title.as_str(), vec!["-", "_"]).join(" "),
generate_word_combinations(pinyin_vec).join(" ")
)));
} else {
Expand All @@ -144,7 +144,7 @@ pub async fn modify(tag: &str, key: &str, modify_req: &mut SearchItemModifyReq,
generate_word_combinations_with_length(content, 1).join(" "),
generate_word_combinations_with_length(content, 2).join(" "),
generate_word_combinations_with_length(content, 3).join(" "),
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
generate_word_combinations_with_symbol(title.as_str(), vec!["-", "_"]).join(" "),
generate_word_combinations(pinyin_vec).join(" ")
)));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use bios_basic::rbum::helper::rbum_scope_helper::check_without_owner_and_unsafe_fill_ctx;
use tardis::log as tracing;

use tardis::web::context_extractor::TardisContextExtractor;

use tardis::web::poem::Request;
use tardis::web::poem_openapi;
use tardis::web::poem_openapi::payload::Json;
use tardis::web::web_resp::{TardisApiResult, TardisResp, Void};
Expand All @@ -24,10 +26,11 @@ impl ReachMessageCiApi {
/// 根据模板id发送信息
#[oai(method = "put", path = "/send")]
#[tardis::log::instrument(skip_all, fields(module = "reach"))]
pub async fn message_send(&self, body: Json<ReachMsgSendReq>, ctx: TardisContextExtractor) -> TardisApiResult<Void> {
let ctx = ctx.0;
pub async fn message_send(&self, body: Json<ReachMsgSendReq>, request: &Request, ctx: TardisContextExtractor) -> TardisApiResult<Void> {
let mut ctx = ctx.0;
let funs = get_tardis_inst();
let body = body.0;
check_without_owner_and_unsafe_fill_ctx(request, &funs, &mut ctx)?;
message_send(body, &funs, &ctx).await?;
TardisResp::ok(VOID)
}
Expand Down

0 comments on commit f944133

Please sign in to comment.