Skip to content

Commit

Permalink
account_name->account
Browse files Browse the repository at this point in the history
  • Loading branch information
junfalin committed Oct 22, 2020
1 parent 287e3f4 commit 1c1eec3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ cargo +nightly build
boot.toml
```toml
[common]
account_name= "150083"
account= "150083"
password= "980817"
broker= "simnow"
wsuri= "ws://192.168.2.124:7988"
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl Default for RedisConfig {
#[serde(default)]
pub struct Common {
pub log_level: String,
pub account_name: String,
pub account: String,
pub password: String,
pub broker: String,
pub wsuri: String,
Expand Down Expand Up @@ -223,7 +223,7 @@ pub fn new_config() -> Config {
}
}
} else {
let account_name = matches.value_of("account").unwrap_or("").to_string();
let account = matches.value_of("account").unwrap_or("").to_string();
let password = matches.value_of("password").unwrap_or("").to_string();
let wsuri = matches.value_of("wsuri").unwrap_or("ws://localhost:7988").to_string();
let broker = matches.value_of("broker").unwrap_or("simnow").to_string();
Expand All @@ -238,7 +238,7 @@ pub fn new_config() -> Config {
let log_level = matches.value_of("log_level").unwrap_or("info").to_string();
Config {
common: Common {
account_name,
account,
password,
broker,
wsuri,
Expand Down
4 changes: 2 additions & 2 deletions src/qawebsocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ impl QAWebSocket {
}

pub fn login(mut ws_send: Sender<OwnedMessage>) {
let user_name = CONFIG.common.account_name.clone();
let account = CONFIG.common.account.clone();
let password = CONFIG.common.password.clone();
let broker = CONFIG.common.broker.clone();
let login = XReqLogin {
topic: "login".to_string(),
aid: "req_login".to_string(),
bid: broker.clone(),
user_name: user_name.clone(),
user_name: account.clone(),
password: password.clone(),
};
let msg = serde_json::to_string(&login).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Scheduler {
let client = QAEventMQ {
amqp: CONFIG.common.eventmq_ip.clone(),
exchange: "QAORDER_ROUTER".to_string(),
routing_key: CONFIG.common.account_name.clone(),
routing_key: CONFIG.common.account.clone(),
};
client.consume_direct(ws_send)
});
Expand Down Expand Up @@ -65,7 +65,7 @@ impl Scheduler {
let ws_send = self.ws_channel.0.clone();
let db_rx = self.db_channel.1.clone();
let trade_loop = thread::spawn(move || {
let mut qatrade = QATrader::new(ws_send, CONFIG.common.account_name.clone(), CONFIG.common.password.clone(),
let mut qatrade = QATrader::new(ws_send, CONFIG.common.account.clone(), CONFIG.common.password.clone(),
CONFIG.common.wsuri.clone(), CONFIG.common.broker.clone(), CONFIG.common.portfolio.clone(),
CONFIG.common.eventmq_ip.clone(), CONFIG.common.ping_gap.clone(),
CONFIG.common.bank_password.clone(), CONFIG.common.capital_password.clone(),
Expand Down

0 comments on commit 1c1eec3

Please sign in to comment.