lightController.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "iot_manager_service/app/service"
  5. "iot_manager_service/app/utils"
  6. "net/http"
  7. "strconv"
  8. )
  9. // 灯控基本信息管理对象
  10. var Light = new(lightCtl)
  11. type lightCtl struct{}
  12. func (c *lightCtl) Detail(ctx *gin.Context) {
  13. id, e := strconv.Atoi(ctx.Query("id"))
  14. if e != nil {
  15. ctx.JSON(http.StatusOK, utils.ParamsInvalidResponse(e.Error(), nil))
  16. return
  17. }
  18. device, err := service.LightControlService.Get(id)
  19. if err != nil {
  20. ctx.JSON(http.StatusOK, err)
  21. return
  22. }
  23. ctx.JSON(http.StatusOK, utils.SuccessResponse(utils.Succeeded, device))
  24. }
  25. func (c *lightCtl) List(ctx *gin.Context) {
  26. }
  27. func (c *lightCtl) CreateOrUpdate(ctx *gin.Context) {
  28. }
  29. func (c *lightCtl) Remove(ctx *gin.Context) {
  30. }
  31. func (c *lightCtl) ImportExcel(ctx *gin.Context) {
  32. }
  33. func (c *lightCtl) ExportExcel(ctx *gin.Context) {
  34. }
  35. func (c *lightCtl) ExportTemplate(ctx *gin.Context) {
  36. }
  37. func (c *lightCtl) GetList(ctx *gin.Context) {
  38. }
  39. func (c *lightCtl) Enable(ctx *gin.Context) {
  40. }
  41. func (c *lightCtl) Switch(ctx *gin.Context) {
  42. }