File size: 1,091 Bytes
3c2af29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use serde::{Deserialize, Serialize};

use crate::app::model::{PageContent, UsageCheck, VisionAbility, Proxies};

#[derive(Serialize)]
pub struct ConfigData {
    pub page_content: Option<PageContent>,
    pub vision_ability: VisionAbility,
    pub enable_slow_pool: bool,
    pub enable_all_claude: bool,
    pub usage_check_models: UsageCheck,
    pub enable_dynamic_key: bool,
    #[serde(skip_serializing_if = "String::is_empty")]
    pub share_token: String,
    pub proxies: Proxies,
    pub include_web_references: bool,
}

#[derive(Deserialize, Default)]
#[serde(default)]
pub struct ConfigUpdateRequest {
    pub action: String, // "get", "update", "reset"
    pub path: String,
    pub content: Option<PageContent>, // "default", "text", "html"
    pub vision_ability: Option<VisionAbility>,
    pub enable_slow_pool: Option<bool>,
    pub enable_all_claude: Option<bool>,
    pub usage_check_models: Option<UsageCheck>,
    pub enable_dynamic_key: Option<bool>,
    pub share_token: Option<String>,
    pub proxies: Option<Proxies>,
    pub include_web_references: Option<bool>,
}