mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-17 00:06:34 +00:00
Expose generic detail CRUD, aggregate contributions, and native pricing evaluation through Admin and the plugin SDK. Reuse existing request and statistics storage without schema changes; keep workflow state and recovery with callers. Co-authored-by: Zyy <zyycn@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
27 lines
629 B
Rust
27 lines
629 B
Rust
//! 由宿主传入的可信写入主体,不属于插件请求载荷
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
|
|
pub enum UsageActor {
|
|
Admin {
|
|
subject: String,
|
|
},
|
|
Plugin {
|
|
publisher: String,
|
|
name: String,
|
|
instance_id: String,
|
|
},
|
|
System,
|
|
}
|
|
|
|
impl super::UsageRecordChange {
|
|
#[must_use]
|
|
pub fn id(&self) -> &str {
|
|
match self {
|
|
Self::Put { id, .. } | Self::Update { id, .. } | Self::Delete { id } => id,
|
|
}
|
|
}
|
|
}
|