router.go 42 KB

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