device.go 903 B

1234567891011121314151617181920212223242526
  1. package admin
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "server/api/v1"
  5. "server/middleware"
  6. )
  7. type DeviceRouter struct{}
  8. func (dr *DeviceRouter) InitDeviceRouter(Router *gin.RouterGroup) {
  9. deviceRouter := Router.Group("device").Use(middleware.OperationRecord())
  10. deviceRouterWithoutRecord := Router.Group("device")
  11. deviceRouterApi := v1.ApiGroupApp.AdminApiGroup.DeviceApi
  12. {
  13. deviceRouter.POST("queryDeviceList", deviceRouterApi.QueryDeviceList)
  14. deviceRouter.POST("createDevice", deviceRouterApi.CreateDevice)
  15. deviceRouter.POST("deviceSwitch", deviceRouterApi.DeviceSwitch)
  16. deviceRouter.PUT("updateDevice", deviceRouterApi.UpdateDevice)
  17. deviceRouter.DELETE("deleteDevice", deviceRouterApi.DeleteDevice)
  18. }
  19. {
  20. deviceRouterWithoutRecord.GET("queryAllDevices", deviceRouterApi.QueryAllDevices)
  21. deviceRouterWithoutRecord.GET("generateDeviceFile", deviceRouterApi.GenerateDeviceFile)
  22. }
  23. }