DeviceNotice.go 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. package Device
  2. import (
  3. _ "github.com/go-sql-driver/mysql"
  4. "time"
  5. )
  6. // 模板
  7. type DeviceNotice struct {
  8. Id int `orm:"column(ID);size(11);auto;pk"`
  9. T_class_id string `orm:"size(256);null"` // 设备序列号 KF开头,环境监测主机。 YD开头,温途监测主机
  10. T_Notice_wx string `orm:"size(256);null"` //微信公众号
  11. T_Notice_phone string `orm:"size(256);null"` //手机
  12. T_Notice_message string `orm:"size(256);null"` //短信
  13. T_Notice_mailbox string `orm:"size(256);null"` //邮箱
  14. T_State int `orm:"size(2);1"` // 0 删除 1 正常
  15. CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now_add"` //auto_now_add 第一次保存时才设置时间
  16. UpdateTime time.Time `orm:"column(update_time);type(timestamp);null;auto_now"` //auto_now 每次 model 保存时都会对时间自动更新
  17. }
  18. func (t *DeviceNotice) TableName() string {
  19. return "DeviceNotice" // 数据库名称 // ************** 替换 FormulaList **************
  20. }
  21. func init() {
  22. //注册模型
  23. //orm.RegisterModel(new(DeviceNotice))
  24. }
  25. // ---------------- 特殊方法 -------------------