-
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.
* feat: Id<xxx>Result 类型添加 new 构造函数 * feat: ulid * chore: update libraries version
- Loading branch information
1 parent
518feb3
commit 3cbe2db
Showing
12 changed files
with
57 additions
and
14 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
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,13 +1,16 @@ | ||
pub mod configuration; | ||
pub mod ctx; | ||
pub mod error; | ||
mod data_error; | ||
pub mod metas; | ||
mod model; | ||
mod run_mode; | ||
pub mod security; | ||
pub mod signal; | ||
pub mod starter; | ||
pub mod trace; | ||
|
||
pub use data_error::*; | ||
pub use model::*; | ||
pub use run_mode::*; | ||
|
||
pub type Result<T> = core::result::Result<T, error::DataError>; | ||
pub type Result<T> = core::result::Result<T, DataError>; |
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,38 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Serialize, Deserialize)] | ||
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))] | ||
pub struct IdI64Result { | ||
pub id: i64, | ||
} | ||
impl IdI64Result { | ||
pub fn new(id: i64) -> Self { | ||
Self { id } | ||
} | ||
} | ||
|
||
#[cfg(feature = "uuid")] | ||
#[derive(Debug, Serialize, Deserialize)] | ||
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))] | ||
pub struct IdUuidResult { | ||
pub id: uuid::Uuid, | ||
} | ||
#[cfg(feature = "uuid")] | ||
impl IdUuidResult { | ||
pub fn new(id: uuid::Uuid) -> Self { | ||
Self { id } | ||
} | ||
} | ||
|
||
#[cfg(feature = "ulid")] | ||
#[derive(Debug, Serialize, Deserialize)] | ||
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))] | ||
pub struct IdUlidResult { | ||
pub id: ulid::Ulid, | ||
} | ||
#[cfg(feature = "ulid")] | ||
impl IdUlidResult { | ||
pub fn new(id: ulid::Ulid) -> Self { | ||
Self { id } | ||
} | ||
} |