router.go 44 KB

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