消息渠道的消息支持多语言

This commit is contained in:
xintaofei
2026-03-31 13:49:16 +08:00
parent f2a53acc9d
commit f06360a59d
24 changed files with 1319 additions and 102 deletions

View File

@@ -225,3 +225,24 @@ pub async fn set_chat_event_filter(
cc_commands::set_chat_event_filter_core(&state.db, params.filter).await?;
Ok(Json(()))
}
pub async fn get_chat_message_language(
Extension(state): Extension<Arc<AppState>>,
) -> Result<Json<String>, AppCommandError> {
let result = cc_commands::get_chat_message_language_core(&state.db).await?;
Ok(Json(result))
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SetMessageLanguageParams {
pub language: String,
}
pub async fn set_chat_message_language(
Extension(state): Extension<Arc<AppState>>,
Json(params): Json<SetMessageLanguageParams>,
) -> Result<Json<()>, AppCommandError> {
cc_commands::set_chat_message_language_core(&state.db, params.language).await?;
Ok(Json(()))
}