package aftersale import ( "zhiyuan/controllers/admin" "zhiyuan/controllers/admin/aftersale" "zhiyuan/controllers/admin/material" "zhiyuan/controllers/aftersale/servicer" "zhiyuan/middlewares" "github.com/gin-gonic/gin" ) func InitServicerRouters(r *gin.Engine, router *gin.RouterGroup) { staticPath := "public/aftersale/servicer/" r.Static("/aftersale/servicer/static", staticPath+"static") r.StaticFile("/aftersale/servicer", staticPath+"index.html") r.StaticFile("/aftersale/servicer/favicon.ico", staticPath+"favicon.ico") router = router.Group("/servicer") router.POST("/login", servicer.Login) router.Use(middlewares.Auth("servicer")) { router.GET("/leaders", servicer.LeaderList) router.GET("/statis/order", servicer.StatisOrder) router.GET("/orders", servicer.OrderList) router.GET("/orders/:id", servicer.OrderInfo) router.DELETE("/orders/:id", servicer.OrderDel) router.POST("/orders/:id/allot", servicer.OrderAllot) router.PUT("/orders/:id/allot", servicer.OrderAllot) router.POST("/orders/:id/check", servicer.OrderCheck) router.POST("/orders/:id/issue", aftersale.OrderAddIssue) router.POST("/orders/:id/complete", servicer.OrderComplete) router.POST("/orders/:id/suspend", servicer.OrderSuspend) router.GET("/order_visits/:id", servicer.OrderVisitInfo) router.POST("/order_visits", servicer.OrderVisitAdd) router.PUT("/order_visits/:id", servicer.OrderVisitEdit) router.DELETE("/order_visits/:id", servicer.OrderVisitDel) router.GET("/qiniu/token", admin.QiniuToken) router.GET("/params/:param", admin.ParamInfo) router.GET("/issues", aftersale.IssueList) router.POST("/issues", aftersale.IssueAdd) router.GET("/brands", material.BrandList) router.POST("/brands", material.BrandAdd) router.GET("/info", servicer.Info) router.POST("/logout", servicer.Logout) router.PUT("/password", servicer.Password) router.GET("/repairs", servicer.RepairCheckList) router.GET("/workorders", servicer.WorkOrderList) router.GET("/statis/repair", servicer.StatisRepair) router.POST("/repair/:id/check", servicer.RepairCheck) router.GET("/statis/extension", servicer.StatisExtension) router.POST("/extension/:id/check", servicer.ExtensionCheck) } }