package wxapp import ( "base/app/controller/area" "base/app/controller/customer" "base/app/controller/customer/car" "base/app/controller/customer/contract" "base/app/controller/customer/message" "base/app/controller/customer/order" "base/app/controller/customer/other" "base/app/controller/customer/user" "base/app/controller/customer/user/wallet" "base/app/router/middleware" "github.com/gin-gonic/gin" ) func CustomerRouter(router *gin.RouterGroup) { // 登录 loginController := customer.Login{} { router.POST("login", loginController.Login) // 登录 router.POST("register", loginController.Register) // 注册绑定 router.POST("logoff", loginController.Logoff) // 注销 } // 地区数据 areaController := area.Area{} { router.POST("city/all", areaController.City) // 获取城市数据 router.POST("area/all", areaController.All) // 获取省市区数据 router.POST("area/version", areaController.Version) // 获取省市区数据版本 router.POST("area/list", areaController.List) // 筛选省市区数据 } // 用户 userRouter := router.Group("user", middleware.CustomerAuth) { walletRouetr := userRouter.Group("wallet") { assessController := wallet.Assess{} { walletRouetr.POST("assess/count", assessController.Count) // 获取剩余评估次数 walletRouetr.POST("assess/recharge", assessController.Recharge) // 充值 walletRouetr.POST("assess/history", assessController.History) // 评估记录列表 } } carController := user.Car{} { userRouter.POST("car/all", carController.All) // 获取车辆 userRouter.POST("car/add", carController.Add) // 添加车辆 userRouter.POST("car/info", carController.Info) // 车辆详情 userRouter.POST("car/edit", carController.Edit) // 编辑车辆 userRouter.POST("car/delete", carController.Delete) // 删除车辆 } brokerController := user.Broker{} { userRouter.POST("broker/info", brokerController.Info) // 经纪人列表 userRouter.POST("broker/change", brokerController.Change) // 更换经纪人申请 userRouter.POST("broker/search", brokerController.Search) // 搜索经纪人 } centerController := user.Center{} { userRouter.POST("center/info", centerController.Info) // 个人信息 userRouter.POST("center/realName/info", centerController.RealInfo) // 实名认证信息 userRouter.POST("center/realName", centerController.RealName) // 实名认证 userRouter.POST("center/logoff", centerController.Logoff) // 注销 } } // 文件 fileRouter := router.Group("file", middleware.CustomerAuth) { uploadController := customer.Upload{} { fileRouter.POST("upload/image", uploadController.Image) // 图片上传 fileRouter.POST("upload/file", uploadController.File) // 文件上传 } } // 车辆 carRouter := router.Group("car") { bannerController := car.Banner{} { carRouter.POST("banner/all", bannerController.All) // 轮播图列表 } brandController := car.Brand{} { carRouter.POST("brand/all", brandController.All) // 获取品牌 carRouter.POST("brand/popularize", brandController.Popularize) // 获取品牌 } seriesController := car.Series{} { carRouter.POST("series/all", seriesController.All) // 品牌下所有车系 } modelController := car.Model{} { carRouter.POST("model/all", modelController.All) // 车系下所有车型 } ocrController := car.Ocr{} { carRouter.POST("cor/vehicle", middleware.CustomerAuth, ocrController.Vehicle) // 行驶证识别 carRouter.POST("cor/idCard", middleware.CustomerAuth, ocrController.IdCard) // 身份证识别 carRouter.POST("cor/bankCard", middleware.CustomerAuth, ocrController.BankCard) // 银行卡识别 } priceController := car.Price{} { carRouter.POST("price/estimatePay", middleware.CustomerAuth, priceController.EstimatePay) // 付费估价 carRouter.POST("price/estimate", middleware.CustomerAuth, priceController.Estimate) // 估算价格 carRouter.POST("price/list", middleware.CustomerAuth, priceController.List) // 估算价格记录 carRouter.POST("price/info", middleware.CustomerAuth, priceController.Info) // 估算价格详情 carRouter.POST("price/result", middleware.CustomerAuth, priceController.Result) // 查询估算价格结果 } // 收藏 collectController := car.Collect{} { carRouter.POST("collect/lists", middleware.CustomerAuth, collectController.Lists) // 收藏列表 carRouter.POST("collect/add", middleware.CustomerAuth, collectController.Add) // 收藏车辆 carRouter.POST("collect/cancel", middleware.CustomerAuth, collectController.Cancel) // 取消收藏车辆 } carController := car.Car{} { carRouter.POST("lists", middleware.CustomerNoAuth, carController.Lists) // 车辆列表 carRouter.POST("info", middleware.CustomerNoAuth, carController.Info) // 车辆详情 carRouter.POST("parameter", middleware.CustomerNoAuth, carController.Parameter) // 车辆参数 } } // 合同 contractRouter := router.Group("contract", middleware.CustomerAuth) { consignmentController := contract.Consignment{} { contractRouter.POST("consignment/lists", consignmentController.Lists) // 寄卖合同列表 } saleController := contract.Sale{} { contractRouter.POST("sale/lists", saleController.Lists) // 售车合同列表 } //contractController := contract.Contract{} //{ // contractRouter.POST("essFile", contractController.EssFile) // 获取最新合同文件 //} } // 订单 orderRouter := router.Group("order", middleware.CustomerAuth) { // 寄卖订单 consignmentController := order.Consignment{} { orderRouter.POST("consignment/lists", consignmentController.Lists) // 寄卖订单 //orderRouter.POST("consignment/sign", consignmentController.Sign) // 签订订单合同(已废弃:交由腾讯电子签完成该流程) orderRouter.POST("consignment/signUrl", consignmentController.SignUrl) // 签订合同地址 orderRouter.POST("consignment/info", consignmentController.Info) // 订单详情 //orderRouter.POST("consignment/adjustPrice", consignmentController.AdjustPrice) // 调价 } // 买车订单 saleController := order.Sale{} { orderRouter.POST("sale/lists", saleController.Lists) // 买车订单 //orderRouter.POST("sale/sign", saleController.Sign) // 签订合同(已废弃:交由腾讯电子签完成该流程) orderRouter.POST("sale/deposit", saleController.Deposit) // 定金支付 orderRouter.POST("sale/test_report", saleController.TestReport) // 申请测试报告 orderRouter.POST("sale/down_payment", saleController.DownPayment) // 支付首付 orderRouter.POST("sale/transfer", saleController.Transfer) // 申请过户 orderRouter.POST("sale/balance_payment", saleController.BalancePayment) // 支付尾款 orderRouter.POST("sale/info", saleController.Info) // 订单详情 } // 看车邀约 inviteController := order.Invite{} { orderRouter.POST("invite/lists", inviteController.Lists) // 邀约列表 } // 直卖预约 reserveController := order.Reserve{} { orderRouter.POST("reserve/lists", reserveController.Lists) // 直卖预约 orderRouter.POST("reserve/add", reserveController.Add) // 预约卖车 } // 叫车订单 callCarController := order.CallCar{} { orderRouter.POST("call/car/lists", callCarController.Lists) // 叫车订单列表 orderRouter.POST("call/car/info", callCarController.Info) // 叫车订单详情 orderRouter.POST("call/car/pay", callCarController.Pay) // 叫车支付 orderRouter.POST("call/car/refund", callCarController.Refund) // 申请退款 } } messageController := message.Message{} { router.GET("message", middleware.CustomerAuth, messageController.Message) // 消息websocket router.POST("message/count", middleware.CustomerAuth, messageController.Count) // 未读消息统计 router.POST("message/lists", middleware.CustomerAuth, messageController.Lists) // 消息列表 router.POST("message/info", middleware.CustomerAuth, messageController.Info) // 消息详情 router.POST("message/send", middleware.CustomerAuth, messageController.TestSend) // 发送消息测试 } // app相关 wxAppRouter := router.Group("other") { wxOtherController := other.Other{} wxAppRouter.POST("h5ToWxAppCar", wxOtherController.H5ToWxAppCar) // h5跳转到看车 } }