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