group.go 746 B

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "IotAdmin/common/models"
  4. )
  5. // IotGroup 分组实体
  6. type IotGroup struct {
  7. models.Model
  8. ParentId int `json:"parentId" gorm:"type:bigint(20);comment:父ID"`
  9. Path string `json:"path" gorm:"type:varchar(255);comment:分组路径"`
  10. Name string `json:"name" gorm:"type:varchar(255);comment:分组名称"`
  11. Description string `json:"description" gorm:"type:varchar(255);comment:分组描述"`
  12. Children []IotGroup `json:"children,omitempty" gorm:"-"`
  13. models.ControlBy
  14. models.ModelTime
  15. }
  16. func (*IotGroup) TableName() string {
  17. return "iot_group"
  18. }
  19. func (e *IotGroup) Generate() models.ActiveRecord {
  20. o := *e
  21. return &o
  22. }
  23. func (e *IotGroup) GetId() interface{} {
  24. return e.Id
  25. }