-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
270 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ pub mod apis; | |
pub mod args; | ||
pub mod display; | ||
pub mod infra; | ||
pub mod logic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//! 闪存相关逻辑 | ||
//! | ||
use crate::{ | ||
apis::ing::{query_by_id, query as iq}, | ||
args::cmd::ing::QueryIng, | ||
infra::iter::IntoIteratorExt, | ||
}; | ||
|
||
pub async fn get_ings_and_comments(t: &str, q: &QueryIng) { | ||
println!("{:?}", q); | ||
if let Some(ids) = &q.id { | ||
let a = ids | ||
.iter() | ||
.map(|id| async move { query_by_id(t, id).await }) | ||
.join_all() | ||
.await | ||
; | ||
|
||
a.iter().for_each(|i| { | ||
match i { | ||
Ok(e) => { | ||
println!("{:?}", e); | ||
} | ||
Err(e) => { | ||
eprintln!("{:?}", e); | ||
} | ||
} | ||
}) | ||
|
||
} | ||
|
||
let a: Result<Vec<crate::apis::ing::IngEntry>, anyhow::Error> = iq(t, &q.into()).await; | ||
match a { | ||
Ok(e) => { | ||
println!("{:?}", e); | ||
} | ||
Err(e) => { | ||
eprintln!("{:?}", e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.