Skip to main content

tdm_server_rust/sea_entity/
questionnaire.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.20
2
3use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6/// questionnaire 表的 SeaORM 行模型。
7/// 组员接稿意愿问卷表,记录成员偏好、雷区、接稿强度和最近派稿时间。
8#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
9#[sea_orm(table_name = "questionnaire")]
10pub struct Model {
11    /// 问卷主键,自增 ID,用于唯一定位一份接稿意愿问卷。 对应数据库列 `id`。
12    #[sea_orm(primary_key)]
13    pub id: i64,
14    /// 组员 ID,要求唯一,表示每个组员当前有效的一份接稿意愿问卷。 对应数据库列 `member_id`。
15    #[sea_orm(unique)]
16    pub member_id: i64,
17    /// 接稿意愿,1 随时可接,2 有限接稿,3 暂不接稿,默认 3。 对应数据库列 `willingness`。
18    pub willingness: i16,
19    /// 可接受篇幅集合,通常为逗号分隔值,用于派稿时筛选。 对应数据库列 `acceptable_lengths`。
20    pub acceptable_lengths: Option<String>,
21    /// 可接受更新频率,1 每周多更,2 每周一更,3 两周一更,4 不定期。 对应数据库列 `update_frequency`。
22    pub update_frequency: Option<i16>,
23    /// 偏好题材集合,通常为逗号分隔文本,用于匹配作品类型。 对应数据库列 `preferred_genres`。
24    pub preferred_genres: Option<String>,
25    /// 避免题材或雷区集合,派稿时应尽量避开。 对应数据库列 `avoid_topics`。
26    pub avoid_topics: Option<String>,
27    /// 组员补充说明,记录自由文本偏好和特殊情况。 对应数据库列 `note`。
28    #[sea_orm(column_type = "Text", nullable)]
29    pub note: Option<String>,
30    /// 管理员备注,记录派稿时的内部判断或沟通结果。 对应数据库列 `remark`。
31    #[sea_orm(column_type = "Text", nullable)]
32    pub remark: Option<String>,
33    /// 最近一次派稿时间,用于避免短期内重复分配。 对应数据库列 `last_assigned_time`。
34    pub last_assigned_time: Option<DateTime>,
35    /// 问卷创建时间,用于审计和默认排序。 对应数据库列 `created_at`。
36    pub created_at: DateTime,
37    /// 问卷最近更新时间,由数据库触发器维护。 对应数据库列 `updated_at`。
38    pub updated_at: DateTime,
39}
40
41/// SeaORM 关系枚举。用于声明该实体可通过 SeaORM 自动推导的跨表关联。
42#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
43pub enum Relation {}
44
45/// 使用 SeaORM 默认 ActiveModel 行为,当前不覆盖插入、更新或删除钩子。
46impl ActiveModelBehavior for ActiveModel {}