Skip to main content

tdm_server_rust/sea_entity/
glossary.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.20
2
3use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6/// glossary 表的 SeaORM 行模型。
7/// 术语表,保存作品内专有名词、译名、截图和维护人信息,用于统一后续翻译口径。
8#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
9#[sea_orm(table_name = "glossary")]
10pub struct Model {
11    /// 术语表主键,自增 ID,用于唯一定位一条术语记录。 对应数据库列 `Id`。
12    #[sea_orm(column_name = "Id", primary_key)]
13    pub id: i32,
14    /// 术语分类编号,用于区分人名、地名、专有名词、字体样式等类别。 对应数据库列 `type`。
15    pub r#type: Option<i32>,
16    /// 术语示意图或截图路径,用于辅助翻译和校对确认语境。 对应数据库列 `image`。
17    pub image: Option<String>,
18    /// 原文词条内容,记录作品中出现的原始表达。 对应数据库列 `title`。
19    pub title: Option<String>,
20    /// 对应译文或统一译名,作为后续话数翻译时的参考口径。 对应数据库列 `content`。
21    pub content: Option<String>,
22    /// 所属漫画 ID,关联术语适用的具体作品。 对应数据库列 `mangaId`。
23    #[sea_orm(column_name = "mangaId")]
24    pub manga_id: Option<i32>,
25    /// 术语首次出现的话数,字符串保存以兼容番外、小数话和特殊编号。 对应数据库列 `first`。
26    pub first: Option<String>,
27    /// 最近一次维护词条内容、截图或译名的时间。 对应数据库列 `updateTime`。
28    #[sea_orm(column_name = "updateTime")]
29    pub update_time: Option<DateTime>,
30    /// 最近一次维护该词条的组员 ID。 对应数据库列 `updateBy`。
31    #[sea_orm(column_name = "updateBy")]
32    pub update_by: Option<i32>,
33}
34
35/// SeaORM 关系枚举。用于声明该实体可通过 SeaORM 自动推导的跨表关联。
36#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
37pub enum Relation {}
38
39/// 使用 SeaORM 默认 ActiveModel 行为,当前不覆盖插入、更新或删除钩子。
40impl ActiveModelBehavior for ActiveModel {}