mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 00:47:53 +00:00
tag token
This commit is contained in:
1 parent
ba76e70242
commit
f584cd103f
3 files changed
+19
No files matched your search
@@ -36,6 +36,7 @@ pub(crate) enum TokenPrefix {
|
||||
NewsStory, // NB: aichatbot / sqlite
|
||||
PasswordReset,
|
||||
Prompt,
|
||||
Tag,
|
||||
TtsRenderTask, // NB: aichatbot / sqlite
|
||||
User,
|
||||
UserBookmark,
|
||||
@@ -105,6 +106,7 @@ impl PrefixGenerator for TokenPrefix {
|
||||
Self::NewsStory => "news_story_",
|
||||
Self::PasswordReset => "pw_reset_",
|
||||
Self::Prompt => "prompt_",
|
||||
Self::Tag => "tag_",
|
||||
Self::TtsRenderTask => "tts_task_",
|
||||
Self::User => "user_", // NB: Previously "U:"
|
||||
Self::UserBookmark => "ub_",
|
||||
|
||||
@@ -38,3 +38,4 @@ pub mod w2l_templates;
|
||||
pub mod zs_voice_dataset_samples;
|
||||
pub mod zs_voice_datasets;
|
||||
pub mod zs_voices;
|
||||
mod tags;
|
||||
@@ -0,0 +1,16 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::prefixes::TokenPrefix;
|
||||
|
||||
/// The primary key for Prompts
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, sqlx::Type, Debug, Serialize, Deserialize, ToSchema)]
|
||||
#[sqlx(transparent)]
|
||||
pub struct TagToken(pub String);
|
||||
|
||||
impl_crockford_generator!(TagToken, 32usize, TokenPrefix::Tag, CrockfordLower);
|
||||
impl_mysql_token_from_row!(TagToken);
|
||||
impl_string_token!(TagToken);
|
||||
Reference in new issue
Block a user