models.go 560 B

12345678910111213141516171819202122232425262728293031
  1. package drviers
  2. type DevModel struct {
  3. Id string `json:"id" gorm:"-"`
  4. DevName string `json:"devName" gorm:"primary_key"`
  5. Type string `json:"-" gorm:"type"`
  6. GwDevId string `json:"gwDevId" gorm:"-"`
  7. }
  8. func (m *DevModel) GetType() string {
  9. return m.Type
  10. }
  11. func (m *DevModel) GetGatewayID() string {
  12. return m.GwDevId
  13. }
  14. func (m *DevModel) GetName() string {
  15. return m.DevName
  16. }
  17. func (m *DevModel) GetObject() interface{} {
  18. return m
  19. }
  20. type IModel interface {
  21. GetName() string
  22. GetType() string
  23. GetGatewayID() string
  24. GetObject() interface{}
  25. }