File tree 3 files changed +43
-0
lines changed
crates/rs-tauri-vue/src-tauri/src
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ use serde:: { Deserialize , Serialize } ;
2
+
3
+ // 交易所参数:
4
+ #[ derive( Debug , Clone , Deserialize , Serialize ) ]
5
+ pub struct ExchangeEntity {
6
+ pub exchange_name : String ,
7
+
8
+ // keys:
9
+ pub keys : Vec < ApiKeyEntity > ,
10
+ }
11
+
12
+ #[ derive( Debug , Clone , Deserialize , Serialize ) ]
13
+ pub struct ApiKeyEntity {
14
+ // api key:
15
+ pub key : String ,
16
+
17
+ // 类型: read, write
18
+ pub typ : String ,
19
+
20
+ // 备注:
21
+ pub label : String ,
22
+
23
+ // 激活状态:
24
+ pub is_activated : bool ,
25
+ }
Original file line number Diff line number Diff line change
1
+ pub mod exchange;
1
2
pub mod kv;
2
3
4
+ pub use exchange:: * ;
3
5
pub use kv:: * ;
Original file line number Diff line number Diff line change 2
2
pub enum AppStorageKeys {
3
3
AppName ,
4
4
AppVersion ,
5
+ // 语言:
5
6
AppLocale ,
7
+
8
+ // 显示币种
9
+ SelectedCoins ,
10
+ // 基准货币类型:
11
+ BaseCurrency ,
12
+ // 查询周期:
13
+ Tick ,
14
+
15
+ // 交易所 api key:
16
+ ExchangeApiKey ,
6
17
}
7
18
8
19
impl AppStorageKeys {
@@ -11,6 +22,11 @@ impl AppStorageKeys {
11
22
AppStorageKeys :: AppLocale => "app:locale" ,
12
23
AppStorageKeys :: AppVersion => "app:version" ,
13
24
AppStorageKeys :: AppName => "app:name" ,
25
+ AppStorageKeys :: SelectedCoins => "app:selected:coins" ,
26
+ AppStorageKeys :: BaseCurrency => "app:base:currency" ,
27
+ AppStorageKeys :: Tick => "app:tick" ,
28
+ AppStorageKeys :: ExchangeApiKey => "app:exchange" ,
29
+
14
30
_ => "not:found" ,
15
31
}
16
32
}
You can’t perform that action at this time.
0 commit comments