feat(ai): 添加 SeaORM Entity (ai_prompt/ai_analysis/ai_usage)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
24
crates/erp-ai/src/entity/ai_usage.rs
Normal file
24
crates/erp-ai/src/entity/ai_usage.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "ai_usage_logs")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: Uuid,
|
||||
pub tenant_id: Uuid,
|
||||
pub provider: String,
|
||||
pub model: String,
|
||||
pub analysis_type: String,
|
||||
pub input_tokens: i32,
|
||||
pub output_tokens: i32,
|
||||
pub duration_ms: i32,
|
||||
pub cost_cents: i32,
|
||||
pub is_cache_hit: bool,
|
||||
pub created_at: DateTimeUtc,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in New Issue
Block a user