router.go 40 KB

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