chore: about

This commit is contained in:
lencx
2023-01-23 20:29:05 +08:00
parent d5df706b47
commit 1f573102d3
9 changed files with 143 additions and 1 deletions

View File

@@ -354,6 +354,20 @@ pub async fn sync_prompts(app: AppHandle, time: u64) -> Option<Vec<ModelRecord>>
None
}
#[command]
pub async fn get_data(app: AppHandle, url: String, is_msg: Option<bool>) -> Option<String> {
let is_msg = is_msg.unwrap_or(false);
let res = if is_msg {
utils::get_data(&url, Some(&app)).await
} else {
utils::get_data(&url, None).await
};
res.unwrap_or_else(|err| {
info!("chatgpt_client_http_error: {}", err);
None
})
}
#[command]
pub async fn sync_user_prompts(url: String, data_type: String) -> Option<Vec<ModelRecord>> {
let res = utils::get_data(&url, None).await.unwrap_or_else(|err| {

View File

@@ -78,6 +78,7 @@ async fn main() {
cmd::cmd_list,
cmd::download_list,
cmd::get_download_list,
cmd::get_data,
fs_extra::metadata,
])
.setup(setup::init)