完善folder页面的web接口实现

This commit is contained in:
xintaofei
2026-03-25 15:27:43 +08:00
parent ac09d3db9e
commit 218055ab01
18 changed files with 569 additions and 37 deletions

View File

@@ -1,2 +1,22 @@
// Version control web handlers.
// TODO: Implement git settings and GitHub account handlers for web mode.
use axum::Json;
use serde::Deserialize;
use crate::app_error::AppCommandError;
use crate::commands::folders as folder_commands;
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GitLogParams {
pub path: String,
pub limit: Option<u32>,
pub branch: Option<String>,
pub remote: Option<String>,
}
pub async fn git_log(
Json(params): Json<GitLogParams>,
) -> Result<Json<folder_commands::GitLogResult>, AppCommandError> {
let result =
folder_commands::git_log(params.path, params.limit, params.branch, params.remote).await?;
Ok(Json(result))
}