消息渠道的消息支持多语言
This commit is contained in:
@@ -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(()))
|
||||
}
|
||||
|
||||
@@ -197,6 +197,8 @@ pub fn build_router(state: Arc<AppState>, token: String, static_dir: std::path::
|
||||
.route("/set_chat_command_prefix", post(handlers::chat_channel::set_chat_command_prefix))
|
||||
.route("/get_chat_event_filter", post(handlers::chat_channel::get_chat_event_filter))
|
||||
.route("/set_chat_event_filter", post(handlers::chat_channel::set_chat_event_filter))
|
||||
.route("/get_chat_message_language", post(handlers::chat_channel::get_chat_message_language))
|
||||
.route("/set_chat_message_language", post(handlers::chat_channel::set_chat_message_language))
|
||||
// ─── Terminal ───
|
||||
.route("/terminal_spawn", post(handlers::terminal::terminal_spawn))
|
||||
.route("/terminal_write", post(handlers::terminal::terminal_write))
|
||||
|
||||
Reference in New Issue
Block a user