JERRY\15194 преди 4 години
родител
ревизия
1a0abc2926

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
boniu/.eslintcache


+ 1 - 0
boniu/debug.log

@@ -0,0 +1 @@
+[0123/123906.155:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

+ 1 - 1
boniu/src/App.css

@@ -1,5 +1,5 @@
 .App {
-  text-align: center;
+  
 }
 
 .App-logo {

+ 2 - 2
boniu/src/App.js

@@ -5,9 +5,9 @@ function App() {
   return (
     <div className="App">
 
-        <NavBar>
+      <NavBar>
 
-        </NavBar>
+      </NavBar>
 
     </div>
   );

+ 43 - 10
boniu/src/StocksApiList.jsx

@@ -1,13 +1,46 @@
 const stockApiList = [
-    {
-        name: "股票基本信息", icon: "xx1", url: "/xx1", hidden: false,
-    },
-    {
-        name: "股票当天信息", icon: "xx2", url: "/xx2", hidden: false,
-    },
-    {
-        name: "股票回溯", icon: "xx3", url: "/xx3", hidden: true,
-    },
+  {
+    name: "股票基本信息",
+    icon: "xx1",
+    url: "/xx1",
+    hidden: false,
+  },
+  {
+    name: "股票当天信息",
+    icon: "xx2",
+    url: "/xx2",
+    hidden: false,
+  },
+  {
+    name: "时间段信息(股票代码+起止日期)",
+    icon: "xx3",
+    url: "/xx3",
+    hidden: false,
+  },
+  {
+    name: "股票回溯",
+    icon: "xx4",
+    url: "/xx4",
+    hidden: true,
+  },
+  {
+    name: "股票某天信息",
+    icon: "xx5",
+    url: "/xx5",
+    hidden: true,
+  },
+  {
+    name: "股票列表信息",
+    icon: "xx6",
+    url: "/xx6",
+    hidden: true,
+  },
+  {
+    name: "股票距离某天最近一个交易日",
+    icon: "xx7",
+    url: "/xx7",
+    hidden: true,
+  }
 ];
 
-export default stockApiList
+export default stockApiList;

+ 8 - 8
boniu/src/components/BasicRoute/router.js

@@ -5,14 +5,14 @@ import Overview from '../Overview/overview'
 import Stocks from '../StocksApi/stocks'
 import IndexApi from '../IndexApi/indexApi'
 const BasicRoute = () => (
-        <div>
-            <Switch>
-                <Route exact path="/overview" component={Overview} />
-                <Route path="/stocks" component={Stocks} />
-                <Route path="/indexApi" component={IndexApi}/>
-                <Route path="/error" render={(props) => <div><h1>404 Not Found!</h1></div>}/>
-            </Switch>
-        </div>
+  <div>
+    <Switch>
+      <Route exact path="/overview" component={Overview} />
+      <Route path="/stocks" component={Stocks} />
+      <Route path="/indexApi" component={IndexApi}/>
+      <Route path="/error" render={(props) => <div><h1>404 Not Found!</h1></div>}/>
+    </Switch>
+  </div>
 );
 export default BasicRoute ;
 

+ 88 - 75
boniu/src/components/Navbar/navbar.jsx

@@ -1,79 +1,92 @@
-import React, {Component} from 'react';
-import { Route, Switch } from 'react-router-dom'
-import Overview from '../../components/Overview/overview'
-import Stocks from '../../components/StocksApi/stocks'
-import IndexApi from '../../components/IndexApi/indexApi'
-import { Link } from 'react-router-dom'
-import stocksApiList from '../../StocksApiList'
-import indexApiList from '../../IndexApiList'
-import 'antd/dist/antd.css';
-import './navbar.css';
-import { Layout, Menu } from 'antd';
-import { UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons';
+import React, { Component } from "react";
+import { Route, Switch } from "react-router-dom";
+import Overview from "../../components/Overview/overview";
+import Stocks from "../../components/StocksApi/stocks";
+import IndexApi from "../../components/IndexApi/indexApi";
+import { Link } from "react-router-dom";
+import stocksApiList from "../../StocksApiList";
+import indexApiList from "../../IndexApiList";
+import "antd/dist/antd.css";
+import "./navbar.css";
+import { Layout, Menu } from "antd";
+import {
+  UserOutlined,
+  LaptopOutlined,
+  NotificationOutlined,
+} from "@ant-design/icons";
 const { SubMenu } = Menu;
 const { Header, Content, Sider } = Layout;
 export default class NavBar extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            userInfo: {}
-        };
-    }
-    render() {
-        // let { match } = this.props;
-        return (
-            <Layout style={{ minHeight: '100vh' }}>
-                <Header className="header">
-                </Header>
-                <Layout>
-                    <Sider width={200} className="site-layout-background">
-                        <Menu
-                            mode="inline"
-                            defaultSelectedKeys={['overview']}
-                            defaultOpenKeys={['overview']}
-                            style={{ height: '100%', borderRight: 0 }}
-                        >
-
-                            <Menu.Item key="overview" icon={<UserOutlined />}>
-                                <Link to='/overview'>总体说明</Link>
-                            </Menu.Item>
-                            <SubMenu key="sub2" icon={<LaptopOutlined />} title="股票接口" onClick={this.go}>
-                                {stocksApiList.map((item)=>{
-                                   return <Menu.Item key={item.url}>
-                                       <Link to='/stocks'>{item.name}</Link>
-                                   </Menu.Item>
-                                })}
-                            </SubMenu>
-                            <SubMenu key="sub3" icon={<NotificationOutlined />} title="指数接口" onClick={this.go}>
-                                {indexApiList.map((item)=>{
-                                    return <Menu.Item key={item.url}>
-                                        <Link to='/indexApi'>{item.name}</Link>
-                                    </Menu.Item>
-                                })}
-                            </SubMenu>
-                        </Menu>
-                    </Sider>
-                    <Layout style={{ padding: '0 24px 24px' }}>
-                        <Content
-                            style={{
-                                background: '#fff',
-                                padding: 24,
-                                margin: 0,
-                                minHeight: 280,
-                            }}
-                        >
-                            <Switch>
-                                <Route exact path="/overview" component={Overview} />
-                                <Route path="/stocks" component={Stocks} />
-                                <Route path="/indexApi" component={IndexApi}/>
-                            </Switch>
-                        </Content>
-                    </Layout>
-                </Layout>
-            </Layout>
-
-        )
-    }
-
+  constructor(props) {
+    super(props);
+    this.state = {
+      userInfo: {},
+    };
+  }
+  render() {
+    // let { match } = this.props;
+    return (
+      <Layout style={{ minHeight: "100vh" }}>
+        <Header className="header"></Header>
+        <Layout>
+          <Sider width={200} className="site-layout-background">
+            <Menu
+              mode="inline"
+              defaultSelectedKeys={["overview"]}
+              defaultOpenKeys={["overview"]}
+              style={{ height: "100%", borderRight: 0 }}
+            >
+              <Menu.Item key="overview" icon={<UserOutlined />}>
+                <Link to="/overview">总体说明</Link>
+              </Menu.Item>
+              <SubMenu
+                key="sub2"
+                icon={<LaptopOutlined />}
+                title="股票接口"
+                onClick={this.go}
+              >
+                {stocksApiList.map((item) => {
+                  return (
+                    <Menu.Item key={item.url}>
+                      <Link to="/stocks">{item.name}</Link>
+                    </Menu.Item>
+                  );
+                })}
+              </SubMenu>
+              <SubMenu
+                key="sub3"
+                icon={<NotificationOutlined />}
+                title="指数接口"
+                onClick={this.go}
+              >
+                {indexApiList.map((item) => {
+                  return (
+                    <Menu.Item key={item.url}>
+                      <Link to="/indexApi">{item.name}</Link>
+                    </Menu.Item>
+                  );
+                })}
+              </SubMenu>
+            </Menu>
+          </Sider>
+          <Layout style={{ padding: "0 24px 24px" }}>
+            <Content
+              style={{
+                background: "#fff",
+                padding: 24,
+                margin: 0,
+                minHeight: 280,
+              }}
+            >
+              <Switch>
+                <Route exact path="/overview" component={Overview} />
+                <Route path="/stocks" component={Stocks} />
+                <Route path="/indexApi" component={IndexApi} />
+              </Switch>
+            </Content>
+          </Layout>
+        </Layout>
+      </Layout>
+    );
+  }
 }
-

+ 14 - 0
boniu/src/components/StocksApi/stocks.css

@@ -0,0 +1,14 @@
+.stocks-title {
+  margin-top: 30px;
+  display: flex;
+  align-items: center;
+}
+.stocks-title::before {
+  content: '';
+  margin-right: 10px;
+  display: block;
+  width: 6px;
+  height: 20px;
+  border-radius: 3px;
+  background-color: #00c0ff;
+}

+ 144 - 8
boniu/src/components/StocksApi/stocks.jsx

@@ -1,17 +1,153 @@
 import React from 'react';
 import './stocks.css'
+import {
+  Typography,
+  Table,
+  Button
+} from 'antd'
 
+const { Text, Title, Link } = Typography
 
 const Stocks = () => {
+  return (
+    <div>
+      <Title level={ 4 }>股票基本信息</Title>
+      <div>
+        <Title
+          className="stocks-title"
+          level={ 5 }
+        >输入参数:</Title>
+        <Text>method=stock_info&code=股票代码&timestamp=时间戳&sign=签名值</Text>
+      </div>
 
-    return (
-
-
-        <div>Stocks</div>
-
-
-    )
-
+      <div>
+        <Title
+          className="stocks-title"
+          level={ 5 }
+        >输出结果:</Title>
+        <Table
+          columns={columns}
+          dataSource={data}
+          pagination={ false }
+          size="small"
+        />
+      </div>
+      <div>
+        <Title
+          className="stocks-title"
+          level={ 5 }
+        >输出结果异常:</Title>
+        <Table
+          columns={errcolumns}
+          dataSource={errdata}
+          pagination={ false }
+          size="small"
+        />
+      </div>
+      
+      <div>
+        <Title
+          className="stocks-title"
+          level={ 5 }
+        >测试地址:</Title>
+        <Button type="primary" className="stocks-button">API测试工具</Button>
+      </div>
+      <div>
+        <Title
+          className="stocks-title"
+          level={ 5 }
+        >SDK包:</Title>
+        <Link>php程序包下载</Link>
+      </div>
+    </div>
+  )
 };
 
 export default Stocks;
+var columns = [
+  {
+    title: '名称',
+    dataIndex: 'name',
+    key: 'name',
+    render: text => <span>{text}</span>,
+  },
+  {
+    title: '说明',
+    dataIndex: 'desc',
+    key: 'desc',
+  }
+]
+var data = [
+  {
+    key: '1',
+    name: 'message_code',
+    desc: 200,
+  },
+  {
+    key: '2',
+    name: 'message',
+    desc: 'success',
+  },
+  {
+    key: '3',
+    name: 'code',
+    desc: '股票代码'
+  },
+  {
+    key: '4',
+    name: 'name',
+    desc: '股票名称'
+  },
+  {
+    key: '5',
+    name: 'sector',
+    desc: '交易板块'
+  },
+]
+
+var errcolumns = [
+  {
+    title: '错误类型',
+    dataIndex: 'type',
+    key: 'type',
+    render: text => <span>{text}</span>,
+  },
+  {
+    title: 'message_code',
+    dataIndex: 'code',
+    key: 'code',
+  },
+  {
+    title: 'message',
+    dataIndex: 'message',
+    key: 'message'
+  }
+]
+var errdata = [
+  {
+    key: '1',
+    type: '股票代码错误',
+    code: 301,
+    message: '股票代码不存在/错误'
+  }, {
+    key: '2',
+    type: '交易板块错误',
+    code: 302,
+    message: '交易板块不存在/错误'
+  }, {
+    key: '3',
+    type: '签名错误',
+    code: 304,
+    message: '非法签名'
+  }, {
+    key: '4',
+    type: '返回数据为空',
+    code: 401,
+    message: '股票数据为空'
+  }, {
+    key: '5',
+    type: '服务器错误',
+    code: 501,
+    message: '服务器错误'
+  }
+]