mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 00:47:53 +00:00
folder token
This commit is contained in:
1 parent
a19ab28529
commit
aec3aa2939
3 files changed
+20
No files matched your search
@@ -33,6 +33,7 @@ pub(crate) enum TokenPrefix {
|
||||
DebugLogEvent,
|
||||
DownloadJob,
|
||||
EmailSenderJob,
|
||||
Folder,
|
||||
GoogleSignInAccount,
|
||||
InferenceJob,
|
||||
MediaFile,
|
||||
@@ -121,6 +122,7 @@ impl PrefixGenerator for TokenPrefix {
|
||||
Self::DebugLogEvent => "dbg_",
|
||||
Self::DownloadJob => "jdown_", // NB: Previously "JGUP:"
|
||||
Self::EmailSenderJob => "email_job_",
|
||||
Self::Folder => "folder_",
|
||||
Self::GoogleSignInAccount => "gsi_",
|
||||
Self::InferenceJob => "jinf_",
|
||||
Self::MediaFile => "m_",
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::prefixes::TokenPrefix;
|
||||
|
||||
/// The primary key for folders.
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize, Deserialize, Default, ToSchema)]
|
||||
#[cfg_attr(feature = "database", derive(sqlx::Type))]
|
||||
#[cfg_attr(feature = "database", sqlx(transparent))]
|
||||
pub struct FolderToken(pub String);
|
||||
|
||||
impl_mysql_token_from_row!(FolderToken);
|
||||
impl_string_token!(FolderToken);
|
||||
impl_crockford_generator!(FolderToken, 32usize, TokenPrefix::Folder, CrockfordLower);
|
||||
@@ -10,6 +10,7 @@ pub mod characters;
|
||||
pub mod comments;
|
||||
pub mod email_sender_job_token;
|
||||
pub mod firehose_entries;
|
||||
pub mod folders;
|
||||
pub mod generic_download_jobs;
|
||||
pub mod generic_inference_jobs;
|
||||
pub mod google_sign_in_accounts;
|
||||
|
||||
Reference in new issue
Block a user