package routers import ( "mtp2_if/config" "mtp2_if/controllers/cfg" "mtp2_if/controllers/common" "mtp2_if/controllers/cptrade" "mtp2_if/controllers/delivery" "mtp2_if/controllers/ermcp" "mtp2_if/controllers/ermcp3" "mtp2_if/controllers/erms2" "mtp2_if/controllers/erms3" "mtp2_if/controllers/hsby" "mtp2_if/controllers/market" "mtp2_if/controllers/order" "mtp2_if/controllers/qhj" "mtp2_if/controllers/qhjPCWeb" "mtp2_if/controllers/quote" "mtp2_if/controllers/search" "mtp2_if/controllers/szdz" "mtp2_if/controllers/taaccount" "mtp2_if/controllers/tjmd" "mtp2_if/controllers/trade" "mtp2_if/controllers/tradexx" "mtp2_if/controllers/user" "mtp2_if/controllers/wrTrade2" "mtp2_if/controllers/wrtrade" "mtp2_if/controllers/zj" "mtp2_if/logger" "mtp2_if/token" "net/http" "time" "github.com/gin-gonic/gin" // Swagger生成的文档 _ "mtp2_if/docs" ginSwagger "github.com/swaggo/gin-swagger" "github.com/swaggo/gin-swagger/swaggerFiles" ) // InitRouter 初始化路由器的方法 func InitRouter() *gin.Engine { r := gin.New() // 设置日志中间件 r.Use(ginLoggerMiddleware()) // 设置奔溃中间件 r.Use(ginRecoveryMiddleware()) // 跨域 r.Use(CORSMiddleware()) // Swagger if config.SerCfg.GetDebugMode() { r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) } // 终端配置 r.GET("/cfg", cfg.QueryCfg) // 主业务路由分组 apiR := r.Group("/api") // apiR.Use(token.Auth()) // ************************ 账户信息 ************************ userR := apiR.Group("User") userR.Use() { // 获取登录ID userR.GET("/GetLoginID", user.GetLoginID) // 获取用户邀请码请求参数 userR.GET("/QueryUserReferNum", user.QueryUserReferNum) // 获取用户信息请求参数 userR.Use(token.Auth()).GET("/QueryUserInfo", user.QueryUserInfo) // 获取用户实名认证状态 userR.Use(token.Auth()).GET("/GetUserAuthStatus", user.GetUserAuthStatus) // 获取用户商品收藏信息 userR.Use(token.Auth()).GET("/QueryUserFavoriteGoodses", user.QueryUserFavoriteGoodses) // 添加用户商品收藏信息 userR.Use(token.Auth()).POST("/AddUserFavoriteGoods", user.AddUserFavoriteGoods) // 移除用户商品收藏信息 userR.Use(token.Auth()).POST("/RemoveUserFavoriteGoods", user.RemoveUserFavoriteGoods) // 获取用户留言板信息 userR.Use(token.Auth()).GET("/QueryMessageBoard", user.QueryMessageBoard) // 添加用户留言板信息 userR.Use(token.Auth()).POST("/AddMessageBoard", user.AddMessageBoard) // 获取用户账号信息 userR.Use(token.Auth()).GET("/GetUserAccount", user.GetUserAccount) // 更新用户状态 userR.Use(token.Auth()).POST("/UpdateUserAccountStatus", user.UpdateUserAccountStatus) // 账户登录后信息查询 userR.Use(token.Auth()).GET("/LoginQuery", user.LoginQuery) } // ************************ 资金账户 ************************ taAccountR := apiR.Group("TaAccount") taAccountR.Use(token.Auth()) { // 获取资金账户信息 taAccountR.GET("/GetTaAccounts", taaccount.GetTaAccounts) // 资金流水查询(当前) taAccountR.GET("/QueryAmountLog", taaccount.QueryAmountLog) // 资金流水查询(历史) taAccountR.GET("/QueryHisAmountLog", taaccount.QueryHisAmountLog) } // ************************ 通用服务 ************************ commonR := apiR.Group("Common") commonR.Use() { // 查询交易端菜单 commonR.GET("/QueryTraderMenu", common.QueryTraderMenu) // 查询交易端列表头信息 commonR.GET("/QueryTableDefine", common.QueryTableDefine) // 查询省市信息(不包括区) commonR.GET("/QueryProvincesAndCities", common.QueryProvincesAndCities) // 查询区域信息 commonR.GET("/GetDivisions", common.GetDivisions) // 查询轮播图配置信息 commonR.GET("/QueryImageConfigs", common.QueryImageConfigs) // 获取所有枚举信息 commonR.GET("/GetAllEnums", common.GetAllEnums) // 获取服务器时间 commonR.GET("/GetServerTime", common.GetServerTime) // 获取数据库错误信息 commonR.GET("/QueryErrorInfos", common.QueryErrorInfos) // 通知公告系统消息查询 commonR.Use(token.Auth()).GET("/QueryNotice", common.QueryNotice) // 通知公告设置已读请求 commonR.Use(token.Auth()).POST("/NoticeReaded", common.NoticeReaded) // 获取交易端菜单 commonR.Use(token.Auth()).GET("/GetClientMenus", common.GetClientMenus) } // ************************ 通用市场 ************************ marketR := apiR.Group("Market") marketR.Use(token.Auth()) { // 查询市场运行信息 marketR.GET("/QueryMarketRun", market.QueryMarketRun) // 获取登录账号有权限的市场信息 marketR.GET("/QueryMarketsByLoginID", market.QueryMarketsByLoginID) // 获取登录账号有权限的商品信息 marketR.GET("/QueryGoodsesByLoginID", market.QueryGoodsesByLoginID) // 获取所有外部交易所信息 marketR.GET("/GetAllExExchanges", market.GetAllExExchanges) } // ************************ 通用单据 ************************ orderR := apiR.Group("Order") orderR.Use(token.Auth()) { // 持仓汇总查询(合约市场) orderR.GET("/QueryTradePosition", order.QueryTradePosition) // 委托单查询请求(合约市场) orderR.GET("/QueryTradeOrderDetail", order.QueryTradeOrderDetail) // 历史委托单查询请求(合约市场) orderR.GET("/QueryHisTradeOrderDetail", order.QueryHisTradeOrderDetail) // 成交单查询(合约市场) orderR.GET("/QueryTradeDetail", order.QueryTradeDetail) // 历史成交单查询(合约市场) orderR.GET("/QueryHisTradeDetail", order.QueryHisTradeDetail) orderR.GET("/QueryTradeHolderDetail", tradexx.QueryTradeHolderDetail) } // ************************ 通用交易 ************************ tradeR := apiR.Group("Trade") tradeR.Use(token.Auth()) { // 点选挂牌委托单据查询(保证金摘牌大厅) tradeR.GET("/QueryRecieptOrder", trade.QueryRecieptOrder) } // ************************ 行情服务 ************************ quoteR := apiR.Group("Quote") quoteR.Use(token.AuthByHsby()) { // 查询行情历史数据 quoteR.GET("/QueryHistoryDatas", quote.QueryHistoryDatas) // 查询行情Tik数据 quoteR.GET("/QueryHistoryTikDatas", quote.QueryHistoryTikDatas) // 查询分时图历史数据 quoteR.GET("/QueryTSData", quote.QueryTSData) // 获取商品盘面信息 quoteR.GET("/QueryQuoteDay", quote.QueryQuoteDay) } // ************************ 检索服务 ************************ searchR := apiR.Group("Search") searchR.Use() { // 检索商品信息 searchR.GET("/SearchGoodses", search.Goodses) } // ************************ 仓单贸易 ************************ wrTradeR := apiR.Group("WRTrade") wrTradeR.Use(token.Auth()) { wrTradeR.GET("/GetAllDeliveryGoods", wrtrade.GetAllDeliveryGoods) } // ************************ 产能预售 ************************ cpTradeR := apiR.Group("CPTrade") cpTradeR.Use(token.Auth()) { // 查询产能预售申请表 cpTradeR.GET("/QueryPreasleApply", cptrade.QueryPreasleApply) // 查询远期订单信息 cpTradeR.GET("/QueryUserGoodsData", cptrade.QueryUserGoodsData) // 查询远期订单注销申请信息 cpTradeR.GET("/QueryPositionCancel", cptrade.QueryPositionCancel) // 查询产能预售商品扩展信息 cpTradeR.GET("/QueryPresaleGoodsEx", cptrade.QueryPresaleGoodsEx) // 查询产能预售我的出价信息 cpTradeR.GET("/QueryCPTradeMyBidInfos", cptrade.QueryCPTradeMyBidInfos) // 查询我的预售信息 cpTradeR.GET("/QueryMyCPTradeGoods", cptrade.QueryMyCPTradeGoods) // 查询产能预售委托单信息 cpTradeR.GET("/QueryCPTradeOrderDetail", cptrade.QueryCPTradeOrderDetail) } // ************************ 交割服务 ************************ deliveryR := apiR.Group("Delivery") deliveryR.Use(token.Auth()) { // 查询商品交割关系表 deliveryR.GET("/QueryDeliveryRelation", delivery.QueryDeliveryRelation) } // ************************ 风险管理 ************************ erms2R := apiR.Group("Erms2") erms2R.Use(token.Auth()) { // 查询内部成交单信息 erms2R.GET("/QueryInnerTradeDetail", erms2.QueryInnerTradeDetail) // 查询期现套利策略表信息(指定资金账户、未结束的) erms2R.GET("/QueryArbitrageStrategy", erms2.QueryArbitrageStrategy) // 查询现货合同表信息(指定策略ID、未结束的) erms2R.GET("/QuerySpotContract", erms2.QuerySpotContract) } // ************************ 风险管理v3 ************************ erms3R := apiR.Group("Erms3") erms3R.Use(token.Auth()) { // 新增现货合同申请 erms3R.POST("/AddSpotContractApply", erms3.AddSpotContractApply) // 查询合同申请表单数据 erms3R.GET("/QuerySpotContractAppleForm", erms3.QuerySpotContractAppleForm) // 查询合同详细信息. erms3R.GET("/QuerySpotContractDetail", erms3.QuerySpotContractDetail) // 查询待审核合同 erms3R.GET("/QueryPendingAuditContract", erms3.QueryPendingAuditContract) // 新增客户申请 erms3R.POST("/AddUserInfoApply", erms3.AddUserInfoApply) // 修改客户申请 erms3R.POST("/ModifyUserInfoApply", erms3.ModifyUserInfoApply) // 删除客户申请 erms3R.GET("/DeleteUserInfoApply", erms3.DeleteUserInfoApply) // 客户申请信息查询 erms3R.GET("/QueryUserInfoApplies", erms3.QueryUserInfoApplies) // 待审核业务查询 erms3R.GET("/QueryPendingBusiness", erms3.QueryPendingBusiness) // 业务信息查询 erms3R.GET("/QueryBusinessInfo", erms3.QueryBusinessInfo) // 客户信息查询 erms3R.GET("/QueryUserInfos", erms3.QueryUserInfos) // 新增期现套利业务申请 erms3R.POST("/AddErms2ASApply", erms3.AddErms2ASApply) // 新增现货贸易业务申请 erms3R.POST("/AddErms2SpotTradeApply", erms3.AddErms2SpotTradeApply) } // ************************ 定制【尚志大宗】 ************************ szdzR := apiR.Group("SZDZ") szdzR.Use(token.Auth()) { // 点选挂牌委托单据查询(摘牌大厅) szdzR.GET("/QueryRecieptOrder", szdz.QueryRecieptOrder) // 商品提货单查询 szdzR.GET("/QueryGoodsPickup", szdz.QueryGoodsPickup) // 交易系统转换流水查询 szdzR.GET("/QueryConvertLog", szdz.QueryConvertLog) // 搜索白名单 szdzR.GET("/SearchWhite", szdz.SearchWhite) // 查询交易系统转换设置 szdzR.GET("/QueryConvertConfig", szdz.QueryConvertConfig) // 持仓汇总查询(尚志大宗) szdzR.GET("/QuerySZDZTradePosition", szdz.QuerySZDZTradePosition) } // ************************ 定制【海商报业】 ************************ hsbyR := apiR.Group("HSBY") hsbyR.Use(token.AuthByHsby()) { // 查询热门商品列表(二级市场,挂牌点选) hsbyR.GET("/QueryHsbyTopGoodses", hsby.QueryHsbyTopGoodses) // 查询二级市场(挂牌点选)商品信息详情 hsbyR.GET("/QueryHsbyListingGoodsDetail", hsby.QueryHsbyListingGoodsDetail) // 查询二级市场(挂牌点选)商品对应的挂牌委托单信息 hsbyR.GET("/QueryHsbyGoodsOrderDetails", hsby.QueryHsbyGoodsOrderDetails) // 查询“我的订单”信息 hsbyR.GET("/QueryHsbyMyBuyOrderDetails", hsby.QueryHsbyMyBuyOrderDetails) // 查询“我的商品”信息 hsbyR.GET("/QueryHsbyMyGoods", hsby.QueryHsbyMyGoods) // 查询新品上市商品列表(一级市场预售) hsbyR.GET("/QueryHsbyPreGoodses", hsby.QueryHsbyPreGoodses) // 查询一级市场(预售)商品信息详情 hsbyR.GET("/QueryHsbyPreGoodsDetail", hsby.QueryHsbyPreGoodsDetail) // 查询"我的闲置"单据信息 hsbyR.GET("/QueryHsbySellMyDetails", hsby.QueryHsbySellMyDetails) // 查询我的包裹信息 hsbyR.GET("/QueryHsbyMyPackages", hsby.QueryHsbyMyPackages) // 设置我的包裹已收货状态 hsbyR.POST("/SetHsbyMyPackagesStatus", hsby.SetHsbyMyPackagesStatus) // 查询省市信息(不包括区) hsbyR.GET("/QueryProvincesAndCities", hsby.QueryProvincesAndCities) // 查询"我的订单 - 已完成"单据信息 hsbyR.GET("/QueryHsbyBuyMyTradeDetail", hsby.QueryHsbyBuyMyTradeDetail) // 获取我的订单与包裹数量 hsbyR.GET("/GetHsbyMyCount", hsby.GetHsbyMyCount) // 获取我的订单中待付款信息 hsbyR.GET("/QueryMyPayOrders", hsby.QueryMyPayOrders) // 获取我的闲置中收款信息查询 hsbyR.GET("/QueryMyCollectionOrders", hsby.QueryMyCollectionOrders) // 查询海商报业相关市场信息 hsbyR.GET("/QueryHsbyMarkets", hsby.QueryHsbyMarkets) // 查询游客特卖商品列表(三级商城) hsbyR.GET("/QueryHsbyVisitorMarketGoodses", hsby.QueryHsbyVisitorMarketGoodses) // 查询特卖商品列表(三级商城) hsbyR.GET("/QueryHsbyMarketGoodses", hsby.QueryHsbyMarketGoodses) // 查询游客三级市场(商城)商品信息详情 hsbyR.GET("/QueryHsbyVisitorMarketGoodsDetail", hsby.QueryHsbyVisitorMarketGoodsDetail) // 查询三级市场(商城)商品信息详情 hsbyR.GET("/QueryHsbyMarketGoodsDetail", hsby.QueryHsbyMarketGoodsDetail) // 我的优惠卷查询 hsbyR.GET("/QueryMyCoupons", hsby.QueryMyCoupons) // 我的优惠卷持仓查询 hsbyR.GET("/QueryMyCouponHolds", hsby.QueryMyCouponHolds) // 已使用优惠卷查询 hsbyR.GET("/QueryMyUsedCoupon", hsby.QueryMyUsedCoupon) // 获取终端固定广告配置 hsbyR.GET("/QueryClientFixedADConfigs", hsby.QueryClientFixedADConfigs) } // ***************************** 企业风险管理(app)*************************** ermcpR := apiR.Group("Ermcp") ermcpR.Use(token.Auth()) { // 查询待点价、履约和全部合同 ermcpR.GET("/QueryUserInfo", ermcp.QueryUserInfo) ermcpR.GET("/QueryWrStandard", ermcp.QueryWrStandard) ermcpR.GET("/QueryWrStandardDetail", ermcp.QueryWrStandardDetail) ermcpR.GET("/QuerySpotContract", ermcp.QuerySpotContract) ermcpR.GET("/QueryContract", ermcp.QueryContract) ermcpR.GET("/QueryHedgePlan", ermcp.QueryHedgePlan) ermcpR.GET("/QueryBusinessDj", ermcp.QueryBusinessDj) ermcpR.GET("/QueryBusinessJs", ermcp.QueryBusinessJs) ermcpR.GET("/QueryBusinessJsEx", ermcp.QueryBusinessJsEx) ermcpR.GET("/QueryBusinessKx", ermcp.QueryBusinessKx) ermcpR.GET("/QueryBusinessFp", ermcp.QueryBusinessFp) ermcpR.GET("/QueryChangeLog", ermcp.QueryChangeLog) ermcpR.GET("/QueryRealtimeExposure", ermcp.QueryRealtimeExposure) ermcpR.GET("/QueryExposureDetail", ermcp.QueryExposureDetail) ermcpR.GET("/QueryExposureSpot", ermcp.QueryExposureSpot) ermcpR.GET("/QueryExposureSpotDetail", ermcp.QueryExposureSpotDetail) ermcpR.GET("/QueryHisExposure", ermcp.QueryHisExposure) ermcpR.GET("/QueryMiddleGoods", ermcp.QueryMiddleGoods) ermcpR.GET("/QueryMiddleGoodsDetail", ermcp.QueryMiddleGoodsDetail) ermcpR.GET("/QueryGGConvertConfig", ermcp.QueryGGConvertConfig) ermcpR.GET("/QueryMiddleGoodsChangeLog", ermcp.QueryMiddleGoodsChangeLog) ermcpR.GET("/QueryAvaildGoodsGroup", ermcp.QueryAvaildGoodsGroup) ermcpR.GET("/QueryRealtimeExposurePosition", ermcp.QueryRealtimeExposurePosition) ermcpR.GET("/QueryExposureHedgePosition", ermcp.QueryExposureHedgePosition) ermcpR.GET("/QryReportDayFinance", ermcp.QryReportDayFinance) ermcpR.GET("/QryReportDayFinanceKx", ermcp.QryReportDayFinanceKx) ermcpR.GET("/QryReportDayFinanceFp", ermcp.QryReportDayFinanceFp) ermcpR.GET("/QryReportMonthFinance", ermcp.QryReportMonthFinance) ermcpR.GET("/QryReportDaySpot", ermcp.QryReportDaySpot) ermcpR.GET("/QryReportDaySpotDetail", ermcp.QryReportDaySpotDetail) ermcpR.GET("/QryReportMonthSpot", ermcp.QryReportMonthSpot) ermcpR.GET("/QryReportMonthSpotDetail", ermcp.QryReportMonthSpotDetail) ermcpR.GET("/QryReportAreaSpotPL", ermcp.QryReportAreaSpotPL) ermcpR.GET("/QueryExposureHedgePositionDetail", ermcp.QueryExposureHedgePositionDetail) ermcpR.GET("/QueryPendingAuditInfo", ermcp.QueryPendingAuditInfo) ermcpR.GET("/QueryWarehouseInfo", ermcp.QueryWarehouseInfo) ermcpR.GET("/QueryAreaStockApply", ermcp.QueryAreaStockApply) ermcpR.GET("/QueryAreaStockApplySum", ermcp.QueryAreaStockApplySum) ermcpR.GET("/QueryAreaStock", ermcp.QueryAreaStock) ermcpR.GET("/QueryAreaStockReport", ermcp.QueryAreaStockReport) ermcpR.GET("/QueryAreaStockReportDetail", ermcp.QueryAreaStockReportDetail) ermcpR.GET("/QueryGoodsBrand", ermcp.QueryGoodsBrand) ermcpR.GET("/QueryGoodsModel", ermcp.QueryGoodsModel) ermcpR.GET("/QueryAccMgrLoginUser", ermcp.QueryAccMgrLoginUser) ermcpR.GET("/QueryAccMgrTaaccount", ermcp.QueryAccMgrTaaccount) ermcpR.GET("/QueryAccMgrMainAccountInfo", ermcp.QueryAccMgrMainAccountInfo) ermcpR.GET("/QueryAccMgrRole", ermcp.QueryAccMgrRole) ermcpR.GET("/QueryAccMgrRoleMenu", ermcp.QueryAccMgrRoleMenu) ermcpR.GET("/QueryRoleMenu", ermcp.QueryRoleMenu) ermcpR.GET("/QueryAccMgrBizGroupSet", ermcp.QueryAccMgrBizGroupSet) ermcpR.GET("/QueryAccMgrTaAccountInfo", ermcp.QueryAccMgrTaAccountInfo) ermcpR.GET("/QuerySpotGoodsPrice", ermcp.QuerySpotGoodsPrice) ermcpR.GET("/QuerySpotGoodsPriceLog", ermcp.QuerySpotGoodsPriceLog) ermcpR.GET("/QueryFuturesCompany", ermcp.QueryFuturesCompany) ermcpR.GET("/QueryTradeConfigTMP", ermcp.QueryTradeConfigTMP) ermcpR.GET("/QueryExposureGoods", ermcp.QueryExposureGoods) // 期货相关 // 查询企业风管期货商品信息 ermcpR.GET("/GetErmcpGoods", ermcp.GetErmcpGoods) // 查询企业风管期货主力、次主力商品信息 ermcpR.GET("/GetErmcpGoodsSortByPosition", ermcp.GetErmcpGoodsSortByPosition) // 获取企业风管期货持仓头寸信息 ermcpR.GET("/QueryErmcpTradePosition", ermcp.QueryErmcpTradePosition) // 获取企业风管期货内部持仓单信息 ermcpR.GET("/QueryErmcpInnerHolderDetails", ermcp.QueryErmcpInnerHolderDetails) // 获取企业风管期货委托单信息 ermcpR.GET("/QueryErmcpOrderDetails", ermcp.QueryErmcpOrderDetails) // 获取企业风管期货成交单信息 ermcpR.GET("/QueryErmcpTradeDetails", ermcp.QueryErmcpTradeDetails) // 获取企业风管期货历史委托单信息 ermcpR.GET("/QueryErmcpHisOrderDetails", ermcp.QueryErmcpHisOrderDetails) // 获取企业风管期货历史成交单信息 ermcpR.GET("/QueryErmcpHisTradeDetails", ermcp.QueryErmcpHisTradeDetails) // 权限相关 // 获取企业风管终端权限 ermcpR.GET("/GetErmcpRoleFuncMenuLists", ermcp.GetErmcpRoleFuncMenuLists) // 获取目标登录账号当前对冲账号在线状态 ermcpR.GET("/GetErmcpOutAccountStatus", ermcp.GetErmcpOutAccountStatus) } // ***************************** 企业风险管理v3(app)*************************** ermcp3R := apiR.Group("Ermcp3") ermcp3R.Use(token.Auth()) { ermcp3R.GET("/QueryDeliveryGoods", ermcp3.QueryDeliveryGoods) ermcp3R.GET("/QueryDeliveryGoodsDetail", ermcp3.QueryDeliveryGoodsDetail) ermcp3R.GET("/QuerySpotContract", ermcp3.QuerySpotContract) ermcp3R.GET("/QuerySpotContractBS", ermcp3.QuerySpotContractBS) ermcp3R.GET("/QueryExposureDetail", ermcp3.QueryExposureDetail) ermcp3R.GET("/QueryExposureSpot", ermcp3.QueryExposureSpot) ermcp3R.GET("/QueryExposureSpotDetail", ermcp3.QueryExposureSpotDetail) ermcp3R.GET("/QueryDGFactoryItem", ermcp3.QueryDGFactoryItem) ermcp3R.GET("/QueryGoodsbrand", ermcp3.QueryGoodsbrand) ermcp3R.GET("/QueryGoodsWrstandard", ermcp3.QueryGoodsWrstandard) ermcp3R.GET("/QueryAreaStockApply", ermcp3.QueryAreaStockApply) ermcp3R.GET("/QueryAreaStock", ermcp3.QueryAreaStock) ermcp3R.GET("/QueryAreaStockApplySum", ermcp3.QueryAreaStockApplySum) ermcp3R.GET("/QueryAreaStockReportDetail", ermcp3.QueryAreaStockReportDetail) ermcp3R.GET("/QuerySpotGoodsPrice", ermcp3.QuerySpotGoodsPrice) ermcp3R.GET("/QuerySpotGoodsPriceLog", ermcp3.QuerySpotGoodsPriceLog) ermcp3R.GET("/QueryHedgePlan", ermcp3.QueryHedgePlan) ermcp3R.GET("/QueryGoodsGroup", ermcp3.QueryGoodsGroup) ermcp3R.GET("/QueryMiddleGoodsDetail", ermcp3.QueryMiddleGoodsDetail) ermcp3R.GET("/QueryRootUserAccount", ermcp3.QueryRootUserAccount) ermcp3R.GET("/QueryPaAreaSubject", ermcp3.QueryPaAreaSubject) ermcp3R.GET("/QueryPaAreaAuditCfg", ermcp3.QueryPaAreaAuditCfg) ermcp3R.GET("/QueryPaTradeLink", ermcp3.QueryPaTradeLink) ermcp3R.GET("/QuerySCMiddleGoods", ermcp3.QuerySCMiddleGoods) ermcp3R.GET("/QueryPaTradeLinkDetail", ermcp3.QueryPaTradeLinkDetail) ermcp3R.GET("/QueryOutTradeLink", ermcp3.QueryOutTradeLink) ermcp3R.GET("/QuerySubTaaccount", ermcp3.QuerySubTaaccount) ermcp3R.GET("/QueryInnerTradeLink", ermcp3.QueryInnerTradeLink) // 报表 ermcp3R.GET("/QryReportDaySpotDetail", ermcp3.QryReportDaySpotDetail) ermcp3R.GET("/QryReportDayFinanceKx", ermcp3.QryReportDayFinanceKx) ermcp3R.GET("/QryReportDayFinanceFp", ermcp3.QryReportDayFinanceFp) ermcp3R.GET("/QryReportDaySpot", ermcp3.QryReportDaySpot) ermcp3R.GET("/QryReportMonthSpot", ermcp3.QryReportMonthSpot) ermcp3R.GET("/QryReportMonthSpotDetail", ermcp3.QryReportMonthSpotDetail) ermcp3R.GET("/QryAreaSpotplReport", ermcp3.QryAreaSpotplReport) ermcp3R.GET("/QryAreaExpourseReport", ermcp3.QryAreaExpourseReport) ermcp3R.GET("/QryAreaExpourseContractDetail", ermcp3.QryAreaExpourseContractDetail) ermcp3R.GET("/QryAreaExpourseHedgeplanDetail", ermcp3.QryAreaExpourseHedgeplanDetail) ermcp3R.GET("/QryAreaExpourseFutuDetail", ermcp3.QryAreaExpourseFutuDetail) ermcp3R.GET("/QryAreaExpourseParamChLogDetail", ermcp3.QryAreaExpourseParamChLogDetail) ermcp3R.GET("/QryAreaStockReport", ermcp3.QryAreaStockReport) ermcp3R.GET("/QryFinanceReport", ermcp3.QryFinanceReport) ermcp3R.GET("/QryAreaSumPL", ermcp3.QryAreaSumPL) ermcp3R.GET("/QryTaFutureDataReport", ermcp3.QryTaFutureDataReport) ermcp3R.GET("/QrySCMiddleGoodsReport", ermcp3.QrySCMiddleGoodsReport) } // ****************************大连千海金****************************** qhjR := apiR.Group("Qhj") qhjR.Use(token.Auth()) { qhjR.GET("QueryContract", qhj.QueryContract) qhjR.GET("QueryContractLog", qhj.QueryContractLog) qhjR.GET("QueryRStrategy", qhj.QueryRStrategy) qhjR.GET("QueryRSTriggerLog", qhj.QueryRSTriggerLog) qhjR.GET("QueryUserReceiveInfo", qhj.QueryUserReceiveInfo) qhjR.GET("QueryUserCollectConfig", qhj.QueryUserCollectConfig) qhjR.GET("QueryTradeGoodsPickup", qhj.QueryTradeGoodsPickup) qhjR.GET("QueryBankAccountSign", qhj.QueryBankAccountSign) qhjR.GET("QueryPickGoods", qhj.QueryPickGoods) qhjR.GET("QueryPickArea", qhj.QueryPickArea) qhjR.GET("QueryBankInfo", qhj.QueryBankInfo) qhjR.GET("QueryReckonPriceLog", qhj.QueryReckonPriceLog) qhjR.GET("QueryCustomerInfo", qhj.QueryCustomerInfo) qhjR.GET("QueryCusBankSignBank", qhj.QueryCusBankSignBank) qhjR.GET("QuerySiteColumnDetail", qhj.QuerySiteColumnDetail) qhjR.GET("QueryAccountInOutApply", qhj.QueryAccountInOutApply) qhjR.GET("QueryPayOrder", qhj.QueryPayOrder) qhjR.GET("QueryGoodsEx", qhj.QueryGoodsEx) qhjR.GET("QueryParentAreaList", qhj.QueryParentAreaList) qhjR.GET("QueryAreaFinanceConfig", qhj.QueryAreaFinanceConfig) qhjR.GET("QueryMyTeam", qhj.QueryMyTeam) qhjR.GET("QueryMyTeamOrder", qhj.QueryTeamOrder) qhjR.GET("QueryBrokerRewardLog", qhj.QueryBrokerRewardLog) qhjR.GET("QueryScoreLog", qhj.QueryScoreLog) qhjR.GET("QueryBrokerApply", qhj.QueryBrokerApply) qhjR.GET("QueryBrokerApplyEx", qhj.QueryBrokerApplyEx) } // *************************千海金(PCWeb)***************************** qhjPCWebR := apiR.Group("QhjMgr") qhjPCWebR.Use(token.Auth()) { qhjPCWebR.GET("QuerySubArea", qhjPCWeb.QuerySubArea) qhjPCWebR.GET("QueryCustomerInfo", qhjPCWeb.QueryCustomerInfo) qhjPCWebR.GET("QueryAccountInOutApply", qhjPCWeb.QueryAccountInOutApply) qhjPCWebR.GET("QueryTradePosition", qhjPCWeb.QueryTradePosition) qhjPCWebR.GET("QueryTradeDetail", qhjPCWeb.QueryTradeDetail) qhjPCWebR.GET("QueryTradeOrderDetail", qhjPCWeb.QueryTradeOrderDetail) qhjPCWebR.GET("QueryTradePayOrder", qhjPCWeb.QueryTradePayOrder) qhjPCWebR.GET("QueryContract", qhjPCWeb.QueryContract) qhjPCWebR.GET("QueryPickGoods", qhjPCWeb.QueryPickGoods) qhjPCWebR.GET("QueryBrokerApply", qhjPCWeb.QueryBrokerApply) qhjPCWebR.GET("QueryBrokerRewardReport", qhjPCWeb.QueryBrokerRewardReport) } // **********************千海金(协议和签约)************************** qhjAgreementR := apiR.Group("QhjSys") { qhjAgreementR.GET("QueryAgreementConfig", qhj.QueryAgreementConfig) qhjAgreementR.GET("QueryAgreementChangeLog", qhj.QueryAgreementChangeLog) qhjAgreementR.GET("QueryNodeAgreementConfig", qhj.QueryNodeAgreementConfig) qhjAgreementR.GET("QueryCustomerSignStatus", qhj.QueryCustomerSignStatus) qhjAgreementR.GET("QueryQhjCustomerSignLog", qhj.QueryQhjCustomerSignLog) qhjAgreementR.GET("QueryUserNodeCfgAndStatus", qhj.QueryUserNodeCfgAndStatus) } // **************************仓单贸易v2(仓单优化)******************** wrTrade2R := apiR.Group("WrTrade2") wrTrade2R.Use(token.Auth()) { wrTrade2R.GET("QueryOrderQuote", wrTrade2.QueryOrderQuote) wrTrade2R.GET("QueryOrderQuoteDetail", wrTrade2.QueryOrderQuoteDetail) wrTrade2R.GET("QueryWrPosition", wrTrade2.QueryWrPosition) wrTrade2R.GET("QueryWrOrderDetail", wrTrade2.QueryWrOrderDetail) wrTrade2R.GET("QueryWrTradeDetail", wrTrade2.QueryWrTradeDetail) wrTrade2R.GET("QueryWrSpecialMatchOrder", wrTrade2.QueryWrSpecialMatchOrder) wrTrade2R.GET("QueryWrGoodsInfo", wrTrade2.QueryWrGoodsInfo) wrTrade2R.GET("QueryPerformancePlan", wrTrade2.QueryPerformancePlan) wrTrade2R.GET("QueryHoldLB", wrTrade2.QueryHoldLB) wrTrade2R.GET("QueryFilterItem", wrTrade2.QueryFilterItem) wrTrade2R.GET("QueryFaProductDetail", wrTrade2.QueryFaProductDetail) wrTrade2R.GET("QueryWrFactorTypeInfo", wrTrade2.QueryWrFactorTypeInfo) wrTrade2R.GET("QueryWrFactorTypeInfoEx", wrTrade2.QueryWrFactorTypeInfoEx) wrTrade2R.GET("QueryWrMarketTradeConfig", wrTrade2.QueryWrMarketTradeConfig) wrTrade2R.GET("QueryFtDeliveryGoods", wrTrade2.QueryFtDeliveryGoods) wrTrade2R.GET("QueryWrStandardFactoryItem", wrTrade2.QueryWrStandardFactoryItem) wrTrade2R.GET("QueryWrPerformancePlanStep", wrTrade2.QueryWrPerformancePlanStep) wrTrade2R.GET("QueryWrFinanceBuyApply", wrTrade2.QueryWrFinanceBuyApply) wrTrade2R.GET("QueryWrScfContract", wrTrade2.QueryWrScfContract) wrTrade2R.GET("QueryWrBuybackDetail", wrTrade2.QueryWrBuybackDetail) wrTrade2R.GET("QueryWrScfContractInterest", wrTrade2.QueryWrScfContractInterest) wrTrade2R.GET("QueryWrOutInApply", wrTrade2.QueryWrOutInApply) wrTrade2R.GET("QueryWrDeliveryDetail", wrTrade2.QueryWrDeliveryDetail) wrTrade2R.GET("QueryWrBsGoodsInfo", wrTrade2.QueryWrBsGoodsInfo) wrTrade2R.GET("QueryWrTradeOrderDetail", wrTrade2.QueryWrTradeOrderDetail) wrTrade2R.GET("QueryWrAverageTradePrice", wrTrade2.QueryWrAverageTradePrice) wrTrade2R.GET("QueryOrderQuoteMyq", wrTrade2.QueryOrderQuoteMyq) wrTrade2R.GET("QueryWrDeliveryAvalidHoldLB", wrTrade2.QueryWrDeliveryAvalidHoldLB) wrTrade2R.GET("QueryWrUserFriend", wrTrade2.QueryWrUserFriend) wrTrade2R.GET("QueryWrFriendApply", wrTrade2.QueryWrFriendApply) wrTrade2R.GET("QueryPermancePlanTmp", wrTrade2.QueryPermancePlanTmp) wrTrade2R.GET("QueryWrTradeBargainApply", wrTrade2.QueryWrTradeBargainApply) wrTrade2R.GET("QueryWrPerformanceStepType", wrTrade2.QueryWrPerformanceStepType) } // **************************天津麦顿************************* tjmdR := apiR.Group("Tjmd") tjmdR.Use(token.Auth()) { tjmdR.GET("QueryQuoteGoodsList", tjmd.QueryQuoteGoodsList) tjmdR.GET("QueryTjmdTradeOrderDetail", tjmd.QueryTjmdTradeOrderDetail) tjmdR.GET("QueryTjmdTransferApply", tjmd.QueryTjmdTransferApply) tjmdR.GET("QueryTjmdTodayAccountMargin", tjmd.QueryTjmdTodayAccountMargin) } // **************************中江************************* zjR := apiR.Group("ZJ") zjR.Use() { zjR.GET("GetBankTip", zj.GetBankTip) zjR.GET("GetCusBankChannels", zj.GetCusBankChannels) } return r } func ginLoggerMiddleware() gin.HandlerFunc { return func(c *gin.Context) { start := time.Now() c.Next() end := time.Now() latency := end.Sub(start) path := c.Request.URL.RequestURI() clientip := c.ClientIP() method := c.Request.Method statuscode := c.Writer.Status() logger.GetLogger().Debugf("|%3d|%13v|%15s|%s %s", statuscode, latency, clientip, method, path) } } func ginRecoveryMiddleware() gin.HandlerFunc { return gin.RecoveryWithWriter(logger.GetLogWriter()) } // CORSMiddleware cors跨域. func CORSMiddleware() gin.HandlerFunc { return func(c *gin.Context) { c.Writer.Header().Set("Access-Control-Allow-Origin", "*") c.Writer.Header().Set("Access-Control-Allow-Credentials", "true") 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") c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT") c.Writer.Header().Set("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type, X-session-Token") if c.Request.Method == "OPTIONS" { c.AbortWithStatus(http.StatusNoContent) return } c.Next() } }