[Add]增加若干WebTrader功能
This commit is contained in:
parent
d3302c2a75
commit
a41cecce5b
@ -47,10 +47,12 @@ with open("WEB_setting.json") as f:
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask.ext.restful import Api, Resource, reqparse
|
from flask.ext.restful import Api, Resource, reqparse
|
||||||
from flask.ext.socketio import SocketIO
|
from flask.ext.socketio import SocketIO
|
||||||
|
from flask.ext.cors import CORS
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
api = Api(app)
|
api = Api(app)
|
||||||
socketio = SocketIO(app)
|
socketio = SocketIO(app)
|
||||||
|
cors = CORS(app, supports_credentials=True)
|
||||||
|
|
||||||
|
|
||||||
# 创建资源
|
# 创建资源
|
||||||
@ -156,7 +158,7 @@ class Order(Resource):
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def post(self):
|
def post(self):
|
||||||
"""发单"""
|
"""发单"""
|
||||||
args = self.deleteParser.parse_args()
|
args = self.postParser.parse_args()
|
||||||
token = args['token']
|
token = args['token']
|
||||||
if token != TOKEN:
|
if token != TOKEN:
|
||||||
return None
|
return None
|
||||||
@ -176,7 +178,7 @@ class Order(Resource):
|
|||||||
req.symbol = contract.symbol
|
req.symbol = contract.symbol
|
||||||
req.exchange = contract.exchange
|
req.exchange = contract.exchange
|
||||||
req.price = float(price)
|
req.price = float(price)
|
||||||
req.volume = int(symbol)
|
req.volume = int(volume)
|
||||||
req.priceType = priceType
|
req.priceType = priceType
|
||||||
req.direction = direction
|
req.direction = direction
|
||||||
req.offset = offset
|
req.offset = offset
|
||||||
|
@ -8,4 +8,5 @@ wmi
|
|||||||
future
|
future
|
||||||
flask-socketio
|
flask-socketio
|
||||||
flask-restful
|
flask-restful
|
||||||
|
flask-cors
|
||||||
gevent-websocket
|
gevent-websocket
|
Loading…
Reference in New Issue
Block a user