This commit is contained in:
gengteng
2023-07-22 13:04:03 +08:00
parent c30f4eba4b
commit ba2b94b783
5 changed files with 152 additions and 4 deletions

View File

@@ -12,6 +12,8 @@ cargo add axum-valid
use validator::Validate;
use serde::Deserialize;
use axum_valid::Valid;
use axum::extract::Query;
use axum::Json;
#[derive(Debug, Validate, Deserialize)]
pub struct Pager {
@@ -35,3 +37,5 @@ pub async fn get_page_by_json(
assert!((1..).contains(&pager.page_no));
}
```
For more usage examples, please refer to the `basic.rs` and `custom.rs` files in the `tests` directory.