router.go 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. package routers
  2. import (
  3. "mtp2_if/config"
  4. "mtp2_if/controllers/cfg"
  5. "mtp2_if/controllers/common"
  6. "mtp2_if/controllers/cptrade"
  7. "mtp2_if/controllers/delivery"
  8. "mtp2_if/controllers/ermcp"
  9. "mtp2_if/controllers/ermcp3"
  10. "mtp2_if/controllers/ermcp8"
  11. "mtp2_if/controllers/erms2"
  12. "mtp2_if/controllers/erms3"
  13. "mtp2_if/controllers/ferroalloy"
  14. "mtp2_if/controllers/guangzuan"
  15. "mtp2_if/controllers/hsby"
  16. "mtp2_if/controllers/market"
  17. "mtp2_if/controllers/mine"
  18. "mtp2_if/controllers/order"
  19. "mtp2_if/controllers/other"
  20. "mtp2_if/controllers/presale"
  21. "mtp2_if/controllers/qhj"
  22. "mtp2_if/controllers/qhjPCWeb"
  23. "mtp2_if/controllers/quote"
  24. "mtp2_if/controllers/sbyj"
  25. "mtp2_if/controllers/search"
  26. "mtp2_if/controllers/szdz"
  27. "mtp2_if/controllers/taaccount"
  28. "mtp2_if/controllers/tjmd"
  29. "mtp2_if/controllers/trade"
  30. "mtp2_if/controllers/tradexx"
  31. "mtp2_if/controllers/user"
  32. "mtp2_if/controllers/wrTrade2"
  33. "mtp2_if/controllers/wrtrade"
  34. "mtp2_if/controllers/zj"
  35. "mtp2_if/logger"
  36. "mtp2_if/token"
  37. "net/http"
  38. "time"
  39. "github.com/gin-gonic/gin"
  40. // Swagger生成的文档
  41. docs "mtp2_if/docs"
  42. ginSwagger "github.com/swaggo/gin-swagger"
  43. "github.com/swaggo/gin-swagger/swaggerFiles"
  44. )
  45. // InitRouter 初始化路由器的方法
  46. func InitRouter() *gin.Engine {
  47. r := gin.New()
  48. // 设置日志中间件
  49. r.Use(ginLoggerMiddleware())
  50. // 设置奔溃中间件
  51. r.Use(ginRecoveryMiddleware())
  52. // 跨域
  53. r.Use(CORSMiddleware())
  54. // Swagger
  55. if config.SerCfg.GetDebugMode() {
  56. docs.SwaggerInfo.BasePath = "/api" // v1.8.x 需要增加这一句,不然会404
  57. r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
  58. r.GET("/debug/log", other.LogList)
  59. r.GET("/debug/log/view", other.LogView)
  60. r.GET("/debug/download", other.DownloadFile)
  61. r.GET("/debug/update", other.MakeUpdateScript)
  62. r.GET("/debug/token", other.SetToken)
  63. }
  64. // 终端配置
  65. r.GET("/cfg", cfg.QueryCfg)
  66. // 主业务路由分组
  67. apiR := r.Group("/api")
  68. // apiR.Use(token.Auth())
  69. // ************************ 账户信息 ************************
  70. userR := apiR.Group("User")
  71. userR.Use()
  72. {
  73. // 获取登录ID
  74. userR.GET("/GetLoginID", user.GetLoginID)
  75. // 获取用户邀请码请求参数
  76. userR.GET("/QueryUserReferNum", user.QueryUserReferNum)
  77. // 获取用户信息请求参数
  78. userR.Use(token.Auth()).GET("/QueryUserInfo", user.QueryUserInfo)
  79. // 获取用户实名认证状态
  80. userR.Use(token.Auth()).GET("/GetUserAuthStatus", user.GetUserAuthStatus)
  81. // 获取用户商品收藏信息
  82. userR.Use(token.Auth()).GET("/QueryUserFavoriteGoodses", user.QueryUserFavoriteGoodses)
  83. // 添加用户商品收藏信息
  84. userR.Use(token.Auth()).POST("/AddUserFavoriteGoods", user.AddUserFavoriteGoods)
  85. // 移除用户商品收藏信息
  86. userR.Use(token.Auth()).POST("/RemoveUserFavoriteGoods", user.RemoveUserFavoriteGoods)
  87. // 获取用户留言板信息
  88. userR.Use(token.Auth()).GET("/QueryMessageBoard", user.QueryMessageBoard)
  89. // 添加用户留言板信息
  90. userR.Use(token.Auth()).POST("/AddMessageBoard", user.AddMessageBoard)
  91. // 获取用户账号信息
  92. userR.Use(token.Auth()).GET("/GetUserAccount", user.GetUserAccount)
  93. // 更新用户状态
  94. userR.Use(token.Auth()).POST("/UpdateUserAccountStatus", user.UpdateUserAccountStatus)
  95. // 账户登录后信息查询
  96. userR.Use(token.Auth()).GET("/LoginQuery", user.LoginQuery)
  97. userR.Use(token.Auth()).POST("/UpdateUserHeadUrl", user.UpdateUserHeadUrl)
  98. }
  99. // ************************ 资金账户 ************************
  100. taAccountR := apiR.Group("TaAccount")
  101. taAccountR.Use(token.Auth())
  102. {
  103. // 获取资金账户信息
  104. taAccountR.GET("/GetTaAccounts", taaccount.GetTaAccounts)
  105. // 资金流水查询(当前)
  106. taAccountR.GET("/QueryAmountLog", taaccount.QueryAmountLog)
  107. // 资金流水查询(历史)
  108. taAccountR.GET("/QueryHisAmountLog", taaccount.QueryHisAmountLog)
  109. // 获取关联资金账户信息
  110. taAccountR.GET("/QueryRelatedTaAccount", taaccount.QueryRelatedTaAccount)
  111. }
  112. // ************************ 通用服务 ************************
  113. commonR := apiR.Group("Common")
  114. commonR.Use()
  115. {
  116. // 查询交易端菜单
  117. commonR.GET("/QueryTraderMenu", common.QueryTraderMenu)
  118. // 查询交易端列表头信息
  119. commonR.GET("/QueryTableDefine", common.QueryTableDefine)
  120. // 查询省市信息(不包括区)
  121. commonR.GET("/QueryProvincesAndCities", common.QueryProvincesAndCities)
  122. // 查询区域信息
  123. commonR.GET("/GetDivisions", common.GetDivisions)
  124. // 查询轮播图配置信息
  125. commonR.GET("/QueryImageConfigs", common.QueryImageConfigs)
  126. // 获取所有枚举信息
  127. commonR.GET("/GetAllEnums", common.GetAllEnums)
  128. // 获取服务器时间
  129. commonR.GET("/GetServerTime", common.GetServerTime)
  130. // 获取数据库错误信息
  131. commonR.GET("/QueryErrorInfos", common.QueryErrorInfos)
  132. // 获取数据库错误信息
  133. commonR.GET("/QueryNewTitles", common.QueryNewTitles)
  134. // 获取资讯内容
  135. commonR.GET("/QueryNewContents", common.QueryNewContents)
  136. commonR.GET("/GetJ10News", common.GetJ10News)
  137. // 通知公告系统消息查询
  138. commonR.Use(token.Auth()).GET("/QueryNotice", common.QueryNotice)
  139. // 通知公告设置已读请求
  140. commonR.Use(token.Auth()).POST("/NoticeReaded", common.NoticeReaded)
  141. // 获取交易端菜单
  142. commonR.Use(token.Auth()).GET("/GetClientMenus", common.GetClientMenus)
  143. // 获取PCWeb交易端菜单(V6版本之后使用)
  144. commonR.Use(token.Auth()).GET("/GetPCWebMenus", common.GetPCWebMenus)
  145. // 这四个接口不开放给一般操作人员使用
  146. commonR.Use(token.Auth()).GET("/FindNewFuncmenu", common.FindNewFuncmenu)
  147. commonR.Use(token.Auth()).POST("/InsertNewFuncmenu", common.InsertNewFuncmenu)
  148. commonR.Use(token.Auth()).PUT("/UpdateNewFuncmenu", common.UpdateNewFuncmenu)
  149. commonR.Use(token.Auth()).DELETE("/DeleteNewFuncmenu", common.DeleteNewFuncmenu)
  150. commonR.Use(token.Auth()).GET("/GetClientNewFuncmenu", common.GetClientNewFuncmenu)
  151. commonR.Use(token.Auth()).GET("/QueryRates", common.QueryRates)
  152. }
  153. // ************************ 通用市场 ************************
  154. marketR := apiR.Group("Market")
  155. marketR.Use()
  156. {
  157. // 查询市场运行信息
  158. marketR.GET("/QueryMarketRun", market.QueryMarketRun)
  159. // 获取登录账号有权限的市场信息
  160. marketR.Use(token.Auth()).GET("/QueryMarketsByLoginID", market.QueryMarketsByLoginID)
  161. // 获取登录账号有权限的商品信息
  162. marketR.Use(token.Auth()).GET("/QueryGoodsesByLoginID", market.QueryGoodsesByLoginID)
  163. // 获取所有外部交易所信息
  164. marketR.Use(token.Auth()).GET("/GetAllExExchanges", market.GetAllExExchanges)
  165. }
  166. // ************************ 通用单据 ************************
  167. orderR := apiR.Group("Order")
  168. orderR.Use(token.Auth())
  169. {
  170. // 持仓汇总查询(合约市场)
  171. orderR.GET("/QueryTradePosition", order.QueryTradePosition)
  172. // 委托单查询请求(合约市场)
  173. orderR.GET("/QueryTradeOrderDetail", order.QueryTradeOrderDetail)
  174. // 历史委托单查询请求(合约市场)
  175. orderR.GET("/QueryHisTradeOrderDetail", order.QueryHisTradeOrderDetail)
  176. // 成交单查询(合约市场)
  177. orderR.GET("/QueryTradeDetail", order.QueryTradeDetail)
  178. // 历史成交单查询(合约市场)
  179. orderR.GET("/QueryHisTradeDetail", order.QueryHisTradeDetail)
  180. orderR.GET("/QueryTradeHolderDetail", tradexx.QueryTradeHolderDetail)
  181. orderR.GET("/QueryTradePosition2", tradexx.QueryTradePosition)
  182. }
  183. // ************************ 通用交易 ************************
  184. tradeR := apiR.Group("Trade")
  185. tradeR.Use(token.Auth())
  186. {
  187. // 点选挂牌委托单据查询(保证金摘牌大厅)
  188. tradeR.GET("/QueryRecieptOrder", trade.QueryRecieptOrder)
  189. }
  190. // ************************ 行情服务 ************************
  191. quoteR := apiR.Group("Quote")
  192. // quoteR.Use(token.AuthByHsby())
  193. quoteR.Use()
  194. {
  195. quoteR.Use().GET("/GetTouristQuoteDay", quote.GetTouristQuoteDay)
  196. // 查询行情历史数据
  197. quoteR.Use(token.Auth()).GET("/QueryHistoryDatas", quote.QueryHistoryDatas)
  198. // 查询行情Tik数据
  199. quoteR.Use(token.Auth()).GET("/QueryHistoryTikDatas", quote.QueryHistoryTikDatas)
  200. // 查询分时图历史数据
  201. quoteR.Use(token.Auth()).GET("/QueryTSData", quote.QueryTSData)
  202. // 获取商品盘面信息
  203. quoteR.Use(token.Auth()).GET("/QueryQuoteDay", quote.QueryQuoteDay)
  204. }
  205. // ************************ 检索服务 ************************
  206. searchR := apiR.Group("Search")
  207. searchR.Use()
  208. {
  209. // 检索商品信息
  210. searchR.GET("/SearchGoodses", search.Goodses)
  211. }
  212. // ************************ 仓单贸易 ************************
  213. wrTradeR := apiR.Group("WRTrade")
  214. wrTradeR.Use(token.Auth())
  215. {
  216. wrTradeR.GET("/GetAllDeliveryGoods", wrtrade.GetAllDeliveryGoods)
  217. }
  218. // ************************ 产能预售 ************************
  219. cpTradeR := apiR.Group("CPTrade")
  220. cpTradeR.Use(token.Auth())
  221. {
  222. // 查询产能预售申请表
  223. cpTradeR.GET("/QueryPreasleApply", cptrade.QueryPreasleApply)
  224. // 查询远期订单信息
  225. cpTradeR.GET("/QueryUserGoodsData", cptrade.QueryUserGoodsData)
  226. // 查询远期订单注销申请信息
  227. cpTradeR.GET("/QueryPositionCancel", cptrade.QueryPositionCancel)
  228. // 查询产能预售商品扩展信息
  229. cpTradeR.GET("/QueryPresaleGoodsEx", cptrade.QueryPresaleGoodsEx)
  230. // 查询产能预售我的出价信息
  231. cpTradeR.GET("/QueryCPTradeMyBidInfos", cptrade.QueryCPTradeMyBidInfos)
  232. // 查询我的预售信息
  233. cpTradeR.GET("/QueryMyCPTradeGoods", cptrade.QueryMyCPTradeGoods)
  234. // 查询产能预售委托单信息
  235. cpTradeR.GET("/QueryCPTradeOrderDetail", cptrade.QueryCPTradeOrderDetail)
  236. }
  237. // ************************ 交割服务 ************************
  238. deliveryR := apiR.Group("Delivery")
  239. deliveryR.Use(token.Auth())
  240. {
  241. // 查询商品交割关系表
  242. deliveryR.GET("/QueryDeliveryRelation", delivery.QueryDeliveryRelation)
  243. }
  244. // ************************ 风险管理 ************************
  245. erms2R := apiR.Group("Erms2")
  246. erms2R.Use(token.Auth())
  247. {
  248. // 查询内部成交单信息
  249. erms2R.GET("/QueryInnerTradeDetail", erms2.QueryInnerTradeDetail)
  250. // 查询期现套利策略表信息(指定资金账户、未结束的)
  251. erms2R.GET("/QueryArbitrageStrategy", erms2.QueryArbitrageStrategy)
  252. // 查询现货合同表信息(指定策略ID、未结束的)
  253. erms2R.GET("/QuerySpotContract", erms2.QuerySpotContract)
  254. }
  255. // ************************ 风险管理v3 ************************
  256. erms3R := apiR.Group("Erms3")
  257. erms3R.Use(token.Auth())
  258. {
  259. // 新增现货合同申请
  260. erms3R.POST("/AddSpotContractApply", erms3.AddSpotContractApply)
  261. // 查询合同申请表单数据
  262. erms3R.GET("/QuerySpotContractAppleForm", erms3.QuerySpotContractAppleForm)
  263. // 查询合同详细信息.
  264. erms3R.GET("/QuerySpotContractDetail", erms3.QuerySpotContractDetail)
  265. // 查询待审核合同
  266. erms3R.GET("/QueryPendingAuditContract", erms3.QueryPendingAuditContract)
  267. // 新增客户申请
  268. erms3R.POST("/AddUserInfoApply", erms3.AddUserInfoApply)
  269. // 修改客户申请
  270. erms3R.POST("/ModifyUserInfoApply", erms3.ModifyUserInfoApply)
  271. // 删除客户申请
  272. erms3R.GET("/DeleteUserInfoApply", erms3.DeleteUserInfoApply)
  273. // 客户申请信息查询
  274. erms3R.GET("/QueryUserInfoApplies", erms3.QueryUserInfoApplies)
  275. // 待审核业务查询
  276. erms3R.GET("/QueryPendingBusiness", erms3.QueryPendingBusiness)
  277. // 业务信息查询
  278. erms3R.GET("/QueryBusinessInfo", erms3.QueryBusinessInfo)
  279. // 客户信息查询
  280. erms3R.GET("/QueryUserInfos", erms3.QueryUserInfos)
  281. // 新增期现套利业务申请
  282. erms3R.POST("/AddErms2ASApply", erms3.AddErms2ASApply)
  283. // 新增现货贸易业务申请
  284. erms3R.POST("/AddErms2SpotTradeApply", erms3.AddErms2SpotTradeApply)
  285. }
  286. // ************************ 定制【尚志大宗】 ************************
  287. szdzR := apiR.Group("SZDZ")
  288. szdzR.Use(token.Auth())
  289. {
  290. // 点选挂牌委托单据查询(摘牌大厅)
  291. szdzR.GET("/QueryRecieptOrder", szdz.QueryRecieptOrder)
  292. // 商品提货单查询
  293. szdzR.GET("/QueryGoodsPickup", szdz.QueryGoodsPickup)
  294. // 交易系统转换流水查询
  295. szdzR.GET("/QueryConvertLog", szdz.QueryConvertLog)
  296. // 搜索白名单
  297. szdzR.GET("/SearchWhite", szdz.SearchWhite)
  298. // 查询交易系统转换设置
  299. szdzR.GET("/QueryConvertConfig", szdz.QueryConvertConfig)
  300. // 持仓汇总查询(尚志大宗)
  301. szdzR.GET("/QuerySZDZTradePosition", szdz.QuerySZDZTradePosition)
  302. }
  303. // ************************ 定制【海商报业】 ************************
  304. hsbyR := apiR.Group("HSBY")
  305. hsbyR.Use(token.AuthByHsby())
  306. {
  307. // 查询热门商品列表(二级市场,挂牌点选)
  308. hsbyR.GET("/QueryHsbyTopGoodses", hsby.QueryHsbyTopGoodses)
  309. // 查询二级市场(挂牌点选)商品信息详情
  310. hsbyR.GET("/QueryHsbyListingGoodsDetail", hsby.QueryHsbyListingGoodsDetail)
  311. // 查询二级市场(挂牌点选)商品对应的挂牌委托单信息
  312. hsbyR.GET("/QueryHsbyGoodsOrderDetails", hsby.QueryHsbyGoodsOrderDetails)
  313. // 查询“我的订单”信息
  314. hsbyR.GET("/QueryHsbyMyBuyOrderDetails", hsby.QueryHsbyMyBuyOrderDetails)
  315. // 查询“我的商品”信息
  316. hsbyR.GET("/QueryHsbyMyGoods", hsby.QueryHsbyMyGoods)
  317. // 查询新品上市商品列表(一级市场预售)
  318. hsbyR.GET("/QueryHsbyPreGoodses", hsby.QueryHsbyPreGoodses)
  319. // 查询一级市场(预售)商品信息详情
  320. hsbyR.GET("/QueryHsbyPreGoodsDetail", hsby.QueryHsbyPreGoodsDetail)
  321. // 查询"我的闲置"单据信息
  322. hsbyR.GET("/QueryHsbySellMyDetails", hsby.QueryHsbySellMyDetails)
  323. // 查询我的包裹信息
  324. hsbyR.GET("/QueryHsbyMyPackages", hsby.QueryHsbyMyPackages)
  325. // 设置我的包裹已收货状态
  326. hsbyR.POST("/SetHsbyMyPackagesStatus", hsby.SetHsbyMyPackagesStatus)
  327. // 查询省市信息(不包括区)
  328. hsbyR.GET("/QueryProvincesAndCities", hsby.QueryProvincesAndCities)
  329. // 查询"我的订单 - 已完成"单据信息
  330. hsbyR.GET("/QueryHsbyBuyMyTradeDetail", hsby.QueryHsbyBuyMyTradeDetail)
  331. // 获取我的订单与包裹数量
  332. hsbyR.GET("/GetHsbyMyCount", hsby.GetHsbyMyCount)
  333. // 获取我的订单中待付款信息
  334. hsbyR.GET("/QueryMyPayOrders", hsby.QueryMyPayOrders)
  335. // 获取我的闲置中收款信息查询
  336. hsbyR.GET("/QueryMyCollectionOrders", hsby.QueryMyCollectionOrders)
  337. // 查询海商报业相关市场信息
  338. hsbyR.GET("/QueryHsbyMarkets", hsby.QueryHsbyMarkets)
  339. // 查询游客特卖商品列表(三级商城)
  340. hsbyR.GET("/QueryHsbyVisitorMarketGoodses", hsby.QueryHsbyVisitorMarketGoodses)
  341. // 查询特卖商品列表(三级商城)
  342. hsbyR.GET("/QueryHsbyMarketGoodses", hsby.QueryHsbyMarketGoodses)
  343. // 查询游客三级市场(商城)商品信息详情
  344. hsbyR.GET("/QueryHsbyVisitorMarketGoodsDetail", hsby.QueryHsbyVisitorMarketGoodsDetail)
  345. // 查询三级市场(商城)商品信息详情
  346. hsbyR.GET("/QueryHsbyMarketGoodsDetail", hsby.QueryHsbyMarketGoodsDetail)
  347. // 我的优惠卷查询
  348. hsbyR.GET("/QueryMyCoupons", hsby.QueryMyCoupons)
  349. // 我的优惠卷持仓查询
  350. hsbyR.GET("/QueryMyCouponHolds", hsby.QueryMyCouponHolds)
  351. // 已使用优惠卷查询
  352. hsbyR.GET("/QueryMyUsedCoupon", hsby.QueryMyUsedCoupon)
  353. // 获取终端固定广告配置
  354. hsbyR.GET("/QueryClientFixedADConfigs", hsby.QueryClientFixedADConfigs)
  355. }
  356. // ***************************** 企业风险管理(app)***************************
  357. ermcpR := apiR.Group("Ermcp")
  358. ermcpR.Use(token.Auth())
  359. {
  360. // 查询待点价、履约和全部合同
  361. ermcpR.GET("/QueryUserInfo", ermcp.QueryUserInfo)
  362. ermcpR.GET("/QueryWrStandard", ermcp.QueryWrStandard)
  363. ermcpR.GET("/QueryWrStandardDetail", ermcp.QueryWrStandardDetail)
  364. ermcpR.GET("/QuerySpotContract", ermcp.QuerySpotContract)
  365. ermcpR.GET("/QueryContract", ermcp.QueryContract)
  366. ermcpR.GET("/QueryHedgePlan", ermcp.QueryHedgePlan)
  367. ermcpR.GET("/QueryBusinessDj", ermcp.QueryBusinessDj)
  368. ermcpR.GET("/QueryBusinessJs", ermcp.QueryBusinessJs)
  369. ermcpR.GET("/QueryBusinessJsEx", ermcp.QueryBusinessJsEx)
  370. ermcpR.GET("/QueryBusinessKx", ermcp.QueryBusinessKx)
  371. ermcpR.GET("/QueryBusinessFp", ermcp.QueryBusinessFp)
  372. ermcpR.GET("/QueryChangeLog", ermcp.QueryChangeLog)
  373. ermcpR.GET("/QueryRealtimeExposure", ermcp.QueryRealtimeExposure)
  374. ermcpR.GET("/QueryExposureDetail", ermcp.QueryExposureDetail)
  375. ermcpR.GET("/QueryExposureSpot", ermcp.QueryExposureSpot)
  376. ermcpR.GET("/QueryExposureSpotDetail", ermcp.QueryExposureSpotDetail)
  377. ermcpR.GET("/QueryHisExposure", ermcp.QueryHisExposure)
  378. ermcpR.GET("/QueryMiddleGoods", ermcp.QueryMiddleGoods)
  379. ermcpR.GET("/QueryMiddleGoodsDetail", ermcp.QueryMiddleGoodsDetail)
  380. ermcpR.GET("/QueryGGConvertConfig", ermcp.QueryGGConvertConfig)
  381. ermcpR.GET("/QueryMiddleGoodsChangeLog", ermcp.QueryMiddleGoodsChangeLog)
  382. ermcpR.GET("/QueryAvaildGoodsGroup", ermcp.QueryAvaildGoodsGroup)
  383. ermcpR.GET("/QueryRealtimeExposurePosition", ermcp.QueryRealtimeExposurePosition)
  384. ermcpR.GET("/QueryExposureHedgePosition", ermcp.QueryExposureHedgePosition)
  385. ermcpR.GET("/QryReportDayFinance", ermcp.QryReportDayFinance)
  386. ermcpR.GET("/QryReportDayFinanceKx", ermcp.QryReportDayFinanceKx)
  387. ermcpR.GET("/QryReportDayFinanceFp", ermcp.QryReportDayFinanceFp)
  388. ermcpR.GET("/QryReportMonthFinance", ermcp.QryReportMonthFinance)
  389. ermcpR.GET("/QryReportDaySpot", ermcp.QryReportDaySpot)
  390. ermcpR.GET("/QryReportDaySpotDetail", ermcp.QryReportDaySpotDetail)
  391. ermcpR.GET("/QryReportMonthSpot", ermcp.QryReportMonthSpot)
  392. ermcpR.GET("/QryReportMonthSpotDetail", ermcp.QryReportMonthSpotDetail)
  393. ermcpR.GET("/QryReportAreaSpotPL", ermcp.QryReportAreaSpotPL)
  394. ermcpR.GET("/QueryExposureHedgePositionDetail", ermcp.QueryExposureHedgePositionDetail)
  395. ermcpR.GET("/QueryPendingAuditInfo", ermcp.QueryPendingAuditInfo)
  396. ermcpR.GET("/QueryWarehouseInfo", ermcp.QueryWarehouseInfo)
  397. ermcpR.GET("/QueryAreaStockApply", ermcp.QueryAreaStockApply)
  398. ermcpR.GET("/QueryAreaStockApplySum", ermcp.QueryAreaStockApplySum)
  399. ermcpR.GET("/QueryAreaStock", ermcp.QueryAreaStock)
  400. ermcpR.GET("/QueryAreaStockReport", ermcp.QueryAreaStockReport)
  401. ermcpR.GET("/QueryAreaStockReportDetail", ermcp.QueryAreaStockReportDetail)
  402. ermcpR.GET("/QueryGoodsBrand", ermcp.QueryGoodsBrand)
  403. ermcpR.GET("/QueryGoodsModel", ermcp.QueryGoodsModel)
  404. ermcpR.GET("/QueryAccMgrLoginUser", ermcp.QueryAccMgrLoginUser)
  405. ermcpR.GET("/QueryAccMgrTaaccount", ermcp.QueryAccMgrTaaccount)
  406. ermcpR.GET("/QueryAccMgrMainAccountInfo", ermcp.QueryAccMgrMainAccountInfo)
  407. ermcpR.GET("/QueryAccMgrRole", ermcp.QueryAccMgrRole)
  408. ermcpR.GET("/QueryAccMgrRoleMenu", ermcp.QueryAccMgrRoleMenu)
  409. ermcpR.GET("/QueryRoleMenu", ermcp.QueryRoleMenu)
  410. ermcpR.GET("/QueryAccMgrBizGroupSet", ermcp.QueryAccMgrBizGroupSet)
  411. ermcpR.GET("/QueryAccMgrTaAccountInfo", ermcp.QueryAccMgrTaAccountInfo)
  412. ermcpR.GET("/QuerySpotGoodsPrice", ermcp.QuerySpotGoodsPrice)
  413. ermcpR.GET("/QuerySpotGoodsPriceLog", ermcp.QuerySpotGoodsPriceLog)
  414. ermcpR.GET("/QueryFuturesCompany", ermcp.QueryFuturesCompany)
  415. ermcpR.GET("/QueryTradeConfigTMP", ermcp.QueryTradeConfigTMP)
  416. ermcpR.GET("/QueryExposureGoods", ermcp.QueryExposureGoods)
  417. // 期货相关
  418. // 查询企业风管期货商品信息
  419. ermcpR.GET("/GetErmcpGoods", ermcp.GetErmcpGoods)
  420. // 查询企业风管期货主力、次主力商品信息
  421. ermcpR.GET("/GetErmcpGoodsSortByPosition", ermcp.GetErmcpGoodsSortByPosition)
  422. // 获取企业风管期货持仓头寸信息
  423. ermcpR.GET("/QueryErmcpTradePosition", ermcp.QueryErmcpTradePosition)
  424. // 获取企业风管期货内部持仓单信息
  425. ermcpR.GET("/QueryErmcpInnerHolderDetails", ermcp.QueryErmcpInnerHolderDetails)
  426. // 获取企业风管期货委托单信息
  427. ermcpR.GET("/QueryErmcpOrderDetails", ermcp.QueryErmcpOrderDetails)
  428. // 获取企业风管期货成交单信息
  429. ermcpR.GET("/QueryErmcpTradeDetails", ermcp.QueryErmcpTradeDetails)
  430. // 获取企业风管期货历史委托单信息
  431. ermcpR.GET("/QueryErmcpHisOrderDetails", ermcp.QueryErmcpHisOrderDetails)
  432. // 获取企业风管期货历史成交单信息
  433. ermcpR.GET("/QueryErmcpHisTradeDetails", ermcp.QueryErmcpHisTradeDetails)
  434. // 权限相关
  435. // 获取企业风管终端权限
  436. ermcpR.GET("/GetErmcpRoleFuncMenuLists", ermcp.GetErmcpRoleFuncMenuLists)
  437. // 获取目标登录账号当前对冲账号在线状态
  438. ermcpR.GET("/GetErmcpOutAccountStatus", ermcp.GetErmcpOutAccountStatus)
  439. }
  440. // ***************************** 企业风险管理v3(app)***************************
  441. ermcp3R := apiR.Group("Ermcp3")
  442. ermcp3R.Use(token.Auth())
  443. {
  444. ermcp3R.GET("/QueryDeliveryGoods", ermcp3.QueryDeliveryGoods)
  445. ermcp3R.GET("/QueryDeliveryGoodsDetail", ermcp3.QueryDeliveryGoodsDetail)
  446. ermcp3R.GET("/QuerySpotContract", ermcp3.QuerySpotContract)
  447. ermcp3R.GET("/QuerySpotContractBS", ermcp3.QuerySpotContractBS)
  448. ermcp3R.GET("/QueryExposureDetail", ermcp3.QueryExposureDetail)
  449. ermcp3R.GET("/QueryExposureSpot", ermcp3.QueryExposureSpot)
  450. ermcp3R.GET("/QueryExposureSpotDetail", ermcp3.QueryExposureSpotDetail)
  451. ermcp3R.GET("/QueryDGFactoryItem", ermcp3.QueryDGFactoryItem)
  452. ermcp3R.GET("/QueryGoodsbrand", ermcp3.QueryGoodsbrand)
  453. ermcp3R.GET("/QueryGoodsWrstandard", ermcp3.QueryGoodsWrstandard)
  454. ermcp3R.GET("/QueryAreaStockApply", ermcp3.QueryAreaStockApply)
  455. ermcp3R.GET("/QueryAreaStock", ermcp3.QueryAreaStock)
  456. ermcp3R.GET("/QueryAreaStockApplySum", ermcp3.QueryAreaStockApplySum)
  457. ermcp3R.GET("/QueryAreaStockReportDetail", ermcp3.QueryAreaStockReportDetail)
  458. ermcp3R.GET("/QuerySpotGoodsPrice", ermcp3.QuerySpotGoodsPrice)
  459. ermcp3R.GET("/QuerySpotGoodsPriceLog", ermcp3.QuerySpotGoodsPriceLog)
  460. ermcp3R.GET("/QueryHedgePlan", ermcp3.QueryHedgePlan)
  461. ermcp3R.GET("/QueryGoodsGroup", ermcp3.QueryGoodsGroup)
  462. ermcp3R.GET("/QueryMiddleGoodsDetail", ermcp3.QueryMiddleGoodsDetail)
  463. ermcp3R.GET("/QueryRootUserAccount", ermcp3.QueryRootUserAccount)
  464. ermcp3R.GET("/QueryPaAreaSubject", ermcp3.QueryPaAreaSubject)
  465. ermcp3R.GET("/QueryPaAreaAuditCfg", ermcp3.QueryPaAreaAuditCfg)
  466. ermcp3R.GET("/QueryPaTradeLink", ermcp3.QueryPaTradeLink)
  467. ermcp3R.GET("/QuerySCMiddleGoods", ermcp3.QuerySCMiddleGoods)
  468. ermcp3R.GET("/QueryHPMiddleGoods", ermcp3.QueryHPMiddleGoods)
  469. ermcp3R.GET("/QueryPaTradeLinkDetail", ermcp3.QueryPaTradeLinkDetail)
  470. ermcp3R.GET("/QueryOutTradeLink", ermcp3.QueryOutTradeLink)
  471. ermcp3R.GET("/QuerySubTaaccount", ermcp3.QuerySubTaaccount)
  472. ermcp3R.GET("/QueryInnerTradeLink", ermcp3.QueryInnerTradeLink)
  473. ermcp3R.GET("/QueryParamChangeApp", ermcp3.QueryParamChangeApp)
  474. ermcp3R.GET("/QueryErmcp3ContractMiddleGoodsCfg", ermcp3.QueryErmcp3ContractMiddleGoodsCfg)
  475. // 报表
  476. ermcp3R.GET("/QryReportDaySpotDetail", ermcp3.QryReportDaySpotDetail)
  477. ermcp3R.GET("/QryReportDayFinanceKx", ermcp3.QryReportDayFinanceKx)
  478. ermcp3R.GET("/QryReportDayFinanceFp", ermcp3.QryReportDayFinanceFp)
  479. ermcp3R.GET("/QryReportDaySpot", ermcp3.QryReportDaySpot)
  480. ermcp3R.GET("/QryReportMonthSpot", ermcp3.QryReportMonthSpot)
  481. ermcp3R.GET("/QryReportMonthSpotDetail", ermcp3.QryReportMonthSpotDetail)
  482. ermcp3R.GET("/QryAreaSpotplReport", ermcp3.QryAreaSpotplReport)
  483. ermcp3R.GET("/QryAreaExpourseReport", ermcp3.QryAreaExpourseReport)
  484. ermcp3R.GET("/QryAreaExpourseContractDetail", ermcp3.QryAreaExpourseContractDetail)
  485. ermcp3R.GET("/QryAreaExpourseHedgeplanDetail", ermcp3.QryAreaExpourseHedgeplanDetail)
  486. ermcp3R.GET("/QryAreaExpourseFutuDetail", ermcp3.QryAreaExpourseFutuDetail)
  487. ermcp3R.GET("/QryAreaExpourseParamChLogDetail", ermcp3.QryAreaExpourseParamChLogDetail)
  488. ermcp3R.GET("/QryAreaStockReport", ermcp3.QryAreaStockReport)
  489. ermcp3R.GET("/QryFinanceReport", ermcp3.QryFinanceReport)
  490. ermcp3R.GET("/QryAreaSumPL", ermcp3.QryAreaSumPL)
  491. ermcp3R.GET("/QryTaFutureDataReport", ermcp3.QryTaFutureDataReport)
  492. ermcp3R.GET("/QrySCMiddleGoodsReport", ermcp3.QrySCMiddleGoodsReport)
  493. }
  494. // ***************************** 企业风险管理v8 ***************************
  495. ermcp8R := apiR.Group("Ermcp8")
  496. ermcp8R.Use(token.Auth())
  497. {
  498. ermcp8R.GET("/QueryErmcp2HedgedItem", ermcp8.QueryErmcp2HedgedItem)
  499. ermcp8R.GET("/QueryERMCPJRLinkPos", ermcp8.QueryERMCPJRLinkPos)
  500. ermcp8R.GET("/QueryERMCP2HedgedItemspot", ermcp8.QueryERMCP2HedgedItemspot)
  501. ermcp8R.GET("/QueryERMCP2HedgedItemSpotDetail", ermcp8.QueryERMCP2HedgedItemSpotDetail)
  502. ermcp8R.GET("/QueryERMCPPatradeLinkDetail", ermcp8.QueryERMCPPatradeLinkDetail)
  503. ermcp8R.GET("/QueryInternalUncorrelatedTradeDetail", ermcp8.QueryInternalUncorrelatedTradeDetail)
  504. ermcp8R.GET("/QueryInternalEnableTradeDetail", ermcp8.QueryInternalEnableTradeDetail)
  505. ermcp8R.GET("/QueryErmcp8HedgeditemReport", ermcp8.QueryErmcp8HedgeditemReport)
  506. ermcp8R.GET("/QueryUnLinkSpotContract", ermcp8.QueryUnLinkSpotContract)
  507. ermcp8R.GET("/QueryErmcp8EnableHedgeditem", ermcp8.QueryErmcp8EnableHedgeditem)
  508. ermcp8R.GET("/QueryErmcp8RunningHedgeditem", ermcp8.QueryErmcp8RunningHedgeditem)
  509. ermcp8R.GET("/QueryErmcp2AreaExposure", ermcp8.QueryErmcp2AreaExposure)
  510. ermcp8R.GET("/QueryErmcp2StockSpotChangeLog", ermcp8.QueryErmcp2StockSpotChangeLog)
  511. ermcp8R.GET("/QueryErmcp2HedgedItemsDetail", ermcp8.QueryErmcp2HedgedItemsDetail)
  512. ermcp8R.GET("/QueryPatradeLinkDetail", ermcp8.QueryPatradeLinkDetail)
  513. ermcp8R.GET("/QueryUnLinkErmcpHedgePlan", ermcp8.QueryUnLinkErmcpHedgePlan)
  514. ermcp8R.GET("/QueryErmcp2HedgedItemLink", ermcp8.QueryErmcp2HedgedItemLink)
  515. ermcp8R.GET("/QueryMarketCalendar", ermcp8.QueryMarketCalendar)
  516. }
  517. // ****************************大连千海金******************************
  518. qhjR := apiR.Group("Qhj")
  519. qhjR.Use()
  520. {
  521. qhjR.GET("QuerySiteColumnDetail", qhj.QuerySiteColumnDetail)
  522. qhjR.Use(token.Auth()).GET("QueryContract", qhj.QueryContract)
  523. qhjR.Use(token.Auth()).GET("QueryContractLog", qhj.QueryContractLog)
  524. qhjR.Use(token.Auth()).GET("QueryRStrategy", qhj.QueryRStrategy)
  525. qhjR.Use(token.Auth()).GET("QueryRSTriggerLog", qhj.QueryRSTriggerLog)
  526. qhjR.Use(token.Auth()).GET("QueryUserReceiveInfo", qhj.QueryUserReceiveInfo)
  527. qhjR.Use(token.Auth()).GET("QueryUserCollectConfig", qhj.QueryUserCollectConfig)
  528. qhjR.Use(token.Auth()).GET("QueryTradeGoodsPickup", qhj.QueryTradeGoodsPickup)
  529. qhjR.Use(token.Auth()).GET("QueryBankAccountSign", qhj.QueryBankAccountSign)
  530. qhjR.Use(token.Auth()).GET("QueryPickGoods", qhj.QueryPickGoods)
  531. qhjR.Use(token.Auth()).GET("QueryPickArea", qhj.QueryPickArea)
  532. qhjR.Use(token.Auth()).GET("QueryBankInfo", qhj.QueryBankInfo)
  533. qhjR.Use(token.Auth()).GET("QueryReckonPriceLog", qhj.QueryReckonPriceLog)
  534. qhjR.Use(token.Auth()).GET("QueryCustomerInfo", qhj.QueryCustomerInfo)
  535. qhjR.Use(token.Auth()).GET("QueryCusBankSignBank", qhj.QueryCusBankSignBank)
  536. qhjR.Use(token.Auth()).GET("QueryAccountInOutApply", qhj.QueryAccountInOutApply)
  537. qhjR.Use(token.Auth()).GET("QueryPayOrder", qhj.QueryPayOrder)
  538. qhjR.Use(token.Auth()).GET("QueryGoodsEx", qhj.QueryGoodsEx)
  539. qhjR.Use(token.Auth()).GET("QueryParentAreaList", qhj.QueryParentAreaList)
  540. qhjR.Use(token.Auth()).GET("QueryAreaFinanceConfig", qhj.QueryAreaFinanceConfig)
  541. qhjR.Use(token.Auth()).GET("QueryMyTeam", qhj.QueryMyTeam)
  542. qhjR.Use(token.Auth()).GET("QueryMyTeamOrder", qhj.QueryTeamOrder)
  543. qhjR.Use(token.Auth()).GET("QueryBrokerRewardLog", qhj.QueryBrokerRewardLog)
  544. qhjR.Use(token.Auth()).GET("QueryScoreLog", qhj.QueryScoreLog)
  545. qhjR.Use(token.Auth()).GET("QueryBrokerApply", qhj.QueryBrokerApply)
  546. qhjR.Use(token.Auth()).GET("QueryBrokerApplyEx", qhj.QueryBrokerApplyEx)
  547. }
  548. // *************************千海金(PCWeb)*****************************
  549. qhjPCWebR := apiR.Group("QhjMgr")
  550. qhjPCWebR.Use(token.Auth())
  551. {
  552. qhjPCWebR.GET("QuerySubArea", qhjPCWeb.QuerySubArea)
  553. qhjPCWebR.GET("QueryCustomerInfo", qhjPCWeb.QueryCustomerInfo)
  554. qhjPCWebR.GET("QueryAccountInOutApply", qhjPCWeb.QueryAccountInOutApply)
  555. qhjPCWebR.GET("QueryTradePosition", qhjPCWeb.QueryTradePosition)
  556. qhjPCWebR.GET("QueryTradeDetail", qhjPCWeb.QueryTradeDetail)
  557. qhjPCWebR.GET("QueryTradeOrderDetail", qhjPCWeb.QueryTradeOrderDetail)
  558. qhjPCWebR.GET("QueryTradePayOrder", qhjPCWeb.QueryTradePayOrder)
  559. qhjPCWebR.GET("QueryContract", qhjPCWeb.QueryContract)
  560. qhjPCWebR.GET("QueryPickGoods", qhjPCWeb.QueryPickGoods)
  561. qhjPCWebR.GET("QueryBrokerApply", qhjPCWeb.QueryBrokerApply)
  562. qhjPCWebR.GET("QueryBrokerRewardReport", qhjPCWeb.QueryBrokerRewardReport)
  563. }
  564. // **********************千海金(协议和签约)**************************
  565. qhjAgreementR := apiR.Group("QhjSys")
  566. {
  567. qhjAgreementR.GET("QueryAgreementConfig", qhj.QueryAgreementConfig)
  568. qhjAgreementR.GET("QueryAgreementChangeLog", qhj.QueryAgreementChangeLog)
  569. qhjAgreementR.GET("QueryNodeAgreementConfig", qhj.QueryNodeAgreementConfig)
  570. qhjAgreementR.GET("QueryCustomerSignStatus", qhj.QueryCustomerSignStatus)
  571. qhjAgreementR.GET("QueryQhjCustomerSignLog", qhj.QueryQhjCustomerSignLog)
  572. qhjAgreementR.GET("QueryUserNodeCfgAndStatus", qhj.QueryUserNodeCfgAndStatus)
  573. }
  574. // **************************仓单贸易v2(仓单优化)********************
  575. wrTrade2R := apiR.Group("WrTrade2")
  576. wrTrade2R.Use()
  577. {
  578. wrTrade2R.GET("QuerySiteColumnConfig", wrTrade2.QuerySiteColumnConfig)
  579. wrTrade2R.GET("QuerySiteColumnDetail", wrTrade2.QuerySiteColumnDetail)
  580. wrTrade2R.Use(token.Auth()).GET("QueryOrderQuote", wrTrade2.QueryOrderQuote)
  581. wrTrade2R.Use(token.Auth()).GET("QueryOrderQuoteDetail", wrTrade2.QueryOrderQuoteDetail)
  582. wrTrade2R.Use(token.Auth()).GET("QueryWrPosition", wrTrade2.QueryWrPosition)
  583. wrTrade2R.Use(token.Auth()).GET("QueryWrOrderDetail", wrTrade2.QueryWrOrderDetail)
  584. wrTrade2R.Use(token.Auth()).GET("QueryWrTradeDetail", wrTrade2.QueryWrTradeDetail)
  585. wrTrade2R.Use(token.Auth()).GET("QueryWrSpecialMatchOrder", wrTrade2.QueryWrSpecialMatchOrder)
  586. wrTrade2R.Use(token.Auth()).GET("QueryWrGoodsInfo", wrTrade2.QueryWrGoodsInfo)
  587. wrTrade2R.Use(token.Auth()).GET("QueryPerformancePlan", wrTrade2.QueryPerformancePlan)
  588. wrTrade2R.Use(token.Auth()).GET("QueryHoldLB", wrTrade2.QueryHoldLB)
  589. wrTrade2R.Use(token.Auth()).GET("QueryFilterItem", wrTrade2.QueryFilterItem)
  590. wrTrade2R.Use(token.Auth()).GET("QueryFaProductDetail", wrTrade2.QueryFaProductDetail)
  591. wrTrade2R.Use(token.Auth()).GET("QueryWrFactorTypeInfo", wrTrade2.QueryWrFactorTypeInfo)
  592. wrTrade2R.Use(token.Auth()).GET("QueryWrFactorTypeInfoEx", wrTrade2.QueryWrFactorTypeInfoEx)
  593. wrTrade2R.Use(token.Auth()).GET("QueryWrMarketTradeConfig", wrTrade2.QueryWrMarketTradeConfig)
  594. wrTrade2R.Use(token.Auth()).GET("QueryFtDeliveryGoods", wrTrade2.QueryFtDeliveryGoods)
  595. wrTrade2R.Use(token.Auth()).GET("QueryWrStandardFactoryItem", wrTrade2.QueryWrStandardFactoryItem)
  596. wrTrade2R.Use(token.Auth()).GET("QueryWrPerformancePlanStep", wrTrade2.QueryWrPerformancePlanStep)
  597. wrTrade2R.Use(token.Auth()).GET("QueryWrFinanceBuyApply", wrTrade2.QueryWrFinanceBuyApply)
  598. wrTrade2R.Use(token.Auth()).GET("QueryWrScfContract", wrTrade2.QueryWrScfContract)
  599. wrTrade2R.Use(token.Auth()).GET("QueryWrBuybackDetail", wrTrade2.QueryWrBuybackDetail)
  600. wrTrade2R.Use(token.Auth()).GET("QueryWrScfContractInterest", wrTrade2.QueryWrScfContractInterest)
  601. wrTrade2R.Use(token.Auth()).GET("QueryWrOutInApply", wrTrade2.QueryWrOutInApply)
  602. wrTrade2R.Use(token.Auth()).GET("QueryWrDeliveryDetail", wrTrade2.QueryWrDeliveryDetail)
  603. wrTrade2R.Use(token.Auth()).GET("QueryWrBsGoodsInfo", wrTrade2.QueryWrBsGoodsInfo)
  604. wrTrade2R.Use(token.Auth()).GET("QueryWrTradeOrderDetail", wrTrade2.QueryWrTradeOrderDetail)
  605. wrTrade2R.Use(token.Auth()).GET("QueryWrAverageTradePrice", wrTrade2.QueryWrAverageTradePrice)
  606. wrTrade2R.Use(token.Auth()).GET("QueryOrderQuoteMyq", wrTrade2.QueryOrderQuoteMyq)
  607. wrTrade2R.Use(token.Auth()).GET("QueryWrDeliveryAvalidHoldLB", wrTrade2.QueryWrDeliveryAvalidHoldLB)
  608. wrTrade2R.Use(token.Auth()).GET("QueryWrUserFriend", wrTrade2.QueryWrUserFriend)
  609. wrTrade2R.Use(token.Auth()).GET("QueryWrFriendApply", wrTrade2.QueryWrFriendApply)
  610. wrTrade2R.Use(token.Auth()).GET("QueryPermancePlanTmp", wrTrade2.QueryPermancePlanTmp)
  611. wrTrade2R.Use(token.Auth()).GET("QueryWrTradeBargainApply", wrTrade2.QueryWrTradeBargainApply)
  612. wrTrade2R.Use(token.Auth()).GET("QueryWrPerformanceStepType", wrTrade2.QueryWrPerformanceStepType)
  613. wrTrade2R.Use(token.Auth()).GET("QueryWrUserReceiptInfo", wrTrade2.QueryWrUserReceiptInfo)
  614. wrTrade2R.Use(token.Auth()).GET("QueryDeliveryGoodsSection", wrTrade2.QueryDeliveryGoodsSection)
  615. wrTrade2R.Use(token.Auth()).GET("QuerySpotGroupTradeSum", wrTrade2.QuerySpotGroupTradeSum)
  616. wrTrade2R.Use(token.Auth()).GET("QuerySpotGroupTradeSumDetail", wrTrade2.QuerySpotGroupTradeSumDetail)
  617. wrTrade2R.Use(token.Auth()).GET("QueryWrPreSaleInfo", wrTrade2.QueryWrPreSaleInfo)
  618. wrTrade2R.Use(token.Auth()).GET("QueryWrReckonSpotGoodsTradeSum", wrTrade2.QueryWrReckonSpotGoodsTradeSum)
  619. wrTrade2R.Use(token.Auth()).GET("QueryWrSearchUser", wrTrade2.QueryWrSearchUser)
  620. wrTrade2R.Use(token.Auth()).GET("QueryWrDraftUserInfo", wrTrade2.QueryWrDraftUserInfo)
  621. wrTrade2R.Use(token.Auth()).GET("QueryWrBrandAndYears", wrTrade2.QueryWrBrandAndYears)
  622. wrTrade2R.Use(token.Auth()).GET("QueryWrClientAdSpaceConfig", wrTrade2.QueryWrClientAdSpaceConfig)
  623. wrTrade2R.Use(token.Auth()).GET("QueryXhcpSellBackApply", wrTrade2.QueryXhcpSellBackApply)
  624. wrTrade2R.Use(token.Auth()).POST("InsertXhcpSellBackApply", wrTrade2.InsertXhcpSellBackApply)
  625. wrTrade2R.Use(token.Auth()).GET("QueryWrTradeQuote", wrTrade2.QueryWrTradeQuote)
  626. }
  627. // **************************天津麦顿*************************
  628. tjmdR := apiR.Group("Tjmd")
  629. tjmdR.Use(token.Auth())
  630. {
  631. tjmdR.GET("QueryQuoteGoodsList", tjmd.QueryQuoteGoodsList)
  632. tjmdR.GET("QueryTjmdTradeOrderDetail", tjmd.QueryTjmdTradeOrderDetail)
  633. tjmdR.GET("QueryTjmdTransferApply", tjmd.QueryTjmdTransferApply)
  634. tjmdR.GET("QueryTjmdTodayAccountMargin", tjmd.QueryTjmdTodayAccountMargin)
  635. tjmdR.GET("QueryTjmdMarketSection", tjmd.QueryTjmdMarketSection)
  636. tjmdR.GET("QueryTjmdHolderDetailTradeInfo", tjmd.QueryTjmdHolderDetailTradeInfo)
  637. }
  638. // **************************中江*************************
  639. zjR := apiR.Group("ZJ")
  640. zjR.Use()
  641. {
  642. zjR.GET("GetBankTip", zj.GetBankTip)
  643. zjR.GET("GetCusBankChannels", zj.GetCusBankChannels)
  644. }
  645. // **************************广钻*************************
  646. guangzuanR := apiR.Group("Guangzuan")
  647. guangzuanR.Use(token.Auth())
  648. {
  649. guangzuanR.GET("QueryWarehouseInfo", guangzuan.QueryWarehouseInfo)
  650. guangzuanR.GET("QueryMyWRPosition", guangzuan.QueryMyWRPosition)
  651. guangzuanR.GET("QueryBuyOrder", guangzuan.QueryBuyOrder)
  652. guangzuanR.GET("QuerySellOrder", guangzuan.QuerySellOrder)
  653. guangzuanR.POST("QueryDiamond", guangzuan.QueryDiamond)
  654. guangzuanR.GET("QueryMyBuyOrder", guangzuan.QueryMyBuyOrder)
  655. guangzuanR.GET("QueryMySellOrder", guangzuan.QueryMySellOrder)
  656. guangzuanR.GET("QueryMyDeListing", guangzuan.QueryMyDeListing)
  657. guangzuanR.GET("QueryMyBargainApply", guangzuan.QueryMyBargainApply)
  658. guangzuanR.GET("QueryMyDelistingApply", guangzuan.QueryMyDelistingApply)
  659. guangzuanR.GET("GetGoods", guangzuan.GetGoods)
  660. guangzuanR.GET("QueryMyPerformanc", guangzuan.QueryMyPerformanc)
  661. guangzuanR.GET("QueryMyFavorite", guangzuan.QueryMyFavorite)
  662. guangzuanR.GET("PriceCalc", guangzuan.PriceCalc)
  663. guangzuanR.GET("GzCertAddressConfig", guangzuan.GzCertAddressConfig)
  664. guangzuanR.GET("GzCertAddressParam", guangzuan.GzCertAddressParam)
  665. guangzuanR.GET("HomeData", guangzuan.HomeData)
  666. guangzuanR.GET("QueryGZCJJCOrder", guangzuan.QueryGZCJJCOrder)
  667. guangzuanR.GET("QueryGZCJJCOrderDetail", guangzuan.QueryGZCJJCOrderDetail)
  668. guangzuanR.GET("QueryGZCJBSOrderFile", guangzuan.QueryGZCJBSOrderFile)
  669. guangzuanR.GET("QueryGZBSFWOrder", guangzuan.QueryGZBSFWOrder)
  670. guangzuanR.GET("QueryGZBSFWOrderDetail", guangzuan.QueryGZBSFWOrderDetail)
  671. guangzuanR.GET("GZBSFWOrderOperate", guangzuan.GZBSFWOrderOperate)
  672. guangzuanR.GET("QueryMemberReport", guangzuan.QueryMemberReport)
  673. guangzuanR.GET("QueryWRPositionReport", guangzuan.QueryWRPositionReport)
  674. guangzuanR.GET("QueryTradeReport", guangzuan.QueryTradeReport)
  675. guangzuanR.GET("QueryGzcjjcorderoperate", guangzuan.QueryGzcjjcorderoperate)
  676. guangzuanR.GET("QueryFworderoperate", guangzuan.QueryFworderoperate)
  677. guangzuanR.GET("QueryGzbscinOutOrder", guangzuan.QueryGzbscinOutOrder)
  678. guangzuanR.GET("QueryBScinOutOrderDetail", guangzuan.QueryBScinOutOrderDetail)
  679. guangzuanR.GET("QueryBScOutOrderDetailatt", guangzuan.QueryBScOutOrderDetailatt)
  680. guangzuanR.GET("QueryGzbscPosition", guangzuan.QueryGzbscPosition)
  681. guangzuanR.GET("QueryGzbscusermonthpay", guangzuan.QueryGzbscusermonthpay)
  682. guangzuanR.GET("QueryGzbscuserpowerfee", guangzuan.QueryGzbscuserpowerfee)
  683. guangzuanR.GET("QueryBscinoutorder", guangzuan.QueryBscinoutorder)
  684. guangzuanR.GET("GetGZBSCGoods", guangzuan.GetGZBSCGoods)
  685. guangzuanR.GET("GetGZMemberInfo", guangzuan.GetGZMemberInfo)
  686. guangzuanR.GET("QueryGZPreSell", guangzuan.QueryGZPreSell)
  687. guangzuanR.GET("QueryGZMyPresell", guangzuan.QueryGZMyPresell)
  688. guangzuanR.GET("QueryGZMyTradingPreSell", guangzuan.QueryGZMyTradingPreSell)
  689. guangzuanR.GET("QueryGZWrPreSaleApply", guangzuan.QueryGZWrPreSaleApply)
  690. guangzuanR.GET("QueryPresaleorderapplyprice", guangzuan.QueryPresaleorderapplyprice)
  691. guangzuanR.GET("QueryGzbscreckonorder", guangzuan.QueryGzbscreckonorder)
  692. }
  693. // **************************上海铁合金*************************
  694. ferroalloyR := apiR.Group("Ferroalloy")
  695. ferroalloyR.Use()
  696. {
  697. ferroalloyR.Use().GET("QueryMyRegisterMoney", ferroalloy.QueryMyRegisterMoney)
  698. ferroalloyR.Use().GET("QueryThjSpotQuoteConfig", ferroalloy.QueryThjSpotQuoteConfig)
  699. ferroalloyR.Use().GET("QueryThjSpotQuote", ferroalloy.QueryThjSpotQuote)
  700. ferroalloyR.Use(token.Auth()).GET("GetSpotGoodsPrice", ferroalloy.GetSpotGoodsPrice)
  701. ferroalloyR.Use(token.Auth()).POST("Signin", ferroalloy.Signin)
  702. ferroalloyR.Use(token.Auth()).GET("QueryMyRefer", ferroalloy.QueryMyRefer)
  703. ferroalloyR.Use(token.Auth()).GET("QueryUserScoreLog", ferroalloy.QueryUserScoreLog)
  704. ferroalloyR.Use(token.Auth()).GET("QueryTHJWrstandard", ferroalloy.QueryTHJWrstandard)
  705. ferroalloyR.Use(token.Auth()).GET("QueryTHJListing", ferroalloy.QueryTHJListing)
  706. ferroalloyR.Use(token.Auth()).GET("QueryTHJWrstandardDetail", ferroalloy.QueryTHJWrstandardDetail)
  707. ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTradeDetail", ferroalloy.QueryTHJPurchaseTradeDetail)
  708. ferroalloyR.Use(token.Auth()).GET("QueryTHJScoreConfig", ferroalloy.QueryTHJScoreConfig)
  709. ferroalloyR.Use(token.Auth()).GET("QueryTHJProduct", ferroalloy.QueryTHJProduct)
  710. ferroalloyR.Use(token.Auth()).GET("QueryTHJTradeData", ferroalloy.QueryTHJTradeData)
  711. ferroalloyR.Use(token.Auth()).GET("QueryTHJGoodsDetail", ferroalloy.QueryTHJGoodsDetail)
  712. ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransfer", ferroalloy.QueryTHJPurchaseTransfer)
  713. ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransferDetail", ferroalloy.QueryTHJPurchaseTransferDetail)
  714. ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransferOrder", ferroalloy.QueryTHJPurchaseTransferOrder)
  715. ferroalloyR.Use(token.Auth()).GET("QueryTHJPromotionIncome", ferroalloy.QueryTHJPromotionIncome)
  716. ferroalloyR.Use(token.Auth()).GET("QueryTHJPromotionIncomeDetail", ferroalloy.QueryTHJPromotionIncomeDetail)
  717. ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransferOrderDetail", ferroalloy.QueryTHJPurchaseTransferOrderDetail)
  718. ferroalloyR.Use(token.Auth()).GET("QueryUserLevelInfo", ferroalloy.QueryUserLevelInfo)
  719. ferroalloyR.Use(token.Auth()).GET("QuerySpotgoodsPrice", ferroalloy.QuerySpotgoodsPrice)
  720. ferroalloyR.Use(token.Auth()).GET("QueryInvestorLevelGroup", ferroalloy.QueryInvestorLevelGroup)
  721. ferroalloyR.Use(token.Auth()).GET("QueryTHJFriends", ferroalloy.QueryTHJFriends)
  722. ferroalloyR.Use(token.Auth()).GET("QueryTHJProfits", ferroalloy.QueryTHJProfits)
  723. ferroalloyR.Use(token.Auth()).GET("QueryTHJinvesotrdeposit", ferroalloy.QueryTHJinvesotrdeposit)
  724. ferroalloyR.Use(token.Auth()).GET("QueryMyDeposit", ferroalloy.QueryMyDeposit)
  725. ferroalloyR.Use(token.Auth()).GET("QueryTHJInvesotrDepositLog", ferroalloy.QueryTHJInvesotrDepositLog)
  726. }
  727. // **************************华南石化*************************
  728. // hnshR := apiR.Group("Hnsh")
  729. // hnshR.Use()
  730. // {
  731. // hnshR.Use(token.Auth()).GET("QueryPresaleGoods", hnsh.QueryPresaleGoods)
  732. // }
  733. // ************************** 预售 *************************
  734. presaleR := apiR.Group("Presale")
  735. presaleR.Use()
  736. {
  737. presaleR.Use(token.Auth()).GET("QueryPresaleAuctions", presale.QueryPresaleAuctions)
  738. presaleR.Use(token.Auth()).GET("QueryPresaleDefault", presale.QueryPresaleDefault)
  739. }
  740. mineR := apiR.Group("Mine")
  741. mineR.Use()
  742. {
  743. mineR.Use(token.Auth()).GET("QueryMineCpTradePreSaleResults", mine.QueryMineCpTradePreSaleResults)
  744. mineR.Use(token.Auth()).GET("QueryMineTradePositionExs", mine.QueryMineTradePositionExs)
  745. mineR.Use(token.Auth()).GET("QueryMineTradeOrderDetails", mine.QueryMineTradeOrderDetails)
  746. mineR.Use(token.Auth()).GET("QueryMineTradeOrders", mine.QueryMineTradeOrders)
  747. mineR.Use(token.Auth()).GET("QueryMineTradeTradeDetails", mine.QueryMineTradeTradeDetails)
  748. mineR.Use(token.Auth()).GET("QueryMineTradeGoodsDeliveryOfflines", mine.QueryMineTradeGoodsDeliveryOfflines)
  749. }
  750. // ************************* 水贝亿爵 *************************
  751. sbyjR := apiR.Group("sbyj")
  752. sbyjR.Use()
  753. {
  754. sbyjR.Use().GET("GetTouristGoods", sbyj.GetTouristGoods)
  755. sbyjR.Use(token.Auth()).GET("GetMyOrders", sbyj.GetMyOrders)
  756. }
  757. return r
  758. }
  759. func ginLoggerMiddleware() gin.HandlerFunc {
  760. return func(c *gin.Context) {
  761. start := time.Now()
  762. c.Next()
  763. end := time.Now()
  764. latency := end.Sub(start)
  765. path := c.Request.URL.RequestURI()
  766. clientip := c.ClientIP()
  767. method := c.Request.Method
  768. statuscode := c.Writer.Status()
  769. logger.GetLogger().Debugf("|%3d|%13v|%15s|%s %s",
  770. statuscode,
  771. latency,
  772. clientip,
  773. method,
  774. path)
  775. }
  776. }
  777. func ginRecoveryMiddleware() gin.HandlerFunc {
  778. return gin.RecoveryWithWriter(logger.GetLogWriter())
  779. }
  780. // CORSMiddleware cors跨域.
  781. func CORSMiddleware() gin.HandlerFunc {
  782. return func(c *gin.Context) {
  783. c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
  784. c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
  785. // c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With, X-session-Token")
  786. c.Writer.Header().Set("Access-Control-Allow-Headers", "*")
  787. c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT, DELETE")
  788. c.Writer.Header().Set("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type, X-session-Token")
  789. if c.Request.Method == "OPTIONS" {
  790. c.AbortWithStatus(http.StatusNoContent)
  791. return
  792. }
  793. c.Next()
  794. }
  795. }