1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package binlog
- import (
- "time"
- "eta/eta_api/global"
- "eta/eta_api/utils"
- )
- type BusinessSysInteractionLog struct {
- ID uint32 `orm:"column(id);pk" gorm:"primaryKey"`
- InteractionKey string
- InteractionVal string
- Remark string
- ModifyTime time.Time
- CreateTime time.Time
- }
- func (m *BusinessSysInteractionLog) TableName() string {
- return "business_sys_interaction_log"
- }
- var BusinessSysInteractionLogColumns = struct {
- ID string
- InteractionKey string
- InteractionVal string
- Remark string
- ModifyTime string
- CreateTime string
- }{
- ID: "id",
- InteractionKey: "interaction_key",
- InteractionVal: "interaction_val",
- Remark: "remark",
- ModifyTime: "modify_time",
- CreateTime: "create_time",
- }
- func (m *BusinessSysInteractionLog) Create() (err error) {
- o := global.DbMap[utils.DbNameIndex]
- err = o.Create(m).Error
- return
- }
- func (m *BusinessSysInteractionLog) Update(cols []string) (err error) {
- o := global.DbMap[utils.DbNameIndex]
- err = o.Model(m).Select(cols).Updates(m).Error
- return
- }
- var BinlogFileNameKey = "binlog_edb_info_filename"
- var BinlogPositionKey = "binlog_edb_info_position"
- func GetBusinessSysInteractionLogByKey(key string) (item *BusinessSysInteractionLog, err error) {
- o := global.DbMap[utils.DbNameIndex]
- sql := "SELECT * FROM business_sys_interaction_log WHERE interaction_key = ?"
- err = o.Raw(sql, key).First(&item).Error
- return
- }
|