device.go 837 B

12345678910111213141516171819202122232425
  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.PUT("updateDevice", deviceRouterApi.UpdateDevice)
  16. deviceRouter.DELETE("deleteDevice", deviceRouterApi.DeleteDevice)
  17. }
  18. {
  19. deviceRouterWithoutRecord.GET("queryAllDevices", deviceRouterApi.QueryAllDevices)
  20. deviceRouterWithoutRecord.GET("generateDeviceFile", deviceRouterApi.GenerateDeviceFile)
  21. }
  22. }