更新版本至0.1.7:移除openai模块,更新html_scraper功能

- 删除src-tauri/openai模块及相关依赖
- 在html_scraper中添加find_latest_work_order_id函数
- 更新相关依赖配置

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yakumo Hokori
2025-09-27 21:32:42 +08:00
parent 4d005b384f
commit 6abfa2866a
1027 changed files with 18821 additions and 1790 deletions

View File

@@ -8,5 +8,4 @@ reqwest = "0.12.22"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
openai = { path = "../openai" }
html_scraper = { path = "../html_scraper" }

View File

@@ -121,8 +121,12 @@ pub async fn create_ticket(cookie: &str, n2p: &str, massageQ: &str, wx: Option<&
let workorder_bytes = workorder_res.bytes().await?;
let workorder_html = String::from_utf8_lossy(&workorder_bytes).to_string();
let system_prompt_details = "找到最新的一个工单所对应的详情按钮的url地址中id的值只要告诉我对应的值就可以不要说其他任何内容";
let details_url = openai::ask_openai(&workorder_html, system_prompt_details).await?;
let details_url = match html_scraper::find_latest_work_order_id(&workorder_html) {
Ok(Some(id)) => format!("{}", id),
Ok(None) => return Ok("没有找到最新工单的详情链接".to_string()),
Err(e) => return Ok(format!("查找最新工单详情链接时出错: {}", e)),
};
println!("最新工单详情链接{}", details_url);
Ok(details_url)
}
@@ -187,6 +191,8 @@ pub async fn close(cookie: &str, gdID: &str) -> Result<String, reqwest::Error> {
Ok(response_body)
}
#[cfg(test)]
mod tests {
use super::*;