router.go 49 KB

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