router.go 47 KB

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