Skip to main content

futu_rest/routes/qot/reference/
misc.rs

1//! Screen, calendar, quota, market-state, and reminder REST adapters.
2
3use super::*;
4
5/// POST /api/stock-screen — 获取股票筛选结果。
6pub async fn stock_screen(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
7    adapter::proto_request_raw::<qot_stock_screen::Request, qot_stock_screen::Response>(
8        &state,
9        proto_id::QOT_STOCK_SCREEN,
10        Some(body),
11    )
12    .await
13}
14
15/// POST /api/stock-filter — 条件选股。
16pub async fn stock_filter(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
17    adapter::proto_request_raw::<qot_stock_filter::Request, qot_stock_filter::Response>(
18        &state,
19        proto_id::QOT_STOCK_FILTER,
20        Some(body),
21    )
22    .await
23}
24
25/// POST /api/future-info — 获取期货信息。
26pub async fn get_future_info(
27    State(state): State<RestState>,
28    Json(body): Json<Value>,
29) -> RawApiResult {
30    adapter::proto_request_raw::<qot_get_future_info::Request, qot_get_future_info::Response>(
31        &state,
32        proto_id::QOT_GET_FUTURE_INFO,
33        Some(body),
34    )
35    .await
36}
37
38/// POST /api/market-state — 获取市场状态。
39pub async fn get_market_state(
40    State(state): State<RestState>,
41    Json(body): Json<Value>,
42) -> RawApiResult {
43    adapter::proto_request_raw::<qot_get_market_state::Request, qot_get_market_state::Response>(
44        &state,
45        proto_id::QOT_GET_MARKET_STATE,
46        Some(body),
47    )
48    .await
49}
50
51/// POST /api/history-kline — 请求历史 K 线。
52pub async fn request_history_kl(
53    State(state): State<RestState>,
54    Json(body): Json<Value>,
55) -> RawApiResult {
56    adapter::proto_request_raw::<qot_request_history_kl::Request, qot_request_history_kl::Response>(
57        &state,
58        proto_id::QOT_REQUEST_HISTORY_KL,
59        Some(body),
60    )
61    .await
62}
63
64/// POST /api/trading-days — 查询交易日。
65pub async fn request_trading_days(
66    State(state): State<RestState>,
67    Json(body): Json<Value>,
68) -> RawApiResult {
69    adapter::proto_request_raw::<qot_request_trade_date::Request, qot_request_trade_date::Response>(
70        &state,
71        proto_id::QOT_REQUEST_TRADE_DATE,
72        Some(body),
73    )
74    .await
75}
76
77/// POST /api/rehab — 请求复权因子。
78pub async fn request_rehab(
79    State(state): State<RestState>,
80    Json(body): Json<Value>,
81) -> RawApiResult {
82    adapter::proto_request_raw::<qot_request_rehab::Request, qot_request_rehab::Response>(
83        &state,
84        proto_id::QOT_REQUEST_REHAB,
85        Some(body),
86    )
87    .await
88}
89
90/// POST /api/suspend — 获取停牌日。
91pub async fn get_suspend(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
92    adapter::proto_request_raw::<qot_get_suspend::Request, qot_get_suspend::Response>(
93        &state,
94        proto_id::QOT_GET_SUSPEND,
95        Some(body),
96    )
97    .await
98}
99
100/// POST /api/history-kl-quota — 查询历史 K 线配额。
101pub async fn request_history_kl_quota(
102    State(state): State<RestState>,
103    Json(body): Json<Value>,
104) -> RawApiResult {
105    adapter::proto_request_raw::<
106        qot_request_history_kl_quota::Request,
107        qot_request_history_kl_quota::Response,
108    >(&state, proto_id::QOT_REQUEST_HISTORY_KL_QUOTA, Some(body))
109    .await
110}
111
112/// POST /api/used-quota — 查询 daemon 已用额度。
113pub async fn get_used_quota(
114    State(state): State<RestState>,
115    Json(body): Json<Value>,
116) -> RawApiResult {
117    adapter::proto_request_raw::<used_quota::Request, used_quota::Response>(
118        &state,
119        proto_id::GET_USED_QUOTA,
120        Some(body),
121    )
122    .await
123}
124
125/// POST /api/code-change — 查询代码变更。
126pub async fn get_code_change(
127    State(state): State<RestState>,
128    Json(body): Json<Value>,
129) -> RawApiResult {
130    adapter::proto_request_raw::<qot_get_code_change::Request, qot_get_code_change::Response>(
131        &state,
132        proto_id::QOT_GET_CODE_CHANGE,
133        Some(body),
134    )
135    .await
136}
137
138/// POST /api/set-price-reminder — 设置到价提醒。
139pub async fn set_price_reminder(
140    State(state): State<RestState>,
141    Json(body): Json<Value>,
142) -> RawApiResult {
143    adapter::proto_request_raw::<qot_set_price_reminder::Request, qot_set_price_reminder::Response>(
144        &state,
145        proto_id::QOT_SET_PRICE_REMINDER,
146        Some(body),
147    )
148    .await
149}
150
151/// POST /api/price-reminder — 查询到价提醒。
152pub async fn get_price_reminder(
153    State(state): State<RestState>,
154    Json(body): Json<Value>,
155) -> RawApiResult {
156    adapter::proto_request_raw::<qot_get_price_reminder::Request, qot_get_price_reminder::Response>(
157        &state,
158        proto_id::QOT_GET_PRICE_REMINDER,
159        Some(body),
160    )
161    .await
162}