overview.jsx 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. import React, { Component } from "react";
  2. import "./overview.css";
  3. import { Typography, Table, Button, Card } from "antd";
  4. const { Text, Paragraph, Title, Link } = Typography;
  5. class Overview extends Component {
  6. render() {
  7. return (
  8. <div>
  9. <Title level={3}>总体说明</Title>
  10. <Text type="secondary" className='overview-text-block'>接口请求方式采用get方式</Text>
  11. <Text type="secondary" className='overview-text-block overview-footer'>接口采用模拟HTTP协议及JSON接口模式</Text>
  12. <Title className="overview-title" level={5}>
  13. 校验方式说明:
  14. <Text type="secondary" code={{ fontSize: 16 }}>
  15. sign=md5(method=接口名称&time=时间戳)
  16. </Text>
  17. </Title>
  18. <Text type="secondary">
  19. http://boniu.xazhima.com/api/v1.0/api.php?sign=校验方式"&timestamp="时间戳"&method="方法名"&code="$code&"start_date="开始日期"&end_date="截止日期"&order="排序;
  20. </Text>
  21. <Title className="overview-title" level={5}>
  22. 输出结果:
  23. </Title>
  24. <Table
  25. className="first-table"
  26. columns={columns}
  27. // expandable
  28. dataSource={columnsData}
  29. pagination={false}
  30. size="small"
  31. />
  32. <Title className="overview-title margin-top-20" level={5}>
  33. 异常结果:
  34. </Title>
  35. <Table
  36. className="err-table second-table"
  37. columns={errColumns}
  38. dataSource={errColumnsData}
  39. pagination={false}
  40. size="small"
  41. />
  42. <Card
  43. title="输出结果格式:"
  44. hoverable={true}
  45. style={{ width: 300, marginTop: 20 }}
  46. >
  47. <p>
  48. {"\u007B"}
  49. <br />
  50. (信息码区)
  51. <br />
  52. (输入参数呼应区)
  53. <br />
  54. (结果返回)
  55. <br />
  56. {"\u007d"}
  57. </p>
  58. </Card>
  59. <Title className="overview-title margin-top-20" level={5}>
  60. 输出结果规则总体说明:
  61. </Title>
  62. <Text type="secondary" className='overview-text-block overview-footer'>
  63. 1.所有交易日期格式均为8位整数,不传为当天数据
  64. </Text>
  65. <Text type="secondary" className='overview-text-block overview-footer'>
  66. 2.5日线、10
  67. 日线、20日线、30日线、60日线、233线以及开盘价、收盘价、最高价、最低价等价格参数均与输入参数复权方式一致
  68. </Text>
  69. <Text type="secondary" className='overview-text-block overview-footer'>
  70. 3.所有输出的价格,均按照四舍五入保留小数点后两位的格式输出
  71. </Text>
  72. <Text type="secondary" className='overview-text-block overview-footer'>
  73. 4.价格计算方式:①涨跌额:当天收盘价-前一天收盘价。②涨跌幅:涨跌额÷前一天收盘价*100%。③涨停价:科创板、创业板股为前一天收盘价*120%,ST为前一天收盘价*105%,其他股为前一天收盘价*110%。④跌停价:科创板、创业板股为前一天收盘价*80%,ST为前一天收盘价*95%,其他股为前一天收盘价*90%。⑤是否涨跌停标志:涨跌停标志按照收盘价计算,如果当天收盘价等于涨停价,则为涨停,如果收盘价等于跌停价,则为跌停。如果没有涨/跌停,涨跌停标志输出0/-1。(新股发行前5天没有涨跌停价格)
  74. </Text>
  75. </div>
  76. );
  77. }
  78. }
  79. export default Overview;
  80. const columns = [
  81. {
  82. title: "名称",
  83. dataIndex: "name",
  84. key: "name"
  85. },
  86. {
  87. title: "说明",
  88. dataIndex: "desc",
  89. key: "desc"
  90. }
  91. ];
  92. const columnsData = [
  93. {
  94. key: "1",
  95. name: "message_code",
  96. desc: 200
  97. },
  98. {
  99. key: "2",
  100. name: "message",
  101. desc: "success"
  102. },
  103. {
  104. key: "3",
  105. name: "data",
  106. desc: "接口对应字段"
  107. }
  108. ];
  109. const errColumns = [
  110. {
  111. title: "错误类型",
  112. dataIndex: "type",
  113. key: "type"
  114. },
  115. {
  116. title: "message_code",
  117. dataIndex: "code",
  118. key: "code"
  119. },
  120. {
  121. title: "message",
  122. dataIndex: "message",
  123. key: "message"
  124. }
  125. ];
  126. const errColumnsData = [
  127. {
  128. key: "1",
  129. type: "错误码300",
  130. code: "300...",
  131. message: "接口参数输入错误"
  132. },
  133. {
  134. key: "2",
  135. type: "错误码400",
  136. code: "400...",
  137. message: "对外输出错误"
  138. },
  139. {
  140. key: "3",
  141. type: "错误码500",
  142. code: "500...",
  143. message: "系统错误"
  144. },
  145. {
  146. key: "4",
  147. type: "例如:",
  148. code: "",
  149. message: "",
  150. children: [
  151. {
  152. key: "9",
  153. type: "股票代码错误",
  154. code: "301",
  155. message: " 股票/指数代码不存在/错误"
  156. },
  157. {
  158. key: "10",
  159. type: "交易板块错误",
  160. code: "302",
  161. message: "交易板块不存在/错误"
  162. },
  163. {
  164. key: "11",
  165. type: "所属市场错误",
  166. code: "303",
  167. message: "所属市场不存在/错误"
  168. },
  169. {
  170. key: "12",
  171. type: "签名错误",
  172. code: "304",
  173. message: "非法签名"
  174. },
  175. {
  176. key: "13",
  177. type: "时间/时间段输入错误",
  178. code: "305",
  179. message: "时间/时间段错误"
  180. },
  181. {
  182. key: "14",
  183. type: "复权码输入错误",
  184. code: "306",
  185. message: "复权码错误"
  186. },
  187. {
  188. key: "15",
  189. type: "code未输入,参数为空",
  190. code: "307",
  191. message: "code参数不能为空"
  192. },
  193. {
  194. key: "16",
  195. type: "方法名输入错误",
  196. code: "308",
  197. message: "方法名错误"
  198. },
  199. {
  200. key: "17",
  201. type: "order输入错误",
  202. code: "309",
  203. message: "order参数错误"
  204. },
  205. {
  206. key: "18",
  207. type: "traceback_days输入有误",
  208. code: "310",
  209. message: "traceback_days参数错误"
  210. },
  211. {
  212. key: "19",
  213. type: "返回数据为空",
  214. code: "401",
  215. message: " 股票/指数数据为空"
  216. },
  217. {
  218. key: "20",
  219. type: "服务器错误",
  220. code: "501",
  221. message: "服务器错误"
  222. }
  223. ]
  224. }
  225. ];