api.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package manage
  2. import (
  3. "Cold_Logistic/internal/server/adapter/http/middleware"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func Register(r *gin.RouterGroup) {
  7. api := NewApi()
  8. // 公共接口
  9. common := r.Group("/common")
  10. common.Use(middleware.ManageAuth(), middleware.PlatformAccount())
  11. common.POST("/userList", api.userList) // 冷链系统3.0用户列表
  12. common.POST("/deviceSensorList", api.deviceSensorList)
  13. common.POST("/sensorDataList", api.snDataList)
  14. // 车辆管理
  15. car := r.Group("/car")
  16. car.Use(middleware.ManageAuth(), middleware.PlatformAccount(), middleware.ManagePermis())
  17. car.POST("/page", api.carPage)
  18. car.POST("/add", api.addCar)
  19. car.POST("/update", api.updateCar)
  20. car.POST("/driverLog", api.driverLog)
  21. // 仓库管理
  22. warehouse := r.Group("/warehouse")
  23. warehouse.Use(middleware.ManageAuth(), middleware.PlatformAccount(), middleware.ManagePermis())
  24. warehouse.POST("/page", api.warehousePage)
  25. warehouse.POST("/add", api.addWarehouse)
  26. warehouse.POST("/update", api.updateWarehouse)
  27. warehouse.POST("/orderPage", api.warehouseOrder)
  28. // 订单管理
  29. order := r.Group("/order")
  30. order.Use(middleware.ManageAuth(), middleware.PlatformAccount(), middleware.ManagePermis())
  31. order.POST("/page", api.orderPage)
  32. order.POST("/detail", api.orderDetail)
  33. order.POST("/logistic", api.orderLogistic)
  34. order.POST("/assign", api.orderAssign)
  35. // 统计
  36. stat := r.Group("/statistic")
  37. stat.POST("/orderNum/byTime", api.statOrderNumByTime)
  38. stat.POST("/orderNum/byUser", api.statOrderNumByUser)
  39. return
  40. }
  41. type Api struct{}
  42. func NewApi() Api {
  43. return Api{}
  44. }