fix: resolve api-key function signature mismatch
**問題**: - main.rs 有舊的 handle_api_key stub - 函數簽名不匹配 **修復**: 1. 刪除 main.rs:337-352 舊函數 2. 修改 main.rs:122 調用: - action 傳引用 (&action) - ttl 類型轉換 (ttl.map(|i| i as u64)) - 添加 key_id 參數 (None) **驗證**: - ✅ 編譯成功 - ✅ 字串檢查通過 - ✅ 類型匹配正確
This commit is contained in:
+1
-17
@@ -119,7 +119,7 @@ async fn main() -> Result<()> {
|
||||
ttl,
|
||||
key,
|
||||
} => {
|
||||
handle_api_key(action, name, key_type, ttl, key).await?;
|
||||
handle_api_key(&action, name, key_type, ttl.map(|i| i as u64), key, None).await?;
|
||||
}
|
||||
Commands::Gitea {
|
||||
action,
|
||||
@@ -333,23 +333,7 @@ async fn handle_backup(action: &str, days: Option<u32>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Handle API key command
|
||||
async fn handle_api_key(
|
||||
action: ApiKeyAction,
|
||||
name: Option<String>,
|
||||
key_type: Option<String>,
|
||||
ttl: Option<i64>,
|
||||
key: Option<String>,
|
||||
) -> Result<()> {
|
||||
println!("API Key action: {:?}", action);
|
||||
println!("Name: {:?}", name);
|
||||
println!("Key type: {:?}", key_type);
|
||||
println!("TTL: {:?}", ttl);
|
||||
println!("Key: {:?}", key);
|
||||
|
||||
// TODO: Implement API key logic
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Handle Gitea command
|
||||
async fn handle_gitea(
|
||||
|
||||
Reference in New Issue
Block a user