From fadfa03382ffc3e88787d5721574c18e2a2f8dfb Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 28 Nov 2024 15:24:41 +0800 Subject: [PATCH] update --- ...im_group_batch_send_message_records_dao.go | 8 ++++ .../im_user_batch_send_message_records_dao.go | 8 ++++ ...up_batch_send_message_records_implement.go | 40 +++++++++++++++++++ ...er_batch_send_message_records_implement.go | 40 +++++++++++++++++++ .../im_group_batch_send_message_records.go | 15 +++++++ .../im_user_batch_send_message_records.go | 16 ++++++++ 6 files changed, 127 insertions(+) create mode 100644 src/dao/im_group_batch_send_message_records_dao.go create mode 100644 src/dao/im_user_batch_send_message_records_dao.go create mode 100644 src/implement/im_group_batch_send_message_records_implement.go create mode 100644 src/implement/im_user_batch_send_message_records_implement.go create mode 100644 src/model/im_group_batch_send_message_records.go create mode 100644 src/model/im_user_batch_send_message_records.go diff --git a/src/dao/im_group_batch_send_message_records_dao.go b/src/dao/im_group_batch_send_message_records_dao.go new file mode 100644 index 0000000..6a17701 --- /dev/null +++ b/src/dao/im_group_batch_send_message_records_dao.go @@ -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) +} diff --git a/src/dao/im_user_batch_send_message_records_dao.go b/src/dao/im_user_batch_send_message_records_dao.go new file mode 100644 index 0000000..50306c3 --- /dev/null +++ b/src/dao/im_user_batch_send_message_records_dao.go @@ -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) +} diff --git a/src/implement/im_group_batch_send_message_records_implement.go b/src/implement/im_group_batch_send_message_records_implement.go new file mode 100644 index 0000000..440d7c6 --- /dev/null +++ b/src/implement/im_group_batch_send_message_records_implement.go @@ -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 +} diff --git a/src/implement/im_user_batch_send_message_records_implement.go b/src/implement/im_user_batch_send_message_records_implement.go new file mode 100644 index 0000000..9bdfa55 --- /dev/null +++ b/src/implement/im_user_batch_send_message_records_implement.go @@ -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 +} diff --git a/src/model/im_group_batch_send_message_records.go b/src/model/im_group_batch_send_message_records.go new file mode 100644 index 0000000..a4a8c4e --- /dev/null +++ b/src/model/im_group_batch_send_message_records.go @@ -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"` +} diff --git a/src/model/im_user_batch_send_message_records.go b/src/model/im_user_batch_send_message_records.go new file mode 100644 index 0000000..f3cc393 --- /dev/null +++ b/src/model/im_user_batch_send_message_records.go @@ -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"` +}