feat: transaction query pagination
This commit is contained in:
@@ -2,8 +2,14 @@ use std::fmt;
|
||||
use std::str::FromStr;
|
||||
use serde::{de, Deserialize, Deserializer};
|
||||
|
||||
pub const QUERY_ORDER_INCREASE:i32 = 0;
|
||||
pub const QUERY_ORDER_INVERT:i32 = 1;
|
||||
|
||||
pub const MAX_QUERY_LIMIT:i32 =1000;
|
||||
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Params {
|
||||
pub struct GetAmountParams {
|
||||
#[serde(default, deserialize_with="empty_string_as_none")]
|
||||
pub transaction_id: Option<i64>,
|
||||
}
|
||||
@@ -21,3 +27,9 @@ where
|
||||
Some(s) => FromStr::from_str(s).map_err(de::Error::custom).map(Some),
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct GetTransactionsQueryParams {
|
||||
pub start: Option<i64>,
|
||||
pub limit: Option<i32>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user