quote.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. package quote
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. "mtp2_if/models"
  7. "mtp2_if/mtpcache"
  8. "mtp2_if/utils"
  9. "net/http"
  10. "strings"
  11. "time"
  12. "github.com/gin-gonic/gin"
  13. )
  14. // QueryQuoteDayReq 获取商品盘面信息请求参数
  15. type QueryQuoteDayReq struct {
  16. GoodsCodes string `form:"goodsCodes"`
  17. }
  18. // QueryQuoteDayRsp 获取商品盘面信息返回模型
  19. type QueryQuoteDayRsp struct {
  20. Exchangedate int64 `json:"exchangedate"` // 交易日
  21. Goodscode string `json:"goodscode"` // 商品代码
  22. Exchangecode int `json:"exchangecode"` // 交易所代码
  23. Preclose float64 `json:"preclose"` // 昨收
  24. Opentime time.Time `json:"opentime"` // 开盘时间
  25. Opened float64 `json:"opened"` // 开盘价
  26. Highest float64 `json:"highest"` // 最高价
  27. Lowest float64 `json:"lowest"` // 最低价
  28. Lasttime string `json:"lasttime"` // 行情时间(只有现价变化行情时间才变化)
  29. Utclasttime time.Time `json:"utclasttime"` // utc的行情时间
  30. Last float64 `json:"last"` // 最新价
  31. Lastvolume int64 `json:"lastvolume"` // 最新成交量
  32. Lastturnover float64 `json:"lastturnover` // 最新成交金额
  33. Totalbidvolume int64 `json:"totalbidvolume"` // 外盘
  34. Totalaskvolume int64 `json:"totalaskvolume"` // 内盘
  35. Totalvolume int64 `json:"totalvolume"` // 总量
  36. Totalturnover float64 `json:"totalturnover"` // 总金额
  37. Bid float64 `json:"bid"` // 买1
  38. Bid2 float64 `json:"bid2"` // 买2
  39. Bid3 float64 `json:"bid3"` // 买3
  40. Bid4 float64 `json:"bid4"` // 买4
  41. Bid5 float64 `json:"bid5"` // 买5
  42. Bidvolume int64 `json:"bidvolume"` // 买量1
  43. Bidvolume2 int64 `json:"bidvolume2"` // 买量2
  44. Bidvolume3 int64 `json:"bidvolume3"` // 买量3
  45. Bidvolume4 int64 `json:"bidvolume4"` // 买量4
  46. Bidvolume5 int64 `json:"bidvolume5"` // 买量5
  47. Ask float64 `json:"ask"` // 卖1
  48. Ask2 float64 `json:"ask2"` // 卖2
  49. Ask3 float64 `json:"ask3"` // 卖3
  50. Ask4 float64 `json:"ask4"` // 卖4
  51. Ask5 float64 `json:"ask5"` // 卖5
  52. Askvolume int64 `json:"askvolume"` // 卖量1
  53. Askvolume2 int64 `json:"askvolume2"` // 卖量2
  54. Askvolume3 int64 `json:"askvolume3"` // 卖量3
  55. Askvolume4 int64 `json:"askvolume4"` // 卖量4
  56. Askvolume5 int64 `json:"askvolume5"` // 卖量5
  57. Presettle float64 `json:"presettle"` // 昨结价
  58. Settle float64 `json:"settle"` // 结算价
  59. Preholdvolume int64 `json:"preholdvolume"` // 昨持仓
  60. Holdvolume int64 `json:"holdvolume"` // 持仓
  61. Averageprice float64 `json:"averageprice"` // 均价
  62. Orderid int64 `json:"orderid"` // 序号
  63. Limitup float64 `json:"limitup"` // 涨停价
  64. Limitdown float64 `json:"limitdown"` // 跌停价
  65. Inventory int64 `json:"inventory"` // 库存
  66. Holdincrement int64 `json:"holdincrement"` // 单笔持仓
  67. Iscleared int `json:"iscleared"` // 是否清盘标志
  68. Issettled int `json:"issettled"` // 是否结算标志
  69. Bidqueueinfo string `json:"bidqueueinfo"` // 大利市买港股用
  70. Askqueueinfo string `json:"askqueueinfo"` // 大利市卖港股用
  71. Bidorderid int64 `json:"bidorderid"` // 买单号1
  72. Bidorderid2 int64 `json:"bidorderid2"` // 买单号2
  73. Bidorderid3 int64 `json:"bidorderid3"` // 买单号3
  74. Bidorderid4 int64 `json:"bidorderid4"` // 买单号4
  75. Bidorderid5 int64 `json:"bidorderid5"` // 买单号5
  76. Askorderid int64 `json:"askorderid"` // 卖单号1
  77. Askorderid2 int64 `json:"askorderid2"` // 卖单号2
  78. Askorderid3 int64 `json:"askorderid3"` // 卖单号3
  79. Askorderid4 int64 `json:"askorderid4"` // 卖单号4
  80. Askorderid5 int64 `json:"askorderid5"` // 卖单号5
  81. Lastlot int64 `json:"lastlot"` // 最新成交手数
  82. Totallot int64 `json:"totallot"` // 总手数
  83. Strikeprice float64 `json:"strikeprice"` // 发行价
  84. Cleartime int64 `json:"cleartime"` // 清盘时间
  85. Calloptionpremiums int64 `json:"calloptionpremiums"` // 认购期权1
  86. Calloptionpremiums2 int64 `json:"calloptionpremiums2"` // 认购期权2
  87. Calloptionpremiums3 int64 `json:"calloptionpremiums3"` // 认购期权3
  88. Calloptionpremiums4 int64 `json:"calloptionpremiums4"` // 认购期权4
  89. Calloptionpremiums5 int64 `json:"calloptionpremiums5"` // 认购期权5
  90. Putoptionpremiums int64 `json:"putoptionpremiums"` // 认沽期权1
  91. Putoptionpremiums2 int64 `json:"putoptionpremiums2"` // 认沽期权2
  92. Putoptionpremiums3 int64 `json:"putoptionpremiums3"` // 认沽期权3
  93. Putoptionpremiums4 int64 `json:"putoptionpremiums4"` // 认沽期权4
  94. Putoptionpremiums5 int64 `json:"putoptionpremiums5"` // 认沽期权5
  95. Nontotalvolume int64 `json:"nontotalvolume"` // 非交易总量
  96. Nontotalholdervolume int64 `json:"nontotalholdervolume"` // 非交易持仓量
  97. Nontotalturnover int64 `json:"nontotalturnover"` // 非交易总金额
  98. Nontotallot int64 `json:"nontotallot"` // 非交易总手数
  99. Publictradetype string `json:"publictradetype"` // 公共交易标志类型 港股专用
  100. Iep float64 `json:"iep"` // 平衡价 港股专用
  101. Iev float64 `json:"iev"` // 平衡量 港股专用
  102. Grepmarketprice float64 `json:"grepmarketprice"` // 暗盘价 港股专用
  103. Bid6 float64 `json:"bid6"` // 买6
  104. Bid7 float64 `json:"bid7"` // 买7
  105. Bid8 float64 `json:"bid8"` // 买8
  106. Bid9 float64 `json:"bid9"` // 买9
  107. Bid10 float64 `json:"bid10"` // 买10
  108. Bidvolume6 int64 `json:"bidvolume6"` // 买量6
  109. Bidvolume7 int64 `json:"bidvolume7"` // 买量7
  110. Bidvolume8 int64 `json:"bidvolume8"` // 买量8
  111. Bidvolume9 int64 `json:"bidvolume9"` // 买量9
  112. Bidvolume10 int64 `json:"bidvolume10"` // 买量10
  113. Ask6 float64 `json:"ask6"` // 卖6
  114. Ask7 float64 `json:"ask7"` // 卖7
  115. Ask8 float64 `json:"ask8"` // 卖8
  116. Ask9 float64 `json:"ask9"` // 卖9
  117. Ask10 float64 `json:"ask10"` // 卖10
  118. Askvolume6 int64 `json:"askvolume6"` // 卖量6
  119. Askvolume7 int64 `json:"askvolume7"` // 卖量7
  120. Askvolume8 int64 `json:"askvolume8"` // 卖量8
  121. Askvolume9 int64 `json:"askvolume9"` // 卖量9
  122. Askvolume10 int64 `json:"askvolume10"` // 卖量10
  123. Bidordervolume int64 `json:"bidordervolume"` // 买单量1
  124. Bidordervolume2 int64 `json:"bidordervolume2"` // 买单量2
  125. Bidordervolume3 int64 `json:"bidordervolume3"` // 买单量3
  126. Bidordervolume4 int64 `json:"bidordervolume4"` // 买单量4
  127. Bidordervolume5 int64 `json:"bidordervolume5"` // 买单量5
  128. Bidordervolume6 int64 `json:"bidordervolume6"` // 买单量6
  129. Bidordervolume7 int64 `json:"bidordervolume7"` // 买单量7
  130. Bidordervolume8 int64 `json:"bidordervolume8"` // 买单量8
  131. Bidordervolume9 int64 `json:"bidordervolume9"` // 买单量9
  132. Bidordervolume10 int64 `json:"bidordervolume10"` // 买单量10
  133. Askordervolume int64 `json:"askordervolume"` // 卖单量1
  134. Askordervolume2 int64 `json:"askordervolume2"` // 卖单量2
  135. Askordervolume3 int64 `json:"askordervolume3"` // 卖单量3
  136. Askordervolume4 int64 `json:"askordervolume4"` // 卖单量4
  137. Askordervolume5 int64 `json:"askordervolume5"` // 卖单量5
  138. Askordervolume6 int64 `json:"askordervolume6"` // 卖单量6
  139. Askordervolume7 int64 `json:"askordervolume7"` // 卖单量7
  140. Askordervolume8 int64 `json:"askordervolume8"` // 卖单量8
  141. Askordervolume9 int64 `json:"askordervolume9"` // 卖单量9
  142. Askordervolume10 int64 `json:"askordervolume10"` // 卖单量10
  143. }
  144. // QueryQuoteDay 获取商品盘面信息
  145. // @Summary 获取商品盘面信息
  146. // @Produce json
  147. // @Security ApiKeyAuth
  148. // @Param goodsCodes query string false "此参数不填则查所有;商品代码列表,格式:CU2102,CU2103,AL2107"
  149. // @Success 200 {object} QueryQuoteDayRsp
  150. // @Failure 500 {object} app.Response
  151. // @Router /Quote/QueryQuoteDay [get]
  152. // @Tags 行情服务
  153. func QueryQuoteDay(c *gin.Context) {
  154. appG := app.Gin{C: c}
  155. // 获取请求参数
  156. var req QueryQuoteDayReq
  157. if err := appG.C.ShouldBindQuery(&req); err != nil {
  158. logger.GetLogger().Errorf("QueryQuoteDay failed: %s", err.Error())
  159. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  160. return
  161. }
  162. rsp := make([]QueryQuoteDayRsp, 0)
  163. quoteDays, err := models.GetQuoteDays(req.GoodsCodes)
  164. if err != nil {
  165. logger.GetLogger().Errorf("QueryQuoteDay failed: %s", err.Error())
  166. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  167. return
  168. }
  169. for _, v := range quoteDays {
  170. // 获取对应的商品信息
  171. goods, bFind := mtpcache.GetGoods(v.Goodscode)
  172. if bFind {
  173. rsp = append(rsp, QueryQuoteDayRsp{
  174. Exchangedate: v.Exchangedate,
  175. Goodscode: v.Goodscode,
  176. Exchangecode: v.Exchangecode,
  177. Preclose: utils.IntToFloat64(int(v.Preclose), int(goods.DECIMALPLACE)),
  178. Opentime: time.Unix(int64(v.Opentime), 0),
  179. Opened: utils.IntToFloat64(int(v.Opened), int(goods.DECIMALPLACE)),
  180. Highest: utils.IntToFloat64(int(v.Highest), int(goods.DECIMALPLACE)),
  181. Lowest: utils.IntToFloat64(int(v.Lowest), int(goods.DECIMALPLACE)),
  182. Lasttime: v.Lasttime,
  183. Utclasttime: time.Unix(int64(v.Utclasttime), 0),
  184. Last: utils.IntToFloat64(int(v.Last), int(goods.DECIMALPLACE)),
  185. Lastvolume: v.Lastvolume,
  186. Lastturnover: utils.IntToFloat64(int(v.Lastturnover), int(goods.DECIMALPLACE)),
  187. Totalbidvolume: v.Totalbidvolume,
  188. Totalaskvolume: v.Totalaskvolume,
  189. Totalvolume: v.Totalvolume,
  190. Totalturnover: utils.IntToFloat64(int(v.Totalturnover), int(goods.DECIMALPLACE)),
  191. Bid: utils.IntToFloat64(int(v.Bid), int(goods.DECIMALPLACE)),
  192. Bid2: utils.IntToFloat64(int(v.Bid2), int(goods.DECIMALPLACE)),
  193. Bid3: utils.IntToFloat64(int(v.Bid3), int(goods.DECIMALPLACE)),
  194. Bid4: utils.IntToFloat64(int(v.Bid4), int(goods.DECIMALPLACE)),
  195. Bid5: utils.IntToFloat64(int(v.Bid5), int(goods.DECIMALPLACE)),
  196. Bidvolume: v.Bidvolume,
  197. Bidvolume2: v.Bidvolume2,
  198. Bidvolume3: v.Bidvolume3,
  199. Bidvolume4: v.Bidvolume4,
  200. Bidvolume5: v.Bidvolume5,
  201. Ask: utils.IntToFloat64(int(v.Ask), int(goods.DECIMALPLACE)),
  202. Ask2: utils.IntToFloat64(int(v.Ask2), int(goods.DECIMALPLACE)),
  203. Ask3: utils.IntToFloat64(int(v.Ask3), int(goods.DECIMALPLACE)),
  204. Ask4: utils.IntToFloat64(int(v.Ask4), int(goods.DECIMALPLACE)),
  205. Ask5: utils.IntToFloat64(int(v.Ask5), int(goods.DECIMALPLACE)),
  206. Askvolume: v.Askvolume,
  207. Askvolume2: v.Askvolume2,
  208. Askvolume3: v.Askvolume3,
  209. Askvolume4: v.Askvolume4,
  210. Askvolume5: v.Askvolume5,
  211. Presettle: utils.IntToFloat64(int(v.Presettle), int(goods.DECIMALPLACE)),
  212. Settle: utils.IntToFloat64(int(v.Settle), int(goods.DECIMALPLACE)),
  213. Preholdvolume: v.Preholdvolume,
  214. Holdvolume: v.Holdvolume,
  215. Averageprice: utils.IntToFloat64(int(v.Averageprice), int(goods.DECIMALPLACE)),
  216. Orderid: v.Orderid,
  217. Limitup: utils.IntToFloat64(int(v.Limitup), int(goods.DECIMALPLACE)),
  218. Limitdown: utils.IntToFloat64(int(v.Limitdown), int(goods.DECIMALPLACE)),
  219. Inventory: v.Inventory,
  220. Holdincrement: v.Holdincrement,
  221. Iscleared: v.Iscleared,
  222. Issettled: v.Issettled,
  223. Bidqueueinfo: v.Bidqueueinfo,
  224. Askqueueinfo: v.Askqueueinfo,
  225. Bidorderid: v.Bidorderid,
  226. Bidorderid2: v.Bidorderid2,
  227. Bidorderid3: v.Bidorderid3,
  228. Bidorderid4: v.Bidorderid4,
  229. Bidorderid5: v.Bidorderid5,
  230. Askorderid: v.Askorderid,
  231. Askorderid2: v.Askorderid2,
  232. Askorderid3: v.Askorderid3,
  233. Askorderid4: v.Askorderid4,
  234. Askorderid5: v.Askorderid5,
  235. Lastlot: v.Lastlot,
  236. Totallot: v.Totallot,
  237. Strikeprice: utils.IntToFloat64(int(v.Strikeprice), int(goods.DECIMALPLACE)),
  238. Cleartime: v.Cleartime,
  239. Calloptionpremiums: v.Calloptionpremiums,
  240. Calloptionpremiums2: v.Calloptionpremiums2,
  241. Calloptionpremiums3: v.Calloptionpremiums3,
  242. Calloptionpremiums4: v.Calloptionpremiums4,
  243. Calloptionpremiums5: v.Calloptionpremiums5,
  244. Putoptionpremiums: v.Putoptionpremiums,
  245. Putoptionpremiums2: v.Putoptionpremiums2,
  246. Putoptionpremiums3: v.Putoptionpremiums3,
  247. Putoptionpremiums4: v.Putoptionpremiums4,
  248. Putoptionpremiums5: v.Putoptionpremiums5,
  249. Nontotalvolume: v.Nontotalvolume,
  250. Nontotalholdervolume: v.Nontotalholdervolume,
  251. Nontotalturnover: v.Nontotalturnover,
  252. Nontotallot: v.Nontotallot,
  253. Publictradetype: v.Publictradetype,
  254. Iep: utils.IntToFloat64(int(v.Iep), int(goods.DECIMALPLACE)),
  255. Iev: utils.IntToFloat64(int(v.Iev), int(goods.DECIMALPLACE)),
  256. Grepmarketprice: utils.IntToFloat64(int(v.Grepmarketprice), int(goods.DECIMALPLACE)),
  257. Bid6: utils.IntToFloat64(int(v.Bid6), int(goods.DECIMALPLACE)),
  258. Bid7: utils.IntToFloat64(int(v.Bid7), int(goods.DECIMALPLACE)),
  259. Bid8: utils.IntToFloat64(int(v.Bid8), int(goods.DECIMALPLACE)),
  260. Bid9: utils.IntToFloat64(int(v.Bid9), int(goods.DECIMALPLACE)),
  261. Bid10: utils.IntToFloat64(int(v.Bid10), int(goods.DECIMALPLACE)),
  262. Bidvolume6: v.Bidvolume6,
  263. Bidvolume7: v.Bidvolume7,
  264. Bidvolume8: v.Bidvolume8,
  265. Bidvolume9: v.Bidvolume9,
  266. Bidvolume10: v.Bidvolume10,
  267. Ask6: utils.IntToFloat64(int(v.Ask6), int(goods.DECIMALPLACE)),
  268. Ask7: utils.IntToFloat64(int(v.Ask7), int(goods.DECIMALPLACE)),
  269. Ask8: utils.IntToFloat64(int(v.Ask8), int(goods.DECIMALPLACE)),
  270. Ask9: utils.IntToFloat64(int(v.Ask9), int(goods.DECIMALPLACE)),
  271. Ask10: utils.IntToFloat64(int(v.Ask10), int(goods.DECIMALPLACE)),
  272. Askvolume6: v.Askvolume6,
  273. Askvolume7: v.Askvolume7,
  274. Askvolume8: v.Askvolume8,
  275. Askvolume9: v.Askvolume9,
  276. Askvolume10: v.Askvolume10,
  277. Bidordervolume: v.Bidordervolume,
  278. Bidordervolume2: v.Bidordervolume2,
  279. Bidordervolume3: v.Bidordervolume3,
  280. Bidordervolume4: v.Bidordervolume4,
  281. Bidordervolume5: v.Bidordervolume5,
  282. Bidordervolume6: v.Bidordervolume6,
  283. Bidordervolume7: v.Bidordervolume7,
  284. Bidordervolume8: v.Bidordervolume8,
  285. Bidordervolume9: v.Bidordervolume9,
  286. Bidordervolume10: v.Bidordervolume10,
  287. Askordervolume: v.Askordervolume,
  288. Askordervolume2: v.Askordervolume2,
  289. Askordervolume3: v.Askordervolume3,
  290. Askordervolume4: v.Askordervolume4,
  291. Askordervolume5: v.Askordervolume5,
  292. Askordervolume6: v.Askordervolume6,
  293. Askordervolume7: v.Askordervolume7,
  294. Askordervolume8: v.Askordervolume8,
  295. Askordervolume9: v.Askordervolume9,
  296. Askordervolume10: v.Askordervolume10,
  297. })
  298. }
  299. }
  300. // 查询成功
  301. logger.GetLogger().Debugln("QueryQuoteDay successed, rows: %v", len(rsp))
  302. appG.Response(http.StatusOK, e.SUCCESS, rsp)
  303. }
  304. type GetTouristQuoteDayReq struct {
  305. Goodscodes string `form:"goodsCodes" binding:"required"` // 商品代码列表,格式:1,2,3
  306. }
  307. // GetTouristQuoteDay 获取游客商品盘面信息
  308. // @Summary 获取游客商品盘面信息
  309. // @Produce json
  310. // @Param goodsCodes query string true "商品代码列表,格式:1,2,3"
  311. // @Success 200 {array} QueryQuoteDayRsp
  312. // @Failure 500 {object} app.Response
  313. // @Router /Quote/GetTouristQuoteDay [get]
  314. // @Tags 行情服务
  315. func GetTouristQuoteDay(c *gin.Context) {
  316. appG := app.Gin{C: c}
  317. // 获取请求参数
  318. var req GetTouristQuoteDayReq
  319. if err := appG.C.ShouldBindQuery(&req); err != nil {
  320. logger.GetLogger().Errorf("GetTouristQuoteDay failed: %s", err.Error())
  321. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  322. return
  323. }
  324. g := strings.Split(req.Goodscodes, ",")
  325. quoteDays, err := models.GetRedisQuoteDays(g)
  326. if err != nil {
  327. logger.GetLogger().Errorf("GetTouristQuoteDay failed: %s", err.Error())
  328. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  329. return
  330. }
  331. rsp := make([]QueryQuoteDayRsp, 0)
  332. for _, v := range quoteDays {
  333. // 获取对应的商品信息
  334. goods, bFind := mtpcache.GetGoods(v.Goodscode)
  335. if bFind {
  336. rsp = append(rsp, QueryQuoteDayRsp{
  337. Exchangedate: v.Exchangedate,
  338. Goodscode: v.Goodscode,
  339. Exchangecode: v.Exchangecode,
  340. Preclose: utils.IntToFloat64(int(v.Preclose), int(goods.DECIMALPLACE)),
  341. Opentime: time.Unix(int64(v.Opentime), 0),
  342. Opened: utils.IntToFloat64(int(v.Opened), int(goods.DECIMALPLACE)),
  343. Highest: utils.IntToFloat64(int(v.Highest), int(goods.DECIMALPLACE)),
  344. Lowest: utils.IntToFloat64(int(v.Lowest), int(goods.DECIMALPLACE)),
  345. Lasttime: v.Lasttime,
  346. Utclasttime: time.Unix(int64(v.Utclasttime), 0),
  347. Last: utils.IntToFloat64(int(v.Last), int(goods.DECIMALPLACE)),
  348. Lastvolume: v.Lastvolume,
  349. Lastturnover: utils.IntToFloat64(int(v.Lastturnover), int(goods.DECIMALPLACE)),
  350. Totalbidvolume: v.Totalbidvolume,
  351. Totalaskvolume: v.Totalaskvolume,
  352. Totalvolume: v.Totalvolume,
  353. Totalturnover: utils.IntToFloat64(int(v.Totalturnover), int(goods.DECIMALPLACE)),
  354. Bid: utils.IntToFloat64(int(v.Bid), int(goods.DECIMALPLACE)),
  355. Bid2: utils.IntToFloat64(int(v.Bid2), int(goods.DECIMALPLACE)),
  356. Bid3: utils.IntToFloat64(int(v.Bid3), int(goods.DECIMALPLACE)),
  357. Bid4: utils.IntToFloat64(int(v.Bid4), int(goods.DECIMALPLACE)),
  358. Bid5: utils.IntToFloat64(int(v.Bid5), int(goods.DECIMALPLACE)),
  359. Bidvolume: v.Bidvolume,
  360. Bidvolume2: v.Bidvolume2,
  361. Bidvolume3: v.Bidvolume3,
  362. Bidvolume4: v.Bidvolume4,
  363. Bidvolume5: v.Bidvolume5,
  364. Ask: utils.IntToFloat64(int(v.Ask), int(goods.DECIMALPLACE)),
  365. Ask2: utils.IntToFloat64(int(v.Ask2), int(goods.DECIMALPLACE)),
  366. Ask3: utils.IntToFloat64(int(v.Ask3), int(goods.DECIMALPLACE)),
  367. Ask4: utils.IntToFloat64(int(v.Ask4), int(goods.DECIMALPLACE)),
  368. Ask5: utils.IntToFloat64(int(v.Ask5), int(goods.DECIMALPLACE)),
  369. Askvolume: v.Askvolume,
  370. Askvolume2: v.Askvolume2,
  371. Askvolume3: v.Askvolume3,
  372. Askvolume4: v.Askvolume4,
  373. Askvolume5: v.Askvolume5,
  374. Presettle: utils.IntToFloat64(int(v.Presettle), int(goods.DECIMALPLACE)),
  375. Settle: utils.IntToFloat64(int(v.Settle), int(goods.DECIMALPLACE)),
  376. Preholdvolume: v.Preholdvolume,
  377. Holdvolume: v.Holdvolume,
  378. Averageprice: utils.IntToFloat64(int(v.Averageprice), int(goods.DECIMALPLACE)),
  379. Orderid: v.Orderid,
  380. Limitup: utils.IntToFloat64(int(v.Limitup), int(goods.DECIMALPLACE)),
  381. Limitdown: utils.IntToFloat64(int(v.Limitdown), int(goods.DECIMALPLACE)),
  382. Inventory: v.Inventory,
  383. Holdincrement: v.Holdincrement,
  384. Iscleared: v.Iscleared,
  385. Issettled: v.Issettled,
  386. Bidqueueinfo: v.Bidqueueinfo,
  387. Askqueueinfo: v.Askqueueinfo,
  388. Bidorderid: v.Bidorderid,
  389. Bidorderid2: v.Bidorderid2,
  390. Bidorderid3: v.Bidorderid3,
  391. Bidorderid4: v.Bidorderid4,
  392. Bidorderid5: v.Bidorderid5,
  393. Askorderid: v.Askorderid,
  394. Askorderid2: v.Askorderid2,
  395. Askorderid3: v.Askorderid3,
  396. Askorderid4: v.Askorderid4,
  397. Askorderid5: v.Askorderid5,
  398. Lastlot: v.Lastlot,
  399. Totallot: v.Totallot,
  400. Strikeprice: utils.IntToFloat64(int(v.Strikeprice), int(goods.DECIMALPLACE)),
  401. Cleartime: v.Cleartime,
  402. Calloptionpremiums: v.Calloptionpremiums,
  403. Calloptionpremiums2: v.Calloptionpremiums2,
  404. Calloptionpremiums3: v.Calloptionpremiums3,
  405. Calloptionpremiums4: v.Calloptionpremiums4,
  406. Calloptionpremiums5: v.Calloptionpremiums5,
  407. Putoptionpremiums: v.Putoptionpremiums,
  408. Putoptionpremiums2: v.Putoptionpremiums2,
  409. Putoptionpremiums3: v.Putoptionpremiums3,
  410. Putoptionpremiums4: v.Putoptionpremiums4,
  411. Putoptionpremiums5: v.Putoptionpremiums5,
  412. Nontotalvolume: v.Nontotalvolume,
  413. Nontotalholdervolume: v.Nontotalholdervolume,
  414. Nontotalturnover: v.Nontotalturnover,
  415. Nontotallot: v.Nontotallot,
  416. Publictradetype: v.Publictradetype,
  417. Iep: utils.IntToFloat64(int(v.Iep), int(goods.DECIMALPLACE)),
  418. Iev: utils.IntToFloat64(int(v.Iev), int(goods.DECIMALPLACE)),
  419. Grepmarketprice: utils.IntToFloat64(int(v.Grepmarketprice), int(goods.DECIMALPLACE)),
  420. Bid6: utils.IntToFloat64(int(v.Bid6), int(goods.DECIMALPLACE)),
  421. Bid7: utils.IntToFloat64(int(v.Bid7), int(goods.DECIMALPLACE)),
  422. Bid8: utils.IntToFloat64(int(v.Bid8), int(goods.DECIMALPLACE)),
  423. Bid9: utils.IntToFloat64(int(v.Bid9), int(goods.DECIMALPLACE)),
  424. Bid10: utils.IntToFloat64(int(v.Bid10), int(goods.DECIMALPLACE)),
  425. Bidvolume6: v.Bidvolume6,
  426. Bidvolume7: v.Bidvolume7,
  427. Bidvolume8: v.Bidvolume8,
  428. Bidvolume9: v.Bidvolume9,
  429. Bidvolume10: v.Bidvolume10,
  430. Ask6: utils.IntToFloat64(int(v.Ask6), int(goods.DECIMALPLACE)),
  431. Ask7: utils.IntToFloat64(int(v.Ask7), int(goods.DECIMALPLACE)),
  432. Ask8: utils.IntToFloat64(int(v.Ask8), int(goods.DECIMALPLACE)),
  433. Ask9: utils.IntToFloat64(int(v.Ask9), int(goods.DECIMALPLACE)),
  434. Ask10: utils.IntToFloat64(int(v.Ask10), int(goods.DECIMALPLACE)),
  435. Askvolume6: v.Askvolume6,
  436. Askvolume7: v.Askvolume7,
  437. Askvolume8: v.Askvolume8,
  438. Askvolume9: v.Askvolume9,
  439. Askvolume10: v.Askvolume10,
  440. Bidordervolume: v.Bidordervolume,
  441. Bidordervolume2: v.Bidordervolume2,
  442. Bidordervolume3: v.Bidordervolume3,
  443. Bidordervolume4: v.Bidordervolume4,
  444. Bidordervolume5: v.Bidordervolume5,
  445. Bidordervolume6: v.Bidordervolume6,
  446. Bidordervolume7: v.Bidordervolume7,
  447. Bidordervolume8: v.Bidordervolume8,
  448. Bidordervolume9: v.Bidordervolume9,
  449. Bidordervolume10: v.Bidordervolume10,
  450. Askordervolume: v.Askordervolume,
  451. Askordervolume2: v.Askordervolume2,
  452. Askordervolume3: v.Askordervolume3,
  453. Askordervolume4: v.Askordervolume4,
  454. Askordervolume5: v.Askordervolume5,
  455. Askordervolume6: v.Askordervolume6,
  456. Askordervolume7: v.Askordervolume7,
  457. Askordervolume8: v.Askordervolume8,
  458. Askordervolume9: v.Askordervolume9,
  459. Askordervolume10: v.Askordervolume10,
  460. })
  461. }
  462. }
  463. // 查询成功
  464. // logger.GetLogger().Debugln("GetTouristQuoteDay successed, rows: %v", len(rsp))
  465. appG.Response(http.StatusOK, e.SUCCESS, rsp)
  466. }