net.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package net
  2. import (
  3. "time"
  4. )
  5. const (
  6. // TableNet .
  7. TableNet = "net"
  8. )
  9. // Recovered .
  10. var Recovered = time.Time{}
  11. // Net net.
  12. type Net struct {
  13. ID int64 `gorm:"primary_key" json:"id" form:"id" validate:"omitempty,gt=0"`
  14. BusinessID int64 `gorm:"column:business_id" json:"business_id" form:"business_id" validate:"omitempty,gt=0"`
  15. ChName string `gorm:"column:ch_name" json:"ch_name" form:"ch_name" validate:"required,max=32"`
  16. Description string `gorm:"column:description" json:"description" form:"description" validate:"max=60"`
  17. StartFlowID int64 `gorm:"column:start_flow_id" json:"start_flow_id" form:"start_flow_id"`
  18. PID int64 `gorm:"column:pid" json:"pid"`
  19. UID int64 `gorm:"column:uid" json:"uid"`
  20. DisableTime time.Time `gorm:"column:disable_time" json:"disable_time"`
  21. Ctime time.Time `gorm:"column:ctime" json:"ctime"`
  22. Mtime time.Time `gorm:"column:mtime" json:"mtime"`
  23. }
  24. //TableName table name
  25. func (n *Net) TableName() string {
  26. return TableNet
  27. }
  28. // IsAvailable .
  29. func (n *Net) IsAvailable() bool {
  30. return n.DisableTime.IsZero()
  31. }