-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: pagination, folder structure,
- Loading branch information
Showing
24 changed files
with
276 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use crate::models::routers_validator_structs::{OrderEnum, PaginatedRequest}; | ||
use serde::{Deserialize, Serialize}; | ||
use strum::Display; | ||
use utoipa::{IntoParams, ToSchema}; | ||
use validator::Validate; | ||
|
||
#[derive(Serialize, Deserialize, ToSchema, Default, Eq, PartialEq, Hash, Clone, Display)] | ||
pub enum CreatureSortEnum { | ||
#[serde(alias = "id", alias = "ID")] | ||
Id, | ||
#[default] | ||
#[serde(alias = "name", alias = "NAME")] | ||
Name, | ||
#[serde(alias = "level", alias = "LEVEL")] | ||
Level, | ||
#[serde(alias = "trait", alias = "TRAIT")] | ||
Trait, | ||
#[serde(alias = "size", alias = "SIZE")] | ||
Size, | ||
#[serde(alias = "type", alias = "TYPE")] | ||
Type, | ||
#[serde(alias = "hp", alias = "HP")] | ||
Hp, | ||
#[serde(alias = "rarity", alias = "RARITY")] | ||
Rarity, | ||
#[serde(alias = "family", alias = "FAMILY")] | ||
Family, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, IntoParams, Validate, Eq, PartialEq, Hash, Default)] | ||
pub struct BestiarySortData { | ||
pub sort_by: Option<CreatureSortEnum>, | ||
pub order_by: Option<OrderEnum>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, IntoParams, Validate, Eq, PartialEq, Hash)] | ||
pub struct BestiaryPaginatedRequest { | ||
pub paginated_request: PaginatedRequest, | ||
pub bestiary_sort_data: BestiarySortData, | ||
} |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
pub mod alignment_enum; | ||
pub mod creature_role; | ||
pub mod rarity_enum; | ||
pub mod size_enum; | ||
pub mod type_enum; | ||
pub mod variant_enum; |
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
Oops, something went wrong.