1use axum::extract::{Json, State};
4use serde_json::Value;
5
6use futu_core::proto_id;
7
8use super::*;
9
10pub async fn get_plate_set(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
11 adapter::proto_request::<qot_get_plate_set::Request, qot_get_plate_set::Response>(
12 &state,
13 proto_id::QOT_GET_PLATE_SET,
14 Some(body),
15 )
16 .await
17}
18
19pub async fn get_plate_security(
21 State(state): State<RestState>,
22 Json(body): Json<Value>,
23) -> ApiResult {
24 adapter::proto_request::<qot_get_plate_security::Request, qot_get_plate_security::Response>(
25 &state,
26 proto_id::QOT_GET_PLATE_SECURITY,
27 Some(body),
28 )
29 .await
30}
31
32pub async fn get_reference(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
34 adapter::proto_request::<qot_get_reference::Request, qot_get_reference::Response>(
35 &state,
36 proto_id::QOT_GET_REFERENCE,
37 Some(body),
38 )
39 .await
40}
41
42pub async fn get_owner_plate(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
44 adapter::proto_request::<qot_get_owner_plate::Request, qot_get_owner_plate::Response>(
45 &state,
46 proto_id::QOT_GET_OWNER_PLATE,
47 Some(body),
48 )
49 .await
50}
51
52pub async fn get_option_chain(
54 State(state): State<RestState>,
55 Json(body): Json<Value>,
56) -> ApiResult {
57 adapter::proto_request::<qot_get_option_chain::Request, qot_get_option_chain::Response>(
58 &state,
59 proto_id::QOT_GET_OPTION_CHAIN,
60 Some(body),
61 )
62 .await
63}
64
65pub async fn get_warrant(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
67 adapter::proto_request::<qot_get_warrant::Request, qot_get_warrant::Response>(
68 &state,
69 proto_id::QOT_GET_WARRANT,
70 Some(body),
71 )
72 .await
73}
74
75pub async fn get_capital_flow(
77 State(state): State<RestState>,
78 Json(body): Json<Value>,
79) -> ApiResult {
80 adapter::proto_request::<qot_get_capital_flow::Request, qot_get_capital_flow::Response>(
81 &state,
82 proto_id::QOT_GET_CAPITAL_FLOW,
83 Some(body),
84 )
85 .await
86}
87
88pub async fn get_capital_distribution(
90 State(state): State<RestState>,
91 Json(body): Json<Value>,
92) -> ApiResult {
93 adapter::proto_request::<
94 qot_get_capital_distribution::Request,
95 qot_get_capital_distribution::Response,
96 >(&state, proto_id::QOT_GET_CAPITAL_DISTRIBUTION, Some(body))
97 .await
98}
99
100pub async fn get_user_security(
102 State(state): State<RestState>,
103 Json(body): Json<Value>,
104) -> ApiResult {
105 adapter::proto_request::<qot_get_user_security::Request, qot_get_user_security::Response>(
106 &state,
107 proto_id::QOT_GET_USER_SECURITY,
108 Some(body),
109 )
110 .await
111}
112
113pub async fn stock_filter(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
115 adapter::proto_request::<qot_stock_filter::Request, qot_stock_filter::Response>(
116 &state,
117 proto_id::QOT_STOCK_FILTER,
118 Some(body),
119 )
120 .await
121}
122
123pub async fn get_ipo_list(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
125 adapter::proto_request::<qot_get_ipo_list::Request, qot_get_ipo_list::Response>(
126 &state,
127 proto_id::QOT_GET_IPO_LIST,
128 Some(body),
129 )
130 .await
131}
132
133pub async fn get_future_info(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
135 adapter::proto_request::<qot_get_future_info::Request, qot_get_future_info::Response>(
136 &state,
137 proto_id::QOT_GET_FUTURE_INFO,
138 Some(body),
139 )
140 .await
141}
142
143pub async fn get_market_state(
145 State(state): State<RestState>,
146 Json(body): Json<Value>,
147) -> ApiResult {
148 adapter::proto_request::<qot_get_market_state::Request, qot_get_market_state::Response>(
149 &state,
150 proto_id::QOT_GET_MARKET_STATE,
151 Some(body),
152 )
153 .await
154}
155
156pub async fn request_history_kl(
158 State(state): State<RestState>,
159 Json(body): Json<Value>,
160) -> ApiResult {
161 adapter::proto_request::<qot_request_history_kl::Request, qot_request_history_kl::Response>(
162 &state,
163 proto_id::QOT_REQUEST_HISTORY_KL,
164 Some(body),
165 )
166 .await
167}
168
169pub async fn request_trading_days(
173 State(state): State<RestState>,
174 Json(body): Json<Value>,
175) -> ApiResult {
176 adapter::proto_request::<qot_request_trade_date::Request, qot_request_trade_date::Response>(
177 &state,
178 proto_id::QOT_REQUEST_TRADE_DATE,
179 Some(body),
180 )
181 .await
182}
183
184pub async fn request_rehab(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
186 adapter::proto_request::<qot_request_rehab::Request, qot_request_rehab::Response>(
187 &state,
188 proto_id::QOT_REQUEST_REHAB,
189 Some(body),
190 )
191 .await
192}
193
194pub async fn get_suspend(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
196 adapter::proto_request::<qot_get_suspend::Request, qot_get_suspend::Response>(
197 &state,
198 proto_id::QOT_GET_SUSPEND,
199 Some(body),
200 )
201 .await
202}
203
204pub async fn request_history_kl_quota(
208 State(state): State<RestState>,
209 Json(body): Json<Value>,
210) -> ApiResult {
211 adapter::proto_request::<
212 qot_request_history_kl_quota::Request,
213 qot_request_history_kl_quota::Response,
214 >(&state, proto_id::QOT_REQUEST_HISTORY_KL_QUOTA, Some(body))
215 .await
216}
217
218pub async fn get_used_quota(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
220 adapter::proto_request::<used_quota::Request, used_quota::Response>(
221 &state,
222 proto_id::GET_USED_QUOTA,
223 Some(body),
224 )
225 .await
226}
227
228pub async fn get_holding_change(
230 State(state): State<RestState>,
231 Json(body): Json<Value>,
232) -> ApiResult {
233 adapter::proto_request::<
234 qot_get_holding_change_list::Request,
235 qot_get_holding_change_list::Response,
236 >(&state, proto_id::QOT_GET_HOLDING_CHANGE_LIST, Some(body))
237 .await
238}
239
240pub async fn modify_user_security(
242 State(state): State<RestState>,
243 Json(body): Json<Value>,
244) -> ApiResult {
245 adapter::proto_request::<qot_modify_user_security::Request, qot_modify_user_security::Response>(
246 &state,
247 proto_id::QOT_MODIFY_USER_SECURITY,
248 Some(body),
249 )
250 .await
251}
252
253pub async fn get_code_change(State(state): State<RestState>, Json(body): Json<Value>) -> ApiResult {
255 adapter::proto_request::<qot_get_code_change::Request, qot_get_code_change::Response>(
256 &state,
257 proto_id::QOT_GET_CODE_CHANGE,
258 Some(body),
259 )
260 .await
261}
262
263pub async fn set_price_reminder(
265 State(state): State<RestState>,
266 Json(body): Json<Value>,
267) -> ApiResult {
268 adapter::proto_request::<qot_set_price_reminder::Request, qot_set_price_reminder::Response>(
269 &state,
270 proto_id::QOT_SET_PRICE_REMINDER,
271 Some(body),
272 )
273 .await
274}
275
276pub async fn get_price_reminder(
278 State(state): State<RestState>,
279 Json(body): Json<Value>,
280) -> ApiResult {
281 adapter::proto_request::<qot_get_price_reminder::Request, qot_get_price_reminder::Response>(
282 &state,
283 proto_id::QOT_GET_PRICE_REMINDER,
284 Some(body),
285 )
286 .await
287}
288
289pub async fn get_option_expiration_date(
291 State(state): State<RestState>,
292 Json(body): Json<Value>,
293) -> ApiResult {
294 adapter::proto_request::<
295 qot_get_option_expiration_date::Request,
296 qot_get_option_expiration_date::Response,
297 >(&state, proto_id::QOT_GET_OPTION_EXPIRATION_DATE, Some(body))
298 .await
299}