Skip to content

Commit d654fcc

Browse files
committed
update
1 parent 73f6f21 commit d654fcc

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub mod exchange;
12
pub mod kv;
23

4+
pub use exchange::*;
35
pub use kv::*;

crates/rs-tauri-vue/src-tauri/src/storage/kv/key.rs

+16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22
pub enum AppStorageKeys {
33
AppName,
44
AppVersion,
5+
// 语言:
56
AppLocale,
7+
8+
// 显示币种
9+
SelectedCoins,
10+
// 基准货币类型:
11+
BaseCurrency,
12+
// 查询周期:
13+
Tick,
14+
15+
// 交易所 api key:
16+
ExchangeApiKey,
617
}
718

819
impl AppStorageKeys {
@@ -11,6 +22,11 @@ impl AppStorageKeys {
1122
AppStorageKeys::AppLocale => "app:locale",
1223
AppStorageKeys::AppVersion => "app:version",
1324
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+
1430
_ => "not:found",
1531
}
1632
}

0 commit comments

Comments
 (0)