package app import ( "recook/internal/api/mobile/bill" "recook/internal/api/mobile/live" _ "recook/internal/secure" "recook/internal/v2/router/middleware" "github.com/gin-gonic/gin" "recook/internal/api/mobile/activity" "recook/internal/api/mobile/addr" "recook/internal/api/mobile/aftersales" "recook/internal/api/mobile/application" "recook/internal/api/mobile/attention" "recook/internal/api/mobile/category" "recook/internal/api/mobile/coupon" "recook/internal/api/mobile/diamond_show" "recook/internal/api/mobile/evaluation" "recook/internal/api/mobile/favorites" "recook/internal/api/mobile/file" "recook/internal/api/mobile/goods" "recook/internal/api/mobile/invoice" "recook/internal/api/mobile/kuaidi100" "recook/internal/api/mobile/messages" "recook/internal/api/mobile/moment_copy" "recook/internal/api/mobile/newertehui" "recook/internal/api/mobile/official" "recook/internal/api/mobile/order" "recook/internal/api/mobile/order_preview" "recook/internal/api/mobile/pay/alipay" "recook/internal/api/mobile/pay/recookpay" "recook/internal/api/mobile/pay/wxh5innerpay" "recook/internal/api/mobile/pay/wxh5pay" "recook/internal/api/mobile/pay/wxminipay" "recook/internal/api/mobile/pay/wxpay" "recook/internal/api/mobile/region" "recook/internal/api/mobile/shopping_trolley" "recook/internal/api/mobile/show" "recook/internal/api/mobile/users" "recook/internal/api/mobile/wallet" ) func SetupRouter(v1 *gin.RouterGroup) { v1.Use(middleware.AppVersion) // 版本拦截 /* 文件 */ fileRouter := v1.Group("files") { fileRouter.POST("/photo/upload", file.UploadPhoto) // 图片上传 } v1.Group("activity").POST("/detail", activity.QueryActivityDetail) //测试时注销 v1.Use(authorize()) //测试完成后注销注销 //v1.Use(secure.FakeEcrypt()) v1.Use(decrypt()) { messageRouter := v1.Group("messages") { messageRouter.POST("/register/sms/send", messages.SendRegisterMessage) messageRouter.POST("/login/sms/send", messages.SendMessageToMobile) messageRouter.POST("/verify/sms/send", messages.SendVerifyUserMobile) messageRouter.POST("/verify/sms", messages.VerifyUserMobile) } // 钻石用户填写申请表 //v1.POST("/diamond_register/inform", users.FillInform) userR := v1.Group("/users") { noticeR := userR.Group("notice") { noticeR.POST("/list", users.NoticeList) } topR := userR.Group("top") { topR.POST("/login", users.LoginTop) topR.POST("/getqrcode", users.GetQrcodeTop) topR.POST("/getcode/list", users.GetCodeList) topR.POST("/gethours", users.GetHours) } profileR := userR.Group("profile") { profileR.POST("/wx/login", users.LoginByWeChat) profileR.POST("/wx/register", users.WeChatRegister) profileR.POST("/wx/invitation", users.WeChatInvitation) profileR.POST("/wx/invitation-wxapp", users.WeChatInvitationWxapp) profileR.POST("/wx/mini/login", users.LoginByMiniProgram) profileR.POST("/wx/mini/loginv2", users.V2LoginByMiniProgram) profileR.POST("/mobile/login", users.LoginByMobile) profileR.POST("/mobile/login_unionid", users.UnionID) profileR.POST("/mobile/register", users.MobileRegister) profileR.POST("/mobile/register-wxapp", users.MobileRegisterWxapp) profileR.POST("/mobile/register-h5", users.MobileRegisterH5) profileR.POST("/mobile/is_registered", users.IsRegistered) //h5获取code profileR.POST("/wxh5/get_code", users.H5GetCode) profileR.POST("/wxh5/get_openId", users.H5GetOpenId) //根据uid获取token profileR.POST("/h5/get_token_by_uid", users.GetTokenByUid) // 微信绑定操作 2020-03-23 profileR.POST("/mobile/wx/binding", users.WxBinding) // 更新用户需要分享的地址,手机号,微信号 profileR.POST("/address/update", users.UpdateUserAddress) profileR.POST("/phone/update", users.UpdateUserPhone) profileR.POST("/wechat-no/update", users.UpdateUserWechatNo) profileR.POST("/auto/login", users.AutoLogin) profileR.POST("/head_pic/update", users.UpdateUserHeadPic) profileR.POST("/nickname/update", users.UpdateUserNickname) profileR.POST("/gender/update", users.UpdateUserGender) profileR.POST("/birthday/update", users.UpdateUserBirthday) // 店铺——>我的邀请获取的接口 //我的—>权益卡——>赠送之后获取的团队接口, profileR.POST("/invite/list", users.QueryInviteUsers) profileR.POST("/invite/diamond", users.QueryInviteDiamond) // 修改 被邀请人备注 profileR.POST("/invite/remark-name/update", users.UpdateRemarkName) profileR.POST("/brief", users.QueryUserProfile) profileR.POST("/me", users.QueryUserProfile) profileR.POST("/info/real/binding", users.BindingRealInfo) //profileR.POST("/invite/count", users.QueryInviteCount) // 实名信息 profileR.POST("/real_info", users.RealInfo) //注销账号 profileR.POST("/userDestroy", users.UserDestroy) // 我的信息 profileR.POST("/my_info", users.MyInfo) // 版本信息 profileR.POST("/versionInfo", users.VersionInfo) // 我的信息 二级页面 profileR.POST("/my_info/self", users.IncomeFromSelf) profileR.POST("/my_info/share", users.IncomeFromShare) profileR.POST("/my_info/team", users.IncomeFromTeam) // 抽奖活动 } addrR := userR.Group("address") { addrR.POST("/list", addr.QueryList) addrR.POST("/add", addr.CreateAddr) addrR.POST("/remove", addr.RemoveAddr) addrR.POST("/default/update", addr.UpdateDefaultAddr) addrR.POST("/update", addr.UpdateAddr) } invoiceR := userR.Group("invoice") { invoiceR.POST("/list", invoice.QueryInvoiceList) invoiceR.POST("/create", invoice.CreateInvoice) invoiceR.POST("/delete", invoice.DeleteInvoice) } } cronShow := v1.Group("show") { cronShow.POST("/get", show.GetShow) } walletR := v1.Group("wallet") { walletR.POST("/pay/forgot_password", wallet.ForgotPassword) walletR.POST("/pay/password/save", wallet.SavePayPassword) walletR.POST("/coin/list", wallet.QueryCoinList) walletR.POST("/balance/list", wallet.QueryBalanceList) walletR.POST("/balance/withdraw", wallet.UpdateWithdrawals) walletR.POST("/income/own/list", wallet.QueryOwnIncomeList) walletR.POST("/income/own/sum/list", wallet.QuerySumOwnIncomeList) walletR.POST("/income/sales/list", wallet.QuerySalesIncomeList) walletR.POST("/income/sales/sum/list", wallet.QuerySumSalesIncomeList) //walletR.POST("/income/team/list", wallet.QueryTeamIncomeList) //walletR.POST("/income/team/sum/list", wallet.QuerySumTeamIncomeList) // 瑞币转入余额 walletR.POST("/coin/coin_to_balance", wallet.CoinToBalance) // 瑞币查询 walletR.POST("/coin/coin_list", wallet.QueryCoin) // 余额提现 walletR.POST("/balance/balance_withdraw", wallet.SubmitWithdraw) // 提现列表 walletR.POST("/balance/withdraw_list", wallet.WithdrawList) // 提现详情 walletR.POST("/balance/withdraw_detail", wallet.WithdrawDetail) } applicationR := v1.Group("application") { applicationR.POST("/launch", application.LaunchApp) } activityR := v1.Group("activity") { activityR.POST("/list/query", activity.QueryActivityList) } /* 获取地理位置信息 */ regionR := v1.Group("region") { regionR.POST("/provinces", region.Provinces) regionR.GET("/provinces", region.Provinces) regionR.POST("/all", region.All) regionR.GET("/all", region.All) regionR.POST("/weather", region.Weather) } goodsR := v1.Group("goods") { goodsR.POST("/comprehensive/list", goods.QueryGoodsListByComprehension) goodsR.POST("/favorite/list", goods.QueryFavoriteGoodsList) goodsR.POST("/sales/list", goods.QueryGoodsListBySalesVolume) goodsR.POST("/price/list", goods.QueryGoodsListByDiscountPrice) goodsR.POST("/search/list", goods.SearchGoodsByKeyword) goodsR.POST("/hot_sell/list", goods.QueryHotSellGoodsList) goodsR.POST("/recommend/list", goods.QueryRecommendList) goodsR.POST("/shopping_trolley/list", goods.QueryShoppingTrolleyGoodsList) goodsR.POST("/list/promotion", goods.QueryPromotionTimeItems) // 获取抢购列表 goodsR.POST("/list/promotion/goods", goods.QueryPromotionGoodsList) //首页抢购产品明细列表 goodsR.GET("/list/promotion/goods/yesterday", goods.QueryPromotionGoodsListYesterday) //获取昨日的活动列表 goodsR.POST("/recook_make/list", goods.QueryRecookMake) goodsR.POST("/digital/list", goods.QueryDigital) goodsR.POST("/home_live/list", goods.QueryHomeLive) //goodsR.POST("/detail/summary", goods.QueryGoodsDetail) // 获取商品基本信息详情 goodsR.POST("/detail/summary_new", goods.QueryGoodsDetailNew) // 获取商品基本信息详情_new goodsR.POST("/detail/photo", goods.QueryGoodsPhotosDetail) // 获取商品图片详情 goodsR.POST("/detail/moments_copy/list", goods.QueryGoodsMomentsCopy) // 获取商品发圈文案列表 goodsR.POST("/evaluations/list", evaluation.QueryGoodsEvaluationList) // 获取商品评价列表 goodsR.POST("/code/search", goods.QueryCode) // 条形码查询商品 goodsR.POST("/list/tehui/xinren", newertehui.QueryCurrent) // 新人特惠查询 categoryR := goodsR.Group("categories") { categoryR.POST("/first", category.QueryFirstCategories) categoryR.POST("/children", category.QueryChildrenCategories) categoryR.POST("/all", category.QueryAllCategories) } shoppingCartR := goodsR.Group("shopping_trolley") { shoppingCartR.POST("/add", shopping_trolley.Create) // 加购 shoppingCartR.POST("/remove", shopping_trolley.RemoveGoods) // 删除 shoppingCartR.POST("/quantity/update", shopping_trolley.UpdateGoodsQuantity) // 更新购物车指定商品数量 } favoriteR := goodsR.Group("favorites") { favoriteR.POST("/list", favorites.QueryFavoritesList) // 收藏列表 favoriteR.POST("/add", favorites.CreateFavorites) favoriteR.POST("/cancel", favorites.UpdateCancelFavorites) // 取消收藏 } goodsR.POST("/keyWords/es", goods.KeyWordEs) //新增返回关键词 } attentionR := v1.Group("attention") { attentionR.POST("/create", attention.CreateAttention) attentionR.POST("/cancel", attention.CancelAttention) attentionR.POST("/list/moment_copy", attention.QueryMomentCopyList) attentionR.POST("/moment_copy/recommend/list", attention.QueryRecommendMomentCopyList) } momentCopyR := v1.Group("moment_copy") //发布产品评论 { momentCopyR.POST("/create", moment_copy.Create) } diamondShowR := v1.Group("diamond_show") { diamondShowR.POST("/list", diamond_show.QueryDiamondShow) } couponR := v1.Group("coupon") { couponR.POST("/list", coupon.QueryAllList) couponR.POST("/receive/user", coupon.CreateReceiveCoupon) couponR.POST("/user/list", coupon.QueryUserCouponList) } previewOrderR := v1.Group("order_preview") { previewOrderR.POST("/create", order_preview.CreatePreviewNormalOrder) previewOrderR.POST("/addr/update", order_preview.UpdateOrderAddr) previewOrderR.POST("/shopping_trolley/create", order_preview.CreatePreviewShoppingTrolleyOrder) previewOrderR.POST("/buyer_message/update", order_preview.UpdateBuyerMessage) previewOrderR.POST("/coin_onoff", order_preview.OrderCoinOnOff) } orderR := v1.Group("order") { orderR.POST("/normal/submit", order.SubmitOrder) // 提交订单 orderR.POST("/submit", order.SubmitOrder) // 提交订单 orderR.POST("/list/all", order.QueryAllOrders) // 查询所有订单 orderR.POST("/list/unpaid", order.QueryUnpaidOrders) // 查询未付款订单 orderR.POST("/list/undelivered", order.QueryUndeliveredOrders) // 查询未发货订单 orderR.POST("/list/receipt", order.QueryWaitingForReceiptOrders) // 查询待收货 orderR.POST("/list/unevaluated", order.QueryUnEvaluateOrders) // 待评价 orderR.POST("/detail", order.QueryOrderDetail) // 查询订单详情 orderR.POST("/cancel", order.CancelOrder) // 取消订单 orderR.POST("/delete", order.DeleteOrder) // 删除订单 只有取消或过期的订单可以删除 orderR.POST("/receipt/confirm", order.ConfirmOrderReceipt) // 订单确认收货 orderR.POST("/express/query", kuaidi100.QueryExpress) // 查询快递 orderR.POST("/invoice/apply", order.CreateInvoice) // 申请开票 orderR.POST("/evaluation/create", evaluation.CreateOrderEvaluation) // 订单评价 orderR.POST("/evaluation/orderEvaluationList", evaluation.OrderEvaluationList) // 订单商品评价列表 orderR.POST("/evaluation/createOrderEvaluationOne", evaluation.CreateOrderEvaluationOne) // 对单个订单产品进行评价 orderR.POST("/evaluation/evaluationDea", evaluation.EvaluationDea) // 查看评价详情 orderR.POST("/refund", aftersales.RefundOrder) // 申请退款 orderR.POST("/return", aftersales.ApplyReturnOrder) // 申请退货 orderR.POST("/cannelAfterOrder", aftersales.CannelAfterOrder) // 撤销售后的接口 orderR.POST("/get_after_sales/resson", aftersales.GetAfterSalesReason) // 获取售后理由 orderR.POST("/after_sales/express/fill", aftersales.FillAfterSalesGoodsExpress) // 填写退货订单物流信息 orderR.POST("/after_sales/goods/list", aftersales.QueryAfterSalesGoodsList) // 查询售后 orderR.POST("/after_sales/goods/detail", aftersales.QueryAfterSalesGoodsDetail) // 查询订单退货详情 orderR.POST("/after_sales/log", aftersales.QueryAfterSalesLog) // 查询订单售后日志 orderR.POST("/express/company/list", aftersales.QuerySupportExpressCompany) // 退货支持的物流公司 orderR.POST("/bill/create", bill.ActionToBill) // 申请发票 orderR.POST("/bill/canGetBill", bill.CangetBill) // 获取能开发票的产品订单 orderR.POST("/bill/getBillList", bill.GetBillList) // 获取开票列表 orderR.POST("/bill/getBillDetail", bill.GetBillDetail) // 获取单个发票详情 orderR.POST("/bill/addLetterhead", bill.AddLetterhead) // 增加抬头,编辑 orderR.POST("/bill/letterheadList", bill.LetterheadList) // 抬头列表 orderR.POST("/bill/letterheadOne", bill.LetterheadOne) // 抬头列表 } v1.POST("/official/return_address", official.QueryOfficialReturnAddress) payR := v1.Group("pay") { payR.POST("/recookpay/order/create", recookpay.PayOrder) // 余额钱包订单 payR.POST("/recookpay/fund/query", recookpay.QueryFund) // 余额查询 payR.POST("/recookpay/balance/query", recookpay.QueryBalance) // 余额查询 payR.POST("/order/query", wxpay.QueryOrderPay) // 支付状态查询 payR.POST("/alipay/order/create", alipay.PayOrder) // 创建支付宝订单 payR.POST("/alipay/callback", alipay.PayCallback) // 支付通知 payR.POST("/alipay/wap/pay", alipay.CreateH5Alipay) // H5支付宝支付 payR.POST("/alipay/h5_callback", alipay.H5Callback) // 支付通知 payR.POST("/wxpay/order/create", wxpay.PayOrder) // 微信创建订单 payR.POST("/wxpay/callback", wxpay.PayCallback) // 支付通知 payR.POST("/wxpay/refund/callback", wxpay.RefundCallback) // 退款通知 payR.POST("/wxminipay/order/create", wxminipay.PayOrder) // 微信创建订单 payR.POST("/wxminipay/callback", wxminipay.PayCallback) // 支付通知 payR.POST("/wxminipay/refund/callback", wxminipay.RefundCallback) // 退款通知 payR.POST("/wxh5pay/order/create", wxh5pay.PayOrder) // 微信创建订单 payR.POST("/wxh5pay/callback", wxh5pay.PayCallback) // 支付通知 payR.POST("/wxh5pay/refund/callback", wxh5pay.RefundCallback) // 退款通知 payR.POST("/wxh5innerpay/auth_url", wxh5innerpay.GetOpenId) //获取鉴权url payR.POST("/wxh5innerpay/code", wxh5innerpay.UpdateUserGzhOpenId) // 根据code 写入用户 gzh_open_id payR.POST("/wxh5innerpay/order/create", wxh5innerpay.PayOrder) // 微信创建订单 payR.POST("/wxh5innerpay/callback", wxh5innerpay.PayCallback) // 支付通知 payR.POST("/wxh5innerpay/refund/callback", wxh5innerpay.RefundCallback) // 退款通知 } liveR := v1.Group("live") { orderC := &live.Order{} liveR.POST("/goods/list", live.List) // 获取商品列表 liveR.POST("/goods/infos", live.Infos) // 根据商品id获取数据 liveR.POST("/goods/brandlist", live.BrandList) // 品牌列表 liveR.POST("/user/users", live.GetUsers) // ;批量获取会员基础信息 liveR.POST("/user/userinfo", live.UserInfo) // 验证会员信息 liveR.POST("/order/history", orderC.History) // 购买历史记录 liveR.POST("/order/liveorderdata", orderC.LiveOrderData) // 会员直播数据 trendC := &live.Trend{} liveR.POST("/trend/list", trendC.List) // 会员动态列表 liveR.POST("/trend/goods", trendC.Goods) // 会员动态商品 liveR.POST("/trend/info", trendC.Info) // 会员动态信息 liveR.POST("/trend/infos", trendC.Infos) // 会员动态信息列表 liveR.POST("/trend/addshort", trendC.AddShort) // 添加短视频动态 liveR.POST("/trend/change", trendC.Change) // 改变动态状态 //liveR.POST("trend/del", trendC.Del) // 删除图文 } } }