akshare 0.1.1

100% pure Rust implementation of akshare — unified access to Chinese and global financial market data APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
//! Type definitions for stock_feature functions.

use serde::{Deserialize, Serialize};

// ---------------------------------------------------------------------------
// Spot market data (stock_zh_a_spot_em, stock_sh_a_spot_em, etc.)
// ---------------------------------------------------------------------------

/// Real-time A-share spot quote from Eastmoney.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SpotQuote {
    pub code: String,
    pub name: String,
    pub latest_price: f64,
    pub change_pct: f64,
    pub change_amount: f64,
    pub volume: f64,
    pub amount: f64,
    pub amplitude_pct: f64,
    pub high: f64,
    pub low: f64,
    pub open: f64,
    pub prev_close: f64,
    pub volume_ratio: f64,
    pub turnover_rate: f64,
    pub pe_dynamic: f64,
    pub pb: f64,
    pub total_market_cap: f64,
    pub circulating_market_cap: f64,
    pub speed: f64,
    pub change_5min: f64,
    pub change_60d: f64,
    pub change_ytd: f64,
}

// ---------------------------------------------------------------------------
// Historical data
// ---------------------------------------------------------------------------

/// Historical candlestick data point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HistData {
    pub trade_date: String,
    pub open: f64,
    pub close: f64,
    pub high: f64,
    pub low: f64,
    pub volume: f64,
    pub amount: f64,
    pub amplitude_pct: f64,
    pub change_pct: f64,
    pub change_amount: f64,
    pub turnover_rate: f64,
}

// ---------------------------------------------------------------------------
// Billboard (LHB - Dragon Tiger List)
// ---------------------------------------------------------------------------

/// Billboard detail entry (龙虎榜详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbDetail {
    pub code: String,
    pub name: String,
    pub trade_date: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub billboard_net_amount: f64,
    pub billboard_buy_amount: f64,
    pub billboard_sell_amount: f64,
    pub billboard_deal_amount: f64,
    pub total_amount: f64,
    pub net_ratio: f64,
    pub deal_ratio: f64,
    pub turnover_rate: f64,
    pub circulating_market_cap: f64,
    pub reason: String,
    pub explanation: Option<String>,
    pub d1_change: Option<f64>,
    pub d2_change: Option<f64>,
    pub d5_change: Option<f64>,
    pub d10_change: Option<f64>,
}

/// Billboard stock statistics (个股上榜统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbStockStatistic {
    pub code: String,
    pub name: String,
    pub latest_trade_date: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub billboard_times: i64,
    pub billboard_net_amount: f64,
    pub billboard_buy_amount: f64,
    pub billboard_sell_amount: f64,
    pub billboard_total_amount: f64,
    pub org_buy_times: i64,
    pub org_sell_times: i64,
    pub org_net_buy_amount: f64,
    pub org_buy_amount: f64,
    pub org_sell_amount: f64,
    pub m1_change: Option<f64>,
    pub m3_change: Option<f64>,
    pub m6_change: Option<f64>,
    pub y1_change: Option<f64>,
}

/// Billboard institutional daily statistics (机构买卖每日统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbJgmmtj {
    pub code: String,
    pub name: String,
    pub trade_date: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub buy_org_count: i64,
    pub sell_org_count: i64,
    pub org_buy_amount: f64,
    pub org_sell_amount: f64,
    pub org_net_buy_amount: f64,
    pub total_amount: f64,
    pub org_net_ratio: f64,
    pub turnover_rate: f64,
    pub circulating_market_cap: f64,
    pub reason: String,
}

/// Billboard institutional seat tracking (机构席位追踪).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbJgstatistic {
    pub code: String,
    pub name: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub billboard_amount: f64,
    pub billboard_times: i64,
    pub org_buy_amount: f64,
    pub org_buy_times: i64,
    pub org_sell_amount: f64,
    pub org_sell_times: i64,
    pub org_net_buy_amount: f64,
    pub m1_change: Option<f64>,
    pub m3_change: Option<f64>,
    pub m6_change: Option<f64>,
    pub y1_change: Option<f64>,
}

/// Billboard active trading department (每日活跃营业部).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbHyyyb {
    pub dept_name: String,
    pub trade_date: String,
    pub buy_stock_count: i64,
    pub sell_stock_count: i64,
    pub buy_amount: f64,
    pub sell_amount: f64,
    pub net_amount: f64,
    pub buy_stocks: Option<String>,
    pub dept_code: String,
}

/// Billboard trading department ranking (营业部排行).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbYybph {
    pub dept_name: String,
    pub dept_code: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub billboard_amount: f64,
    pub billboard_times: i64,
    pub buy_amount: f64,
    pub buy_times: i64,
    pub sell_amount: f64,
    pub sell_times: i64,
    pub net_buy_amount: f64,
    pub m1_change: Option<f64>,
    pub m3_change: Option<f64>,
    pub m6_change: Option<f64>,
    pub y1_change: Option<f64>,
}

/// Billboard trader statistics (游资统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbTraderStatistic {
    pub trader_name: String,
    pub trader_code: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub billboard_amount: f64,
    pub billboard_times: i64,
    pub buy_amount: f64,
    pub buy_times: i64,
    pub sell_amount: f64,
    pub sell_times: i64,
    pub net_buy_amount: f64,
    pub m1_change: Option<f64>,
    pub m3_change: Option<f64>,
    pub m6_change: Option<f64>,
    pub y1_change: Option<f64>,
}

/// Billboard stock detail date (个股上榜日期).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbStockDetailDate {
    pub trade_date: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub reason: String,
    pub billboard_net_amount: f64,
    pub billboard_buy_amount: f64,
    pub billboard_sell_amount: f64,
}

/// Billboard stock detail (个股龙虎榜详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbStockDetail {
    pub trade_date: String,
    pub code: String,
    pub name: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub dept_name: String,
    pub buy_amount: f64,
    pub sell_amount: f64,
    pub net_amount: f64,
    pub reason: String,
    pub side: String,
}

/// Billboard trading department detail (营业部龙虎榜详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbYybDetail {
    pub trade_date: String,
    pub code: String,
    pub name: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub buy_amount: f64,
    pub sell_amount: f64,
    pub net_amount: f64,
    pub reason: String,
}

// ---------------------------------------------------------------------------
// Shareholder Analysis (GDFX)
// ---------------------------------------------------------------------------

/// Shareholder holding statistics (股东持股统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdfxHoldingStatistic {
    pub holder_name: String,
    pub holder_type: Option<String>,
    pub statistics_count: Option<i64>,
    pub avg_change_10d: Option<f64>,
    pub max_change_10d: Option<f64>,
    pub min_change_10d: Option<f64>,
    pub avg_change_30d: Option<f64>,
    pub max_change_30d: Option<f64>,
    pub min_change_30d: Option<f64>,
    pub avg_change_60d: Option<f64>,
    pub max_change_60d: Option<f64>,
    pub min_change_60d: Option<f64>,
    pub holding_stocks: Option<String>,
}

/// Shareholder holding change statistics (股东持股变动统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdfxHoldingChange {
    pub holder_name: String,
    pub holder_type: Option<String>,
    pub total_holdings: i64,
    pub new_positions: i64,
    pub increased: i64,
    pub unchanged: i64,
    pub decreased: i64,
    pub circulating_market_cap: Option<f64>,
    pub holding_stocks: Option<String>,
}

/// Shareholder holding detail (股东持股明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdfxHoldingDetail {
    pub holder_name: String,
    pub holder_type: Option<String>,
    pub code: String,
    pub name: String,
    pub report_date: String,
    pub holding_count: f64,
    pub holding_change: Option<f64>,
    pub holding_change_ratio: Option<f64>,
    pub holding_change_name: Option<String>,
    pub circulating_market_cap: Option<f64>,
    pub notice_date: String,
}

/// Shareholder holding analysis (股东持股分析).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdfxHoldingAnalyse {
    pub code: String,
    pub name: String,
    pub report_date: String,
    pub holder_count: Option<i64>,
    pub holder_count_change: Option<i64>,
    pub holder_count_ratio: Option<f64>,
    pub avg_holding_amount: Option<f64>,
    pub avg_market_cap: Option<f64>,
    pub total_market_cap: Option<f64>,
    pub total_shares: Option<f64>,
    pub price: Option<f64>,
    pub change_pct: Option<f64>,
}

/// Top 10 shareholders (十大股东).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdfxTop10 {
    pub rank: i64,
    pub holder_name: String,
    pub holder_nature: Option<String>,
    pub share_type: Option<String>,
    pub holding_count: f64,
    pub holding_ratio: f64,
    pub change: Option<String>,
    pub change_ratio: Option<f64>,
}

// ---------------------------------------------------------------------------
// HSGT (沪深港通 - Northbound/Southbound)
// ---------------------------------------------------------------------------

/// HSGT fund flow summary (沪深港通资金流向).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtFundFlowSummary {
    pub trade_date: String,
    pub mutual_type: String,
    pub board_type: Option<String>,
    pub fund_direction: Option<String>,
    pub trade_status: Option<String>,
    pub net_buy_amount: Option<f64>,
    pub fund_net_inflow: Option<f64>,
    pub remaining_quota: Option<f64>,
    pub up_count: Option<i64>,
    pub flat_count: Option<i64>,
    pub down_count: Option<i64>,
    pub index_change_pct: Option<f64>,
}

/// HK Stock Connect components (港股通成份股).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HkGgtComponent {
    pub code: String,
    pub name: String,
    pub latest_price: f64,
    pub change_amount: f64,
    pub change_pct: f64,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub prev_close: f64,
    pub volume: f64,
    pub amount: f64,
}

/// HSGT stock holding (沪深港通持股-个股排行).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtHoldStock {
    pub code: String,
    pub name: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub holding_shares: f64,
    pub holding_market_cap: f64,
    pub holding_circulating_ratio: f64,
    pub holding_total_ratio: f64,
    pub add_shares: Option<f64>,
    pub add_market_cap: Option<f64>,
    pub add_market_cap_change: Option<f64>,
    pub add_circulating_ratio: Option<f64>,
    pub add_total_ratio: Option<f64>,
    pub sector: Option<String>,
    pub trade_date: String,
}

/// HSGT stock statistics (沪深港通持股-每日个股统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtStockStatistic {
    pub trade_date: String,
    pub name: String,
    pub code: String,
    pub holding_market_cap: f64,
    pub holding_shares: f64,
    pub holding_circulating_ratio: f64,
    pub holding_total_ratio: f64,
    pub close_price: f64,
    pub change_pct: f64,
}

/// HSGT institution statistics (沪深港通持股-机构统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtInstitutionStatistic {
    pub trade_date: String,
    pub institution_name: String,
    pub holding_market_cap: f64,
    pub holding_shares: f64,
    pub holding_count: i64,
}

/// HSGT historical data (沪深港通历史数据).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtHist {
    pub trade_date: String,
    pub fund_net_inflow: f64,
    pub fund_buy_amount: f64,
    pub fund_sell_amount: f64,
    pub index_close: f64,
    pub index_change_pct: f64,
}

/// HSGT board ranking (沪深港通板块排行).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtBoardRank {
    pub board_name: String,
    pub holding_market_cap: f64,
    pub holding_shares: f64,
    pub holding_count: i64,
    pub change_pct: Option<f64>,
}

/// HSGT individual stock detail (沪深港通个股详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HsgtIndividualDetail {
    pub trade_date: String,
    pub holding_shares: f64,
    pub holding_market_cap: f64,
    pub holding_circulating_ratio: f64,
    pub holding_total_ratio: f64,
    pub close_price: f64,
    pub change_pct: f64,
}

// ---------------------------------------------------------------------------
// Comment (千股千评)
// ---------------------------------------------------------------------------

/// Stock comment (千股千评).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StockComment {
    pub code: String,
    pub name: String,
    pub latest_price: f64,
    pub change_pct: f64,
    pub turnover_rate: f64,
    pub pe: f64,
    pub main_cost: f64,
    pub org_participation: f64,
    pub total_score: f64,
    pub rise: f64,
    pub current_rank: f64,
    pub focus_index: f64,
    pub trade_date: String,
}

/// Stock comment institution participation (机构参与度).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommentOrgParticipation {
    pub trade_date: String,
    pub org_participation: f64,
}

/// Stock comment historical score (历史评分).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommentHistScore {
    pub trade_date: String,
    pub score: f64,
}

/// Stock comment focus index (用户关注指数).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommentFocusIndex {
    pub trade_date: String,
    pub focus_index: f64,
}

/// Stock comment desire index (市场渴望指数).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommentDesireIndex {
    pub trade_date: String,
    pub desire_index: f64,
}

// ---------------------------------------------------------------------------
// Analyst (分析师)
// ---------------------------------------------------------------------------

/// Analyst ranking (分析师排行).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnalystRank {
    pub analyst_name: String,
    pub analyst_org: String,
    pub annual_index: f64,
    pub annual_return: f64,
    pub return_3m: f64,
    pub return_6m: f64,
    pub return_12m: f64,
    pub constituent_count: i64,
    pub latest_stock_name: Option<String>,
    pub latest_stock_code: Option<String>,
    pub analyst_id: String,
    pub industry_code: Option<String>,
    pub industry: Option<String>,
    pub update_date: String,
    pub year: String,
}

/// Analyst detail (分析师详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnalystDetail {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub target_price: Option<f64>,
    pub rating: Option<String>,
    pub report_title: Option<String>,
    pub publish_date: Option<String>,
}

// ---------------------------------------------------------------------------
// Financial Reports (三大报表)
// ---------------------------------------------------------------------------

/// Balance sheet entry (资产负债表).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BalanceSheet {
    pub code: String,
    pub name: String,
    pub notice_date: Option<String>,
    pub total_assets: Option<f64>,
    pub total_liabilities: Option<f64>,
    pub equity: Option<f64>,
    pub cash: Option<f64>,
    pub accounts_receivable: Option<f64>,
    pub inventory: Option<f64>,
    pub accounts_payable: Option<f64>,
    pub advance_receipts: Option<f64>,
    pub total_assets_yoy: Option<f64>,
    pub total_liabilities_yoy: Option<f64>,
    pub debt_ratio: Option<f64>,
}

/// Profit sheet entry (利润表).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProfitSheet {
    pub code: String,
    pub name: String,
    pub notice_date: Option<String>,
    pub total_revenue: Option<f64>,
    pub operating_cost: Option<f64>,
    pub operating_profit: Option<f64>,
    pub total_profit: Option<f64>,
    pub net_profit: Option<f64>,
    pub net_profit_deducted: Option<f64>,
    pub total_revenue_yoy: Option<f64>,
    pub net_profit_yoy: Option<f64>,
    pub gross_margin: Option<f64>,
    pub net_margin: Option<f64>,
    pub roe: Option<f64>,
    pub eps: Option<f64>,
}

/// Cash flow sheet entry (现金流量表).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CashFlowSheet {
    pub code: String,
    pub name: String,
    pub notice_date: Option<String>,
    pub operating_cash_flow: Option<f64>,
    pub investing_cash_flow: Option<f64>,
    pub financing_cash_flow: Option<f64>,
    pub cash_increase: Option<f64>,
    pub operating_cash_flow_yoy: Option<f64>,
}

// ---------------------------------------------------------------------------
// Earnings (业绩报表/业绩快报/业绩预告)
// ---------------------------------------------------------------------------

/// Earnings report (业绩报表).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EarningsReport {
    pub code: String,
    pub name: String,
    pub eps: f64,
    pub total_revenue: f64,
    pub total_revenue_yoy: f64,
    pub total_revenue_qoq: f64,
    pub net_profit: f64,
    pub net_profit_yoy: f64,
    pub net_profit_qoq: f64,
    pub bvps: f64,
    pub roe: f64,
    pub operating_cash_flow_per_share: f64,
    pub gross_margin: f64,
    pub industry: Option<String>,
    pub notice_date: String,
}

/// Earnings quick report (业绩快报).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EarningsQuickReport {
    pub code: String,
    pub name: String,
    pub notice_date: String,
    pub eps: Option<f64>,
    pub bvps: Option<f64>,
    pub total_revenue: Option<f64>,
    pub net_profit: Option<f64>,
    pub revenue_yoy: Option<f64>,
    pub net_profit_yoy: Option<f64>,
    pub roe: Option<f64>,
    pub net_margin: Option<f64>,
}

/// Earnings forecast (业绩预告).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EarningsForecast {
    pub code: String,
    pub name: String,
    pub notice_date: String,
    pub forecast_type: String,
    pub forecast_content: Option<String>,
    pub change_range: Option<String>,
    pub change_reason: Option<String>,
    pub previous_year_net_profit: Option<f64>,
}

// ---------------------------------------------------------------------------
// Dividends (分红送配)
// ---------------------------------------------------------------------------

/// Dividend/rights entry (分红送配).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DividendInfo {
    pub code: String,
    pub name: String,
    pub bonus_shares_ratio: Option<f64>,
    pub transfer_ratio: Option<f64>,
    pub convert_ratio: Option<f64>,
    pub cash_dividend_ratio: Option<f64>,
    pub dividend_yield: Option<f64>,
    pub eps: Option<f64>,
    pub bvps: Option<f64>,
    pub capital_reserve_per_share: Option<f64>,
    pub undistributed_profit_per_share: Option<f64>,
    pub net_profit_yoy: Option<f64>,
    pub total_shares: Option<f64>,
    pub plan_notice_date: Option<String>,
    pub record_date: Option<String>,
    pub ex_date: Option<String>,
    pub plan_progress: Option<String>,
    pub latest_notice_date: Option<String>,
}

// ---------------------------------------------------------------------------
// Margin Trading (融资融券)
// ---------------------------------------------------------------------------

/// Margin account info (融资融券账户统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginAccountInfo {
    pub date: String,
    pub fin_balance: f64,
    pub loan_balance: f64,
    pub fin_buy_amount: f64,
    pub loan_sell_amount: f64,
    pub security_org_count: Option<i64>,
    pub dept_count: Option<i64>,
    pub personal_investor_count: Option<i64>,
    pub org_investor_count: Option<i64>,
    pub active_investor_count: Option<i64>,
    pub margin_liability_investor_count: Option<i64>,
    pub total_guarantee: Option<f64>,
    pub avg_guarantee_ratio: Option<f64>,
}

// ---------------------------------------------------------------------------
// Pledge Data (股权质押)
// ---------------------------------------------------------------------------

/// Pledge market overview (股权质押市场概况).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyProfile {
    pub trade_date: String,
    pub pledge_ratio: f64,
    pub company_count: i64,
    pub pledge_count: i64,
    pub total_shares: f64,
    pub total_market_cap: f64,
    pub hs300_index: f64,
    pub change_pct: f64,
}

/// Pledge ratio (上市公司质押比例).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyPledgeRatio {
    pub code: String,
    pub name: String,
    pub trade_date: String,
    pub industry: Option<String>,
    pub pledge_ratio: f64,
    pub pledge_shares: f64,
    pub pledge_market_cap: f64,
    pub pledge_count: i64,
    pub untradable_pledge: f64,
    pub tradable_pledge: f64,
    pub y1_change: Option<f64>,
    pub industry_code: Option<String>,
}

/// Pledge detail (重要股东股权质押明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyPledgeDetail {
    pub notice_date: String,
    pub code: String,
    pub name: String,
    pub holder_name: String,
    pub pledge_shares: f64,
    pub pledge_ratio: f64,
    pub pledge_market_cap: f64,
    pub pledge_type: Option<String>,
    pub receiver: Option<String>,
}

/// Pledge distribution (质押机构分布统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyDistribute {
    pub org_name: String,
    pub pledge_count: i64,
    pub pledge_shares: f64,
    pub pledge_market_cap: f64,
}

/// Pledge industry data (行业数据).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyIndustry {
    pub industry: String,
    pub pledge_ratio: f64,
    pub company_count: i64,
    pub pledge_count: i64,
    pub total_shares: f64,
    pub total_market_cap: f64,
}

// ---------------------------------------------------------------------------
// Goodwill (商誉)
// ---------------------------------------------------------------------------

/// Goodwill market overview (A股商誉市场概况).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SyProfile {
    pub report_date: String,
    pub goodwill: f64,
    pub goodwill_impairment: f64,
    pub net_assets: f64,
    pub goodwill_to_net_assets_ratio: f64,
    pub impairment_to_net_assets_ratio: f64,
    pub net_profit: f64,
    pub impairment_to_net_profit_ratio: f64,
}

/// Goodwill prediction detail (商誉减值预期明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SyYqDetail {
    pub code: String,
    pub name: String,
    pub report_date: String,
    pub notice_date: String,
    pub goodwill: f64,
    pub predicted_impairment: f64,
    pub net_profit: f64,
    pub impairment_reason: Option<String>,
}

/// Goodwill impairment detail (个股商誉减值明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SyJzDetail {
    pub code: String,
    pub name: String,
    pub report_date: String,
    pub notice_date: String,
    pub goodwill: f64,
    pub impairment_amount: f64,
    pub net_profit: f64,
}

/// Goodwill detail (个股商誉明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SyDetail {
    pub code: String,
    pub name: String,
    pub report_date: String,
    pub notice_date: String,
    pub goodwill: f64,
    pub goodwill_change: f64,
    pub net_profit: f64,
    pub goodwill_to_net_assets_ratio: f64,
}

/// Goodwill industry data (行业商誉).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SyIndustry {
    pub industry: String,
    pub report_date: String,
    pub company_count: i64,
    pub goodwill: f64,
    pub impairment: f64,
    pub net_profit: f64,
}

// ---------------------------------------------------------------------------
// Shareholder Count (股东户数)
// ---------------------------------------------------------------------------

/// Shareholder count (股东户数).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Gdhs {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub holder_count: f64,
    pub prev_holder_count: f64,
    pub holder_change: f64,
    pub holder_change_ratio: f64,
    pub interval_change_pct: Option<f64>,
    pub current_end_date: String,
    pub prev_end_date: String,
    pub avg_market_cap: Option<f64>,
    pub avg_shares: Option<f64>,
    pub total_market_cap: Option<f64>,
    pub total_shares: Option<f64>,
    pub notice_date: String,
}

/// Shareholder count detail (股东户数详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdhsDetail {
    pub end_date: String,
    pub holder_count: f64,
    pub prev_holder_count: f64,
    pub holder_change: f64,
    pub holder_change_ratio: f64,
    pub avg_market_cap: Option<f64>,
    pub avg_shares: Option<f64>,
    pub total_market_cap: Option<f64>,
    pub total_shares: Option<f64>,
    pub notice_date: String,
    pub interval_change_pct: Option<f64>,
}

// ---------------------------------------------------------------------------
// Shareholder Changes (高管持股/股东增减持)
// ---------------------------------------------------------------------------

/// Executive shareholding changes (高管持股).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Ggcg {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub holder_name: String,
    pub direction: String,
    pub change_amount: f64,
    pub change_total_ratio: f64,
    pub change_circulating_ratio: f64,
    pub holding_count: f64,
    pub holding_total_ratio: f64,
    pub holding_circulating_count: f64,
    pub holding_circulating_ratio: f64,
    pub start_date: String,
    pub end_date: String,
    pub notice_date: String,
}

// ---------------------------------------------------------------------------
// Limit-up/Down Pools (涨停/跌停股池)
// ---------------------------------------------------------------------------

/// Limit-up pool entry (涨停股池).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZtPool {
    pub code: String,
    pub name: String,
    pub change_pct: f64,
    pub latest_price: f64,
    pub amount: f64,
    pub circulating_market_cap: f64,
    pub total_market_cap: f64,
    pub turnover_rate: f64,
    pub seal_amount: f64,
    pub first_seal_time: String,
    pub last_seal_time: String,
    pub break_count: i64,
    pub zt_statistics: String,
    pub consecutive_count: i64,
    pub industry: String,
}

/// Previous limit-up pool entry (昨日涨停股池).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZtPoolPrevious {
    pub code: String,
    pub name: String,
    pub change_pct: f64,
    pub latest_price: f64,
    pub limit_price: f64,
    pub amount: f64,
    pub circulating_market_cap: f64,
    pub total_market_cap: f64,
    pub turnover_rate: f64,
    pub speed: f64,
    pub amplitude: f64,
    pub prev_seal_time: String,
    pub prev_consecutive_count: i64,
    pub zt_statistics: String,
    pub industry: String,
}

/// Strong stock pool (强势股池).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZtPoolStrong {
    pub code: String,
    pub name: String,
    pub change_pct: f64,
    pub latest_price: f64,
    pub amount: f64,
    pub circulating_market_cap: f64,
    pub total_market_cap: f64,
    pub turnover_rate: f64,
    pub seal_amount: f64,
    pub first_seal_time: String,
    pub last_seal_time: String,
    pub break_count: i64,
    pub zt_statistics: String,
    pub consecutive_count: i64,
    pub industry: String,
}

/// Sub-new stock pool (次新股池).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZtPoolSubNew {
    pub code: String,
    pub name: String,
    pub change_pct: f64,
    pub latest_price: f64,
    pub amount: f64,
    pub circulating_market_cap: f64,
    pub total_market_cap: f64,
    pub turnover_rate: f64,
    pub ipo_date: String,
    pub industry: String,
}

/// Broken seal pool (炸板股池).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZtPoolZbgc {
    pub code: String,
    pub name: String,
    pub change_pct: f64,
    pub latest_price: f64,
    pub amount: f64,
    pub circulating_market_cap: f64,
    pub total_market_cap: f64,
    pub turnover_rate: f64,
    pub seal_amount: f64,
    pub first_seal_time: String,
    pub last_seal_time: String,
    pub break_count: i64,
    pub zt_statistics: String,
    pub industry: String,
}

/// Limit-down pool (跌停股池).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZtPoolDtgc {
    pub code: String,
    pub name: String,
    pub change_pct: f64,
    pub latest_price: f64,
    pub amount: f64,
    pub circulating_market_cap: f64,
    pub total_market_cap: f64,
    pub turnover_rate: f64,
    pub seal_amount: f64,
    pub first_seal_time: String,
    pub last_seal_time: String,
    pub open_count: i64,
    pub industry: String,
}

// ---------------------------------------------------------------------------
// Order Book Changes (盘口异动)
// ---------------------------------------------------------------------------

/// Order book change entry (盘口异动).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PankouChange {
    pub time: String,
    pub code: String,
    pub name: String,
    pub board: String,
    pub info: Option<String>,
}

// ---------------------------------------------------------------------------
// IPO Subscription (打新收益率/新股申购)
// ---------------------------------------------------------------------------

/// IPO subscription yield (打新收益率).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Dxsyl {
    pub code: String,
    pub name: String,
    pub issue_price: f64,
    pub latest_price: Option<f64>,
    pub online_lottery_rate: f64,
    pub online_valid_shares: f64,
    pub online_valid_accounts: f64,
    pub online_oversubscribe_ratio: f64,
    pub offline_lottery_rate: f64,
    pub offline_valid_shares: f64,
    pub offline_valid_accounts: f64,
    pub offline_oversubscribe_ratio: f64,
    pub total_issue_shares: f64,
    pub open_premium: f64,
    pub first_day_change: f64,
    pub listing_date: Option<String>,
}

/// New stock subscription list (新股申购与中签查询).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Xgsglb {
    pub code: String,
    pub name: String,
    pub apply_code: Option<String>,
    pub issue_price: Option<f64>,
    pub latest_price: Option<f64>,
    pub issue_pe_ratio: Option<f64>,
    pub apply_date: Option<String>,
    pub listing_date: Option<String>,
    pub online_lottery_rate: Option<f64>,
    pub first_day_close: Option<f64>,
    pub first_day_change: Option<f64>,
    pub first_day_turnover: Option<f64>,
    pub main_business: Option<String>,
}

// ---------------------------------------------------------------------------
// Rights Issue (增发/配股)
// ---------------------------------------------------------------------------

/// SEO (Secondary Equity Offering) entry (全部增发).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Qbzf {
    pub code: String,
    pub name: String,
    pub seo_code: String,
    pub issue_type: String,
    pub issue_count: f64,
    pub online_issue: Option<f64>,
    pub issue_price: f64,
    pub latest_price: Option<f64>,
    pub issue_date: String,
    pub listing_date: Option<String>,
    pub lock_period: Option<String>,
}

/// Rights issue entry (配股).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Pg {
    pub code: String,
    pub name: String,
    pub pg_code: String,
    pub issue_price: f64,
    pub latest_price: Option<f64>,
    pub issue_count: f64,
    pub plan_notice_date: Option<String>,
    pub record_date: Option<String>,
    pub pay_date: Option<String>,
    pub listing_date: Option<String>,
    pub issue_type: Option<String>,
}

// ---------------------------------------------------------------------------
// Institutional Research (机构调研)
// ---------------------------------------------------------------------------

/// Institutional research statistics (机构调研统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JgdyTj {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub org_count: i64,
    pub receive_method: Option<String>,
    pub receive_personnel: Option<String>,
    pub receive_location: Option<String>,
    pub receive_date: String,
    pub notice_date: String,
}

/// Institutional research detail (机构调研详细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JgdyDetail {
    pub code: String,
    pub name: String,
    pub notice_date: String,
    pub receive_date: String,
    pub receive_location: Option<String>,
    pub receive_method: Option<String>,
    pub receive_personnel: Option<String>,
    pub org_count: i64,
    pub content: Option<String>,
}

// ---------------------------------------------------------------------------
// Xueqiu Hot Stocks
// ---------------------------------------------------------------------------

/// Xueqiu hot stock entry (雪球热度排行).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HotStockXq {
    pub code: String,
    pub name: String,
    pub value: f64,
    pub latest_price: f64,
}

// ---------------------------------------------------------------------------
// Insider Trading (内部交易)
// ---------------------------------------------------------------------------

/// Insider trading entry (内部交易).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InnerTradeXq {
    pub code: String,
    pub name: String,
    pub change_date: String,
    pub changer: String,
    pub change_shares: f64,
    pub avg_price: f64,
    pub holding_after_change: f64,
    pub relationship: String,
    pub position: String,
}

// ---------------------------------------------------------------------------
// ESG (ESG评级)
// ---------------------------------------------------------------------------

/// ESG rating entry (ESG评级).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EsgRating {
    pub code: String,
    pub name: Option<String>,
    pub esg_score: Option<f64>,
    pub env_score: Option<f64>,
    pub social_score: Option<f64>,
    pub governance_score: Option<f64>,
    pub rating_date: Option<String>,
    pub market: Option<String>,
}

// ---------------------------------------------------------------------------
// Investor Relations (互动易)
// ---------------------------------------------------------------------------

/// IRM question (互动易-提问).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IrmQuestion {
    pub code: String,
    pub company_name: String,
    pub question: String,
    pub answer: Option<String>,
    pub questioner: Option<String>,
    pub answerer: Option<String>,
    pub question_time: String,
    pub source: Option<String>,
}

// ---------------------------------------------------------------------------
// Disclosure (信息披露)
// ---------------------------------------------------------------------------

/// Disclosure report entry (信息披露公告).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DisclosureReport {
    pub code: Option<String>,
    pub name: Option<String>,
    pub title: String,
    pub publish_date: String,
    pub url: Option<String>,
    pub category: Option<String>,
}

// ---------------------------------------------------------------------------
// News/Info
// ---------------------------------------------------------------------------

/// News entry (财经快讯).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewsEntry {
    pub title: String,
    pub summary: Option<String>,
    pub time: String,
    pub url: Option<String>,
}

// ---------------------------------------------------------------------------
// Three Reports (个股三大报表)
// ---------------------------------------------------------------------------

/// Per-stock financial report entry (个股财务报表).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ThreeReportEntry {
    pub report_date: String,
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Trading Department Rankings (营业部排名)
// ---------------------------------------------------------------------------

/// Trading department ranking entry (营业部排名).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhYybRanking {
    pub dept_name: String,
    pub dept_code: Option<String>,
    pub metric_value: f64,
    pub extra: Option<String>,
}

// ---------------------------------------------------------------------------
// Freeholding Teamwork (股东协同)
// ---------------------------------------------------------------------------

/// Shareholder teamwork entry (股东协同).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GdfxTeamwork {
    pub holder_name: String,
    pub holder_type: Option<String>,
    pub holding_count: i64,
    pub total_market_cap: Option<f64>,
    pub holding_stocks: Option<String>,
}

// ---------------------------------------------------------------------------
// Margin Trading - SSE/SZSE detail
// ---------------------------------------------------------------------------

/// SSE margin summary (上交所融资融券汇总).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginSseSummary {
    pub trade_date: String,
    pub fin_balance: f64,
    pub fin_buy_amount: f64,
    pub loan_volume: f64,
    pub loan_balance: f64,
    pub loan_sell_amount: f64,
    pub margin_balance: f64,
}

/// SSE margin detail (上交所融资融券明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginSseDetail {
    pub trade_date: String,
    pub code: String,
    pub name: String,
    pub fin_balance: f64,
    pub fin_buy_amount: f64,
    pub fin_repay_amount: f64,
    pub loan_volume: f64,
    pub loan_sell_amount: f64,
    pub loan_repay_amount: f64,
}

/// SZSE margin summary (深交所融资融券汇总).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginSzseSummary {
    pub fin_buy_amount: f64,
    pub fin_balance: f64,
    pub loan_sell_amount: f64,
    pub loan_volume: f64,
    pub loan_balance: f64,
    pub margin_balance: f64,
}

/// SZSE margin detail (深交所融资融券明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginSzseDetail {
    pub code: String,
    pub name: String,
    pub fin_buy_amount: f64,
    pub fin_balance: f64,
    pub loan_sell_amount: f64,
    pub loan_volume: f64,
    pub loan_balance: f64,
    pub margin_balance: f64,
}

/// PA margin ratio (平安融资融券保证金比例).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginRatioPa {
    pub code: String,
    pub name: String,
    pub fin_ratio: f64,
    pub loan_ratio: f64,
}

/// SZSE underlying info (深交所标的证券信息).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarginUnderlyingInfoSzse {
    pub code: String,
    pub name: String,
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Pledge distribution (质押机构分布统计)
// ---------------------------------------------------------------------------

/// Pledge distribution entry (质押机构分布统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyDistributeEntry {
    pub rank: i64,
    pub org_name: String,
    pub company_count: i64,
    pub pledge_count: i64,
    pub pledge_shares: f64,
    pub below_warning_ratio: Option<f64>,
    pub warning_not_sell_ratio: Option<f64>,
    pub sell_line_ratio: Option<f64>,
}

/// Pledge ratio detail (重要股东股权质押明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpzyPledgeRatioDetail {
    pub rank: i64,
    pub code: String,
    pub name: String,
    pub holder_name: String,
    pub pledge_shares: f64,
    pub holding_ratio: f64,
    pub total_ratio: f64,
    pub org_name: Option<String>,
    pub latest_price: Option<f64>,
    pub pledge_close_price: Option<f64>,
    pub estimated_sell_price: Option<f64>,
    pub start_date: Option<String>,
    pub end_date: Option<String>,
    pub status: Option<String>,
    pub notice_date: String,
}

// ---------------------------------------------------------------------------
// Block trade (大宗交易)
// ---------------------------------------------------------------------------

/// Block trade daily stats (大宗交易每日统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DzjyMrtj {
    pub code: String,
    pub name: String,
    pub trade_date: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub turnover_rate: f64,
    pub block_trade_count: i64,
    pub block_trade_volume: f64,
    pub block_trade_amount: f64,
    pub block_trade_premium_ratio: f64,
    pub circulating_market_cap: f64,
}

/// Block trade industry stats (大宗交易行业统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DzjyHygtj {
    pub industry: String,
    pub block_trade_count: i64,
    pub block_trade_volume: f64,
    pub block_trade_amount: f64,
    pub avg_premium_ratio: f64,
}

/// Block trade industry daily stats (大宗交易行业每日统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DzjyHyyybtj {
    pub industry: String,
    pub trade_date: String,
    pub block_trade_count: i64,
    pub block_trade_volume: f64,
    pub block_trade_amount: f64,
    pub avg_premium_ratio: f64,
}

/// Block trade seat ranking (大宗交易营业部排行).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DzjyYybph {
    pub dept_name: String,
    pub buy_count: i64,
    pub buy_amount: f64,
    pub sell_count: i64,
    pub sell_amount: f64,
    pub net_amount: f64,
}

// ---------------------------------------------------------------------------
// Account statistics (股票账户统计)
// ---------------------------------------------------------------------------

/// Account statistics (股票账户统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AccountStatistics {
    pub date: String,
    pub new_investor_count: Option<f64>,
    pub new_investor_mom: Option<f64>,
    pub new_investor_yoy: Option<f64>,
    pub total_investor_count: Option<f64>,
    pub a_share_count: Option<f64>,
    pub b_share_count: Option<f64>,
    pub total_market_cap: Option<f64>,
    pub avg_market_cap: Option<f64>,
    pub sh_close: Option<f64>,
    pub sh_change_pct: Option<f64>,
}

// ---------------------------------------------------------------------------
// TFP (停复牌)
// ---------------------------------------------------------------------------

/// TFP info (停复牌信息).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TfpInfo {
    pub rank: i64,
    pub code: String,
    pub name: String,
    pub suspend_time: Option<String>,
    pub suspend_end: Option<String>,
    pub suspend_period: Option<String>,
    pub suspend_reason: Option<String>,
    pub market: Option<String>,
    pub expected_resume: Option<String>,
}

// ---------------------------------------------------------------------------
// Stock value (估值分析)
// ---------------------------------------------------------------------------

/// Stock value analysis (估值分析).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StockValue {
    pub trade_date: String,
    pub close_price: f64,
    pub change_pct: f64,
    pub total_market_cap: f64,
    pub circulating_market_cap: f64,
    pub total_shares: f64,
    pub circulating_shares: f64,
    pub pe_ttm: f64,
    pub pe_static: f64,
    pub pb: f64,
    pub peg: f64,
    pub pcf: f64,
    pub ps: f64,
}

// ---------------------------------------------------------------------------
// QSJY (券商业绩月报)
// ---------------------------------------------------------------------------

/// QSJY data (券商业绩月报).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QsjyEntry {
    pub code: String,
    pub name: String,
    pub month_net_profit: Option<f64>,
    pub month_np_yoy: Option<f64>,
    pub month_np_qoq: Option<f64>,
    pub accum_net_profit: Option<f64>,
    pub accum_np_yoy: Option<f64>,
    pub month_revenue: Option<f64>,
    pub month_rev_yoy: Option<f64>,
    pub month_rev_qoq: Option<f64>,
    pub accum_revenue: Option<f64>,
    pub accum_rev_yoy: Option<f64>,
    pub net_assets: Option<f64>,
    pub na_yoy: Option<f64>,
}

// ---------------------------------------------------------------------------
// GDDH (股东大会)
// ---------------------------------------------------------------------------

/// Shareholder meeting (股东大会).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GddhEntry {
    pub code: String,
    pub name: String,
    pub meeting_title: String,
    pub start_date: Option<String>,
    pub equity_record_date: Option<String>,
    pub onsite_record_date: Option<String>,
    pub web_vote_start: Option<String>,
    pub web_vote_end: Option<String>,
    pub decision_notice_date: Option<String>,
    pub notice_date: String,
    pub serial_num: Option<String>,
    pub proposal: Option<String>,
}

// ---------------------------------------------------------------------------
// YZXDR (一致行动人)
// ---------------------------------------------------------------------------

/// YZXDR entry (一致行动人).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct YzxdrEntry {
    pub rank: i64,
    pub code: String,
    pub name: String,
    pub actor: String,
    pub holder_rank: Option<i64>,
    pub holding_count: f64,
    pub holding_ratio: f64,
    pub holding_change: f64,
    pub industry: Option<String>,
    pub notice_date: String,
}

// ---------------------------------------------------------------------------
// ZDHTMX (重大合同明细)
// ---------------------------------------------------------------------------

/// Major contract detail (重大合同明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ZdhtmxEntry {
    pub rank: i64,
    pub code: String,
    pub name: String,
    pub signatory: Option<String>,
    pub signatory_rel: Option<String>,
    pub counterparty: Option<String>,
    pub counterparty_rel: Option<String>,
    pub contract_type: Option<String>,
    pub contract_name: Option<String>,
    pub amount: f64,
    pub last_year_revenue: Option<f64>,
    pub revenue_ratio: Option<f64>,
    pub latest_revenue: Option<f64>,
    pub sign_date: Option<String>,
    pub notice_date: String,
}

// ---------------------------------------------------------------------------
// News/research (新闻/研报)
// ---------------------------------------------------------------------------

/// Stock news (个股新闻).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StockNews {
    pub title: String,
    pub content: Option<String>,
    pub publish_time: String,
    pub source: Option<String>,
    pub url: Option<String>,
}

/// Research report (个股研报).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ResearchReport {
    pub rank: i64,
    pub code: String,
    pub name: String,
    pub title: String,
    pub rating: Option<String>,
    pub org: String,
    pub month_count: Option<i64>,
    pub industry: Option<String>,
    pub date: String,
    pub pdf_url: Option<String>,
}

// ---------------------------------------------------------------------------
// Chip distribution (筹码分布)
// ---------------------------------------------------------------------------

/// Chip distribution data (筹码分布).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CyqData {
    pub date: String,
    pub benefit_part: f64,
    pub avg_cost: f64,
    pub pct_90_low: f64,
    pub pct_90_high: f64,
    pub pct_90_concentration: f64,
    pub pct_70_low: f64,
    pub pct_70_high: f64,
    pub pct_70_concentration: f64,
}

// ---------------------------------------------------------------------------
// Rank THS (同花顺排名)
// ---------------------------------------------------------------------------

/// THS rank entry (同花顺排名).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RankThsEntry {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub volume: Option<f64>,
    pub amount: Option<f64>,
    pub extra: Option<serde_json::Value>,
}

// ---------------------------------------------------------------------------
// Register EM (注册制)
// ---------------------------------------------------------------------------

/// Registration info (注册制).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RegisterEntry {
    pub code: String,
    pub name: String,
    pub industry: Option<String>,
    pub list_date: Option<String>,
    pub issue_price: Option<f64>,
    pub pe_ratio: Option<f64>,
    pub extra: Option<serde_json::Value>,
}

// ---------------------------------------------------------------------------
// Fund flow (资金流向)
// ---------------------------------------------------------------------------

/// Fund flow entry (资金流向).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundFlowEntry {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub turnover_rate: Option<f64>,
    pub inflow: Option<f64>,
    pub outflow: Option<f64>,
    pub net_flow: Option<f64>,
    pub amount: Option<f64>,
}

/// Sector fund flow rank (板块资金流向排名).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorFundFlowRank {
    pub name: String,
    pub change_pct: Option<f64>,
    pub inflow: Option<f64>,
    pub outflow: Option<f64>,
    pub net_flow: Option<f64>,
    pub leader: Option<String>,
    pub leader_change_pct: Option<f64>,
}

// ---------------------------------------------------------------------------
// Industry CNINFO (巨潮行业)
// ---------------------------------------------------------------------------

/// Industry category (巨潮行业分类).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryCategory {
    pub code: String,
    pub name: String,
    pub industry: Option<String>,
    pub extra: Option<serde_json::Value>,
}

// ---------------------------------------------------------------------------
// LHB Sina (新浪龙虎榜)
// ---------------------------------------------------------------------------

/// LHB Sina detail (新浪龙虎榜每日详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbSinaDetail {
    pub rank: i64,
    pub code: String,
    pub name: String,
    pub close_price: f64,
    pub metric_value: f64,
    pub volume: f64,
    pub amount: f64,
    pub indicator: String,
}

/// LHB Sina stock stats (新浪龙虎榜个股统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbSinaGgtj {
    pub code: String,
    pub name: String,
    pub billboard_count: i64,
    pub accum_buy: f64,
    pub accum_sell: f64,
    pub net_amount: f64,
    pub buy_seats: i64,
    pub sell_seats: i64,
}

/// LHB Sina seat stats (新浪龙虎榜营业部统计).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbSinaYytj {
    pub dept_name: String,
    pub billboard_count: i64,
    pub accum_buy: f64,
    pub buy_seats: i64,
    pub accum_sell: f64,
    pub sell_seats: i64,
    pub top_stocks: Option<String>,
}

/// LHB Sina institution tracking (新浪龙虎榜机构追踪).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbSinaJgzz {
    pub code: String,
    pub name: String,
    pub accum_buy: f64,
    pub buy_count: i64,
    pub accum_sell: f64,
    pub sell_count: i64,
    pub net_amount: f64,
}

/// LHB Sina institution detail (新浪龙虎榜机构明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LhbSinaJgmx {
    pub code: String,
    pub name: String,
    pub trade_date: String,
    pub inst_buy_amount: f64,
    pub inst_sell_amount: f64,
}

// ---------------------------------------------------------------------------
// CXINFO holder changes (巨潮股东变动)
// ---------------------------------------------------------------------------

/// Hold change entry (股东持股变动).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HoldChangeCninfo {
    pub data: serde_json::Value,
}

/// Hold control entry (实际控制人).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HoldControlCninfo {
    pub data: serde_json::Value,
}

/// Management detail (管理层明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ManagementDetail {
    pub data: serde_json::Value,
}

/// Share change entry (股本变动).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShareChangeCninfo {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Delisted financials (退市财务报表)
// ---------------------------------------------------------------------------

/// Delisted financial report (退市公司财务报表).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DelistedReport {
    pub code: String,
    pub name: Option<String>,
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// CG (公司治理) - cninfo
// ---------------------------------------------------------------------------

/// Equity mortgage (股权抵押).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CgEquityMortgage {
    pub data: serde_json::Value,
}

/// Guarantee (担保).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CgGuarantee {
    pub data: serde_json::Value,
}

/// Lawsuit (诉讼).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CgLawsuit {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Legulegu generic (乐咕乐股)
// ---------------------------------------------------------------------------

/// Legulegu data point (乐咕乐股数据点).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LgDataPoint {
    pub date: String,
    pub value: f64,
    pub extra: Option<serde_json::Value>,
}

// ---------------------------------------------------------------------------
// CNINFO generic (巨潮通用)
// ---------------------------------------------------------------------------

/// CNINFO dividend (巨潮分红).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DividendCninfo {
    pub data: serde_json::Value,
}

/// CNINFO allotment (巨潮配股).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AllotmentCninfo {
    pub data: serde_json::Value,
}

/// CNINFO profile (公司概况).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProfileCninfo {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// SGT exchange rate (港股通汇率)
// ---------------------------------------------------------------------------

/// Exchange rate entry (汇率).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExchangeRateEntry {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Share hold change (持股变动)
// ---------------------------------------------------------------------------

/// Share hold change entry (持股变动).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShareHoldChangeEntry {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// SSE/SZSE summary (交易所汇总)
// ---------------------------------------------------------------------------

/// SZSE summary (深交所汇总).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SzseSummaryEntry {
    pub data: serde_json::Value,
}

/// SSE deal daily (上交所每日交易).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SseDealDaily {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Stock classify Sina (新浪行业分类)
// ---------------------------------------------------------------------------

/// Sina classify (新浪行业分类).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClassifySina {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Stock news CX (财联社新闻)
// ---------------------------------------------------------------------------

/// CX main news (财联社重要新闻).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CxMainNews {
    pub title: String,
    pub content: Option<String>,
    pub publish_time: String,
    pub url: Option<String>,
}

// ---------------------------------------------------------------------------
// IPO/forecast (新股/业绩预告)
// ---------------------------------------------------------------------------

/// CNINFO forecast (巨潮业绩预告).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForecastCninfo {
    pub data: serde_json::Value,
}

/// IPO summary (新股概况).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IpoSummaryCninfo {
    pub data: serde_json::Value,
}

/// IPO benefit THS (同花顺打新收益).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IpoBenefitThs {
    pub data: serde_json::Value,
}

/// New GH CNINFO (新股过会).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewGhCninfo {
    pub data: serde_json::Value,
}

/// New IPO CNINFO (新股IPO).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewIpoCninfo {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// SH/SZ delist (退市)
// ---------------------------------------------------------------------------

/// Delist info (退市信息).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DelistInfo {
    pub data: serde_json::Value,
}

/// Name change info (股票更名).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NameChangeInfo {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// SZSE area/sector summary
// ---------------------------------------------------------------------------

/// SZSE area summary (深交所地区汇总).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SzseAreaSummary {
    pub data: serde_json::Value,
}

/// SZSE sector summary (深交所板块汇总).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SzseSectorSummary {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// FHPS THS (同花顺分红配送)
// ---------------------------------------------------------------------------

/// FHPS THS (同花顺分红配送).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FhpsThs {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// XGSR THS (同花顺新股上市)
// ---------------------------------------------------------------------------

/// XGSR THS (同花顺新股上市日).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct XgsrThs {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// ESG Sina (新浪ESG)
// ---------------------------------------------------------------------------

/// ESG rate Sina (新浪ESG评级).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EsgRateSina {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Price JS (JS价格)
// ---------------------------------------------------------------------------

/// JS price (JS实时价格).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PriceJs {
    pub code: String,
    pub name: String,
    pub price: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub amount: f64,
}

// ---------------------------------------------------------------------------
// Industry change (行业变动)
// ---------------------------------------------------------------------------

/// Industry change entry (行业变动).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryChange {
    pub data: serde_json::Value,
}

/// Industry PE ratio (行业市盈率).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryPeRatio {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Congestion/GXL/Buffett/EBS Legulegu (乐咕乐股指标)
// ---------------------------------------------------------------------------

/// Congestion data (乐咕乐股拥堵度).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CongestionLg {
    pub data: serde_json::Value,
}

/// Dividend yield (乐咕乐股股息率).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GxlLg {
    pub data: serde_json::Value,
}

/// Buffett index (乐咕乐股巴菲特指标).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuffettIndexLg {
    pub data: serde_json::Value,
}

/// EBS data (乐咕乐股等权市净率).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbsLg {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Disclosure (信息披露)
// ---------------------------------------------------------------------------

/// Report disclosure (信息披露).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ReportDisclosure {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// SSE info (上交所互动易)
// ---------------------------------------------------------------------------

/// SSE info (上交所互动易).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SseInfo {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Market activity (市场活跃度)
// ---------------------------------------------------------------------------

/// Market activity (市场活跃度).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarketActivityLegu {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Sector detail (板块详情)
// ---------------------------------------------------------------------------

/// Sector detail (板块详情).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorDetail {
    pub code: String,
    pub name: String,
    pub latest_price: Option<f64>,
    pub change_pct: Option<f64>,
    pub extra: Option<serde_json::Value>,
}

// ---------------------------------------------------------------------------
// Industry CLF SH (申万行业历史)
// ---------------------------------------------------------------------------

/// Industry CLF history (申万行业分类历史).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryClfHistSw {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Futu concept constituents (富途概念成份股)
// ---------------------------------------------------------------------------

/// Futu concept constituent (富途概念成份股).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConceptConsFutu {
    pub code: String,
    pub name: String,
    pub extra: Option<serde_json::Value>,
}

// ---------------------------------------------------------------------------
// Fund hold detail (基金持仓明细)
// ---------------------------------------------------------------------------

/// Fund hold detail (基金持仓明细).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundHoldDetail {
    pub data: serde_json::Value,
}

// ---------------------------------------------------------------------------
// Main fund flow (主力资金流向)
// ---------------------------------------------------------------------------

/// Main fund flow (主力资金流向).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MainFundFlow {
    pub data: serde_json::Value,
}

/// Market fund flow (市场资金流向).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarketFundFlow {
    pub data: serde_json::Value,
}

/// Concept fund flow hist (概念资金流向历史).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConceptFundFlowHist {
    pub data: serde_json::Value,
}

/// Sector fund flow hist (板块资金流向历史).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorFundFlowHist {
    pub data: serde_json::Value,
}

/// Sector fund flow summary (板块资金流向汇总).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorFundFlowSummary {
    pub data: serde_json::Value,
}