router.go 35 KB

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