servicer.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package aftersale
  2. import (
  3. "zhiyuan/controllers/admin"
  4. "zhiyuan/controllers/admin/aftersale"
  5. "zhiyuan/controllers/admin/material"
  6. "zhiyuan/controllers/aftersale/servicer"
  7. "zhiyuan/middlewares"
  8. "github.com/gin-gonic/gin"
  9. )
  10. func InitServicerRouters(r *gin.Engine, router *gin.RouterGroup) {
  11. staticPath := "public/aftersale/servicer/"
  12. r.Static("/aftersale/servicer/static", staticPath+"static")
  13. r.StaticFile("/aftersale/servicer", staticPath+"index.html")
  14. r.StaticFile("/aftersale/servicer/favicon.ico", staticPath+"favicon.ico")
  15. router = router.Group("/servicer")
  16. router.POST("/login", servicer.Login)
  17. router.Use(middlewares.Auth("servicer"))
  18. {
  19. router.GET("/leaders", servicer.LeaderList)
  20. router.GET("/statis/order", servicer.StatisOrder)
  21. router.GET("/orders", servicer.OrderList)
  22. router.GET("/orders/:id", servicer.OrderInfo)
  23. router.DELETE("/orders/:id", servicer.OrderDel)
  24. router.POST("/orders/:id/allot", servicer.OrderAllot)
  25. router.PUT("/orders/:id/allot", servicer.OrderAllot)
  26. router.POST("/orders/:id/check", servicer.OrderCheck)
  27. router.POST("/orders/:id/issue", aftersale.OrderAddIssue)
  28. router.POST("/orders/:id/complete", servicer.OrderComplete)
  29. router.POST("/orders/:id/suspend", servicer.OrderSuspend)
  30. router.GET("/order_visits/:id", servicer.OrderVisitInfo)
  31. router.POST("/order_visits", servicer.OrderVisitAdd)
  32. router.PUT("/order_visits/:id", servicer.OrderVisitEdit)
  33. router.DELETE("/order_visits/:id", servicer.OrderVisitDel)
  34. router.GET("/qiniu/token", admin.QiniuToken)
  35. router.GET("/params/:param", admin.ParamInfo)
  36. router.GET("/issues", aftersale.IssueList)
  37. router.POST("/issues", aftersale.IssueAdd)
  38. router.GET("/brands", material.BrandList)
  39. router.POST("/brands", material.BrandAdd)
  40. router.GET("/info", servicer.Info)
  41. router.POST("/logout", servicer.Logout)
  42. router.PUT("/password", servicer.Password)
  43. router.GET("/repairs", servicer.RepairCheckList)
  44. router.GET("/workorders", servicer.WorkOrderList)
  45. router.GET("/statis/repair", servicer.StatisRepair)
  46. router.POST("/repair/:id/check", servicer.RepairCheck)
  47. router.GET("/statis/extension", servicer.StatisExtension)
  48. router.POST("/extension/:id/check", servicer.ExtensionCheck)
  49. }
  50. }