router.go 41 KB

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