router.go 50 KB

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