99 lines
3.0 KiB
Rust
99 lines
3.0 KiB
Rust
// 自动生成 —— 勿手动修改(chongming-worker-rs gen_models)
|
||
// 唯一事实来源: config/workers/<type>/*.toml 端点定义
|
||
// 重新生成: cargo run --bin gen_models -- --types <type1,type2,...> --out <path>
|
||
|
||
pub mod demo {
|
||
#![allow(dead_code)]
|
||
pub const FINGERPRINT: &str = "71c0a54c04bf6a8692166c71e2b6c0109c9c011e";
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct DownloadBytesGetRequest {
|
||
pub object_key: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct DownloadBytesGetResponse {
|
||
pub data_b64: String,
|
||
pub object_key: String,
|
||
pub size: i64,
|
||
pub timestamp: f64,
|
||
}
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct HelloGetRequest {
|
||
pub name: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct HelloGetResponse {
|
||
pub greeting: String,
|
||
pub timestamp: f64,
|
||
#[serde(skip_serializing_if = "Option::is_none")]
|
||
pub worker_id: Option<String>,
|
||
}
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct PresignDownloadGetRequest {
|
||
pub object_key: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct PresignDownloadGetResponse {
|
||
pub expires: i64,
|
||
pub method: String,
|
||
pub object_key: String,
|
||
pub presigned_url: String,
|
||
pub timestamp: f64,
|
||
}
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct PresignUploadPostRequest {
|
||
pub filename: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct PresignUploadPostResponse {
|
||
pub expires: i64,
|
||
pub method: String,
|
||
pub object_key: String,
|
||
pub presigned_url: String,
|
||
pub timestamp: f64,
|
||
}
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct UploadBytesPostRequest {
|
||
pub object_key: String,
|
||
pub data_b64: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct UploadBytesPostResponse {
|
||
pub object_key: String,
|
||
pub size: i64,
|
||
pub timestamp: f64,
|
||
}
|
||
}
|
||
pub mod rsdemo {
|
||
#![allow(dead_code)]
|
||
pub const FINGERPRINT: &str = "d7249b91188e422a0fd3966cfc243d051cbb53c0";
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct EchoPostRequest {
|
||
pub msg: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct EchoPostResponse {
|
||
pub echo: String,
|
||
pub timestamp: f64,
|
||
#[serde(skip_serializing_if = "Option::is_none")]
|
||
pub user_info: Option<serde_json::Value>,
|
||
#[serde(skip_serializing_if = "Option::is_none")]
|
||
pub worker_id: Option<String>,
|
||
}
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct HelloGetRequest {
|
||
pub name: String,
|
||
}
|
||
#[derive(Debug, Clone, serde::Serialize)]
|
||
pub struct HelloGetResponse {
|
||
pub greeting: String,
|
||
pub timestamp: f64,
|
||
#[serde(skip_serializing_if = "Option::is_none")]
|
||
pub worker_id: Option<String>,
|
||
}
|
||
#[derive(Debug, Clone, serde::Deserialize)]
|
||
pub struct StreamPostRequest {
|
||
pub prompt: String,
|
||
pub tokens: i64,
|
||
}
|
||
}
|