@@ -0,0 +1,8 @@ | |||||
package dao | |||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
type ImGroupBatchSendMessageRecordsDao interface { | |||||
ImGroupBatchSendMessageRecordsInsert(m *model.ImGroupBatchSendMessageRecords) (int, error) | |||||
ImGroupBatchSendMessageRecordsUpdate(id interface{}, m *model.ImGroupBatchSendMessageRecords, forceColums ...string) (int64, error) | |||||
} |
@@ -0,0 +1,8 @@ | |||||
package dao | |||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
type ImUserBatchSendMessageRecordsDao interface { | |||||
ImUserBatchSendMessageRecordsInsert(m *model.ImUserBatchSendMessageRecords) (int, error) | |||||
ImUserBatchSendMessageRecordsUpdate(id interface{}, m *model.ImUserBatchSendMessageRecords, forceColums ...string) (int64, error) | |||||
} |
@@ -0,0 +1,40 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewImGroupBatchSendMessageRecordsDb(engine *xorm.Engine) dao.ImGroupBatchSendMessageRecordsDao { | |||||
return &ImGroupBatchSendMessageRecordsDb{Db: engine} | |||||
} | |||||
type ImGroupBatchSendMessageRecordsDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func (i ImGroupBatchSendMessageRecordsDb) ImGroupBatchSendMessageRecordsInsert(m *model.ImGroupBatchSendMessageRecords) (int, error) { | |||||
_, err := i.Db.InsertOne(m) | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return m.Id, nil | |||||
} | |||||
func (i ImGroupBatchSendMessageRecordsDb) ImGroupBatchSendMessageRecordsUpdate(id interface{}, m *model.ImGroupBatchSendMessageRecords, forceColums ...string) (int64, error) { | |||||
var ( | |||||
affected int64 | |||||
err error | |||||
) | |||||
if forceColums != nil { | |||||
affected, err = i.Db.Where("id=?", id).MustCols(forceColums...).Update(m) | |||||
} else { | |||||
affected, err = i.Db.Where("id=?", id).Update(m) | |||||
} | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return affected, nil | |||||
} |
@@ -0,0 +1,40 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewImUserBatchSendMessageRecordsDb(engine *xorm.Engine) dao.ImUserBatchSendMessageRecordsDao { | |||||
return &ImUserBatchSendMessageRecordsDb{Db: engine} | |||||
} | |||||
type ImUserBatchSendMessageRecordsDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func (i ImUserBatchSendMessageRecordsDb) ImUserBatchSendMessageRecordsInsert(m *model.ImUserBatchSendMessageRecords) (int, error) { | |||||
_, err := i.Db.InsertOne(m) | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return m.Id, nil | |||||
} | |||||
func (i ImUserBatchSendMessageRecordsDb) ImUserBatchSendMessageRecordsUpdate(id interface{}, m *model.ImUserBatchSendMessageRecords, forceColums ...string) (int64, error) { | |||||
var ( | |||||
affected int64 | |||||
err error | |||||
) | |||||
if forceColums != nil { | |||||
affected, err = i.Db.Where("id=?", id).MustCols(forceColums...).Update(m) | |||||
} else { | |||||
affected, err = i.Db.Where("id=?", id).Update(m) | |||||
} | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return affected, nil | |||||
} |
@@ -0,0 +1,15 @@ | |||||
package model | |||||
type ImGroupBatchSendMessageRecords struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr comment('主键id') INT(11)"` | |||||
SendKind int `json:"send_kind" xorm:"not null default 1 comment('发送模式(1:指定群组 2:所有群组)') TINYINT(1)"` | |||||
GroupId string `json:"group_id" xorm:"not null comment('群组id(以;切割)') TEXT"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)') TINYINT(1)"` | |||||
Content string `json:"content" xorm:"comment('消息内容') TEXT"` | |||||
SendTime string `json:"send_time" xorm:"not null default 'CURRENT_TIMESTAMP(3)' comment('消息发送时间') DATETIME(3)"` | |||||
State int `json:"state" xorm:"not null default 0 comment('消息状态,1:正常 2:失败') TINYINT(3)"` | |||||
SendCondition string `json:"send_condition" xorm:"not null comment('发送条件') TEXT"` | |||||
NotCondition string `json:"not_condition" xorm:"not null comment('不发送条件') TEXT"` | |||||
CreateTime string `json:"create_time" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateTime string `json:"update_time" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package model | |||||
type ImUserBatchSendMessageRecords struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr comment('主键id') INT(11)"` | |||||
SendKind int `json:"send_kind" xorm:"not null default 1 comment('发送模式(1:所有用户 2:指定用户)') TINYINT(1)"` | |||||
Uid string `json:"uid" xorm:"not null comment('uid(以;切割)') TEXT"` | |||||
ImUid string `json:"im_uid" xorm:"not null comment('im-uid(以;切割)') TEXT"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)') TINYINT(1)"` | |||||
Content string `json:"content" xorm:"comment('消息内容') TEXT"` | |||||
SendTime string `json:"send_time" xorm:"not null default 'CURRENT_TIMESTAMP(3)' comment('消息发送时间') DATETIME(3)"` | |||||
State int `json:"state" xorm:"not null default 0 comment('消息状态,1:正常 2:失败') TINYINT(3)"` | |||||
SendCondition string `json:"send_condition" xorm:"not null comment('发送条件') TEXT"` | |||||
NotCondition string `json:"not_condition" xorm:"not null comment('不发送条件') TEXT"` | |||||
CreateTime string `json:"create_time" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateTime string `json:"update_time" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |