router.go 46 KB

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