@hbec-public
2016-09-27T01:24:01.000000Z
字数 3669
阅读 563
接口文档 模块划分
| 需求版本 | 修订类型 | 修订人员 | 日期 | 说明 |
|---|---|---|---|---|
| 3.3.0 | 初稿 | 王鹏举 | 2016-09-14 | 模拟交易相关接口 |
| 3.3.0 | 新增 | 王鹏举 | 2016-09-19 | 个股持仓 |
| 3.3.0 | 新增 | 王鹏举 | 2016-09-26 | 持仓列表 |
| 3.3.0 | 新增 | 王鹏举 | 2016-09-27 | 数据字典 |
5个公共请求参数:_b_、_e_、_t_、_appSign_、_appCrypt_
对于私有接口,
_b_、_e_为登录成功之后获取的标识,参数传递到后台会被自动解析成投客userId
_t_为标识移动端所用版本信息
_appSign_、_appCrypt_为签名和加密字符串
_b_、_e_、_t_)拼成name=zhangsan&password=123&status=1的形式,得到字符串 str_appSign__appCrypt_接口文档中URL皆以{site}替换
| 环境 | URL |
|---|---|
| 开发 | http://api.dev.hbec.com/cg |
| 仿真 | http://api-wwwtest.touker.com/cg |
| 生产 | http://api.touker.com/cg |
服务名
simulatedTradingController.queryAvailableNum
明文调用示例
{site}/simulatedTradingController.queryAvailableNum?stockCode=000001&exchange=SZ&price=9
描述
查询用户可买卖的股票数量
参数列表
| 参数名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| stockCode | String | Y | 股票code |
| exchange | String | Y | 证券交易所编码 |
| price | Double | Y | 价格:若用户未填写,传递当前价 |
响应结构
{"data":{"buyableNum":311600,"vendibleNum":1500},"message":null,"result":1}
响应字段
| 字段名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| buyableNum | Integer | N | 可买数量 |
| vendibleNum | Integer | N | 可卖数量 |
服务名
simulatedTradingController.queryAccountCapital
明文调用示例
{site}/simulatedTradingController.queryAccountCapital
描述
查询用户模拟账户资产
参数列表
| 参数名 | 类型 | 不可为空 | 说明 |
|---|
响应结构
{"result": "1","message": "","data": {"totalAssets": '200211717',"totalMarketValue": '211840',"useAvailable": '199999877',"totalProfit": '199999877'}}
响应字段
| 字段名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| totalAssets | string | Y | 总资产 |
| totalMarketValue | string | Y | 总市值 |
| useAvailable | string | Y | 可用资产 |
| totalProfit | string | Y | 盈亏 |
服务名
simulatedTradingController.revoke
明文调用示例
{site}/simulatedTradingController.revoke?entrustCode=123
描述
撤单
参数列表
| 参数名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| entrustCode | string | Y | 委托号 |
响应结构
{"result": "1","message": "","data": '853'}
响应字段
| 字段名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| data | string | Y | 撤单号 |
服务名
simulatedTradingController.queryHoldPosition
明文调用示例
{site}/simulatedTradingController.queryHoldPosition?stockCode=000001&exchange=SZ
描述
撤单
参数列表
| 参数名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| stockCode | string | Y | 股票代码 |
| exchange | string | Y | 股票代码 |
响应结构
//正常返回{"result": "1","message": "","data": {"code": "002176","name": "江特电机","exchange": "SZ","amount": 1000,"sellAvailable": 0,"currentPrice": "13.47","changePercent": "0.45","profit": "340.0","costPrice": "13.13","profitPercent": "2.59","marketValue": "13470.0"}}//持仓为空时返回{"message":"","result":"1","data":null}
响应字段
| 字段名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| code | string | Y | 股票代码 |
| name | string | Y | 股票名称 |
| exchange | string | Y | 交易所 |
| amount | int | Y | 持仓数量 |
| sellAvailable | int | Y | 可卖 |
| currentPrice | string | Y | 当前价 |
| changePercent | string | Y | 涨跌幅 |
| profit | string | Y | 盈亏 |
| costPrice | string | Y | 成本价 |
| profitPercent | string | Y | 盈亏比例 |
| marketValue | string | Y | 市值 |
| securityType | int | Y | 股票类型 |
服务名
simulatedTradingController.queryHoldPositions
明文调用示例
{site}/simulatedTradingController.queryHoldPositions?pageNo=1&pageSize=20
描述
分页查询持仓接口,pageNo当前页,默认等于1,pageSize每页返回的数据数目,默认返回20条数据。
参数列表
| 参数名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| pageNo | int | N | 当前页,默认1 |
| pageSize | int | N | 每页条数,默认返回20条 |
响应结构
//正常返回{"result": "1","message": "","data": {"count": 5,"list": [{"code": "600197","name": "伊力特","exchange": "SH","amount": 200,"sellAvailable": 0,"currentPrice": "14.00","changePercent": "-1.27","profit": "-12.0","costPrice": "14.06","profitPercent": "-0.43","marketValue": "2800.0","securityType":4},{"code": "600006","name": "东风汽车","exchange": "SH","amount": 200,"sellAvailable": 0,"currentPrice": "7.66","changePercent": "-1.67","profit": "-32.0","costPrice": "7.82","profitPercent": "-2.05","marketValue": "1532.0","securityType":4}],"pageNo": 1,"pageSize": 2,"hasNextPage": true,"desc": 0}}//持仓为空时返回{"message":"","result":"1","data":null}
响应字段
| 字段名 | 类型 | 不可为空 | 说明 |
|---|---|---|---|
| count | int | Y | 总数 |
| pageNo | int | Y | 页码,与传参相同 |
| pageSize | int | Y | 每页数量,与传参相同 |
| hasNextPage | boolean | Y | 是否有下一页数据 |
| code | string | Y | 股票代码 |
| name | string | Y | 股票名称 |
| exchange | string | Y | 交易所 |
| amount | int | Y | 持仓数量 |
| sellAvailable | int | Y | 可卖 |
| currentPrice | string | Y | 当前价 |
| changePercent | string | Y | 涨跌幅 |
| profit | string | Y | 盈亏 |
| costPrice | string | Y | 成本价 |
| profitPercent | string | Y | 盈亏比例 |
| marketValue | string | Y | 市值 |
| securityType | int | Y | 股票类型 |