leader.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package aftersale
  2. import (
  3. "zhiyuan/controllers/admin"
  4. "zhiyuan/controllers/aftersale/leader"
  5. "zhiyuan/middlewares"
  6. "github.com/gin-gonic/gin"
  7. )
  8. func InitLeaderRouters(r *gin.Engine, router *gin.RouterGroup) {
  9. staticPath := "public/aftersale/leader/"
  10. r.Static("/aftersale/leader/static", staticPath+"static")
  11. r.StaticFile("/aftersale/leader", staticPath+"index.html")
  12. r.StaticFile("/aftersale/leader/favicon.ico", staticPath+"favicon.ico")
  13. router = router.Group("/leader")
  14. router.POST("/login", leader.Login)
  15. router.Use(middlewares.Auth("leader"))
  16. {
  17. router.GET("/statis/order", leader.StatisOrder)
  18. router.GET("/statis/comment", leader.StatisComment)
  19. router.GET("/orders", leader.OrderList)
  20. router.GET("/orders/:id", leader.OrderInfo)
  21. router.POST("/orders/:id/finish", leader.OrderFinish)
  22. router.POST("/orders/:id/confirm", leader.OrderConfirm)
  23. router.POST("/orders/:id/schedule", leader.OrderSchedule)
  24. router.POST("/orders/:id/repair", leader.OrderRepair)
  25. router.GET("/orders/:id/repair", leader.OrderRepairInfo)
  26. router.GET("/supervisors", leader.SupervisorList)
  27. router.PUT("/supervisors/:id", leader.SupervisorEdit)
  28. router.POST("/supervisors", leader.SupervisorAdd)
  29. router.GET("/params", admin.ParamList)
  30. router.GET("/params/:param", admin.ParamInfo)
  31. router.GET("/qiniu/token", admin.QiniuToken)
  32. router.GET("/info", leader.Info)
  33. router.POST("/logout", leader.Logout)
  34. router.PUT("/password", leader.Password)
  35. router.GET("/repairs", leader.RepairCheckList)
  36. router.GET("/statis/repair", leader.StatisRepair)
  37. }
  38. }