- erp-ai entity 表名对齐数据库: ai_prompt/ai_analysis/ai_usage - stats_service: count() u64 → i64 显式转换 - health_data_service: 危急值检测 i32 比较修正 + req 所有权修复 - points_service: check_version 参数修正 - diagnosis_service: 补充 ActiveModelTrait 导入 - module.rs: start_overdue_checker 参数改为 DatabaseConnection - module.rs: register_handlers_with_state 避免 move
34 lines
1.0 KiB
Rust
34 lines
1.0 KiB
Rust
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "ai_analysis")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key, auto_increment = false)]
|
|
pub id: Uuid,
|
|
pub tenant_id: Uuid,
|
|
pub patient_id: Uuid,
|
|
pub analysis_type: String,
|
|
pub source_ref: String,
|
|
pub prompt_id: Uuid,
|
|
pub prompt_version: i32,
|
|
pub model_used: String,
|
|
pub input_data_hash: String,
|
|
pub sanitized_input: Option<serde_json::Value>,
|
|
pub result_content: Option<String>,
|
|
pub result_metadata: Option<serde_json::Value>,
|
|
pub status: String,
|
|
pub error_message: Option<String>,
|
|
pub created_at: DateTimeUtc,
|
|
pub updated_at: DateTimeUtc,
|
|
pub created_by: Option<Uuid>,
|
|
pub updated_by: Option<Uuid>,
|
|
pub deleted_at: Option<DateTimeUtc>,
|
|
pub version_lock: i32,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|