From 1646ec1c28ac8f918c5334e7467930e68eea2559 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 4 Jul 2024 15:04:38 +0800 Subject: [PATCH] update --- ...ance_user_robot_with_activate_group_dao.go | 22 +++++++++++++++++++ ...uance_user_robot_with_activate_group_db.go | 15 +++++++++++++ super_cloud_issuance/md/md_request.go | 4 ++++ 3 files changed, 41 insertions(+) diff --git a/src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go b/src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go index 095695a..21f0237 100644 --- a/src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go +++ b/src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go @@ -6,7 +6,29 @@ type SuperCloudIssuanceUserRobotWithActivateGroupDao interface { GetSuperCloudIssuanceUserRobotWithActivateGroupByChatRoomId(chatRoomId string, robotId int) (m *models.SuperCloudIssuanceUserRobotWithActivateGroup, err error) GetSuperCloudIssuanceUserRobotWithActivateGroup(id int) (m *models.SuperCloudIssuanceUserRobotWithActivateGroup, err error) FindSuperCloudIssuanceUserRobotWithActivateGroup(uid, page, pageSize int, name string) (m []*models.SuperCloudIssuanceUserRobotWithActivateGroup, err error) + FindSuperCloudIssuanceUserRobotWithActivateGroupWithSource(uid, page, pageSize int) (m []*FindSuperCloudIssuanceUserRobotWithActivateGroupWithSourceResponse, total int64, err error) InsertSuperCloudIssuanceUserRobotWithActivateGroup(m *models.SuperCloudIssuanceUserRobotWithActivateGroup) (id int, err error) DelSuperCloudIssuanceUserRobotWithActivateGroup(id int) (int64, error) SaveSuperCloudIssuanceUserRobotWithActivateGroup(id interface{}, m *models.SuperCloudIssuanceUserRobotWithActivateGroup, forceColums ...string) (affected int64, err error) } + +type FindSuperCloudIssuanceUserRobotWithActivateGroupWithSourceResponse struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"` + Name string `json:"name" xorm:"not null default '' comment('群名称') VARCHAR(255)"` + RobotId int `json:"robot_id" xorm:"not null default 0 comment('机器人id') INT(11)"` + ChatRoomId string `json:"chat_room_id" xorm:"not null default '' comment('微信群id') VARCHAR(255)"` + ChatRoomOwnerWxNickname string `json:"chat_room_owner_wx_nickname" xorm:"not null default '' comment('群所有者微信昵称') VARCHAR(255)"` + ChatRoomOwnerWxHeadUrl string `json:"chat_room_owner_wx_head_url" xorm:"not null default '' comment('群所有者微信头像') VARCHAR(255)"` + ChatRoomOwner string `json:"chat_room_owner" xorm:"not null default '' comment('群所有者') VARCHAR(255)"` + MemberCount int `json:"member_count" xorm:"not null default 0 comment('群成员数') INT(11)"` + BigHeadImgUrl string `json:"big_head_img_url" xorm:"not null default '' comment('大的群头像') VARCHAR(255)"` + SmallHeadImgUrl string `json:"small_head_img_url" xorm:"not null default '' comment('小的群头像') VARCHAR(255)"` + State int `json:"state" xorm:"not null default 1 comment('状态(1正常 2暂停)') TINYINT(1)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` + + SourceActivateGroupId int `json:"source_activate_group_id" xorm:"not null default 0 comment('源头激活群id') INT(11)"` + SourceName string `json:"source_name" xorm:"not null default 0 comment('源头群名称') INT(11)"` + Desc string `json:"desc" xorm:"not null comment('源头介绍') TEXT"` +} diff --git a/src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go b/src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go index 9ecbe50..113bd56 100644 --- a/src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go +++ b/src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go @@ -15,6 +15,21 @@ type SuperCloudIssuanceUserRobotWithActivateGroupDb struct { Db *xorm.Engine } +func (s SuperCloudIssuanceUserRobotWithActivateGroupDb) FindSuperCloudIssuanceUserRobotWithActivateGroupWithSource(uid, page, pageSize int) (resp []*dao.FindSuperCloudIssuanceUserRobotWithActivateGroupWithSourceResponse, total int64, err error) { + total, err = s.Db.Table("super_cloud_issuance_user_robot_with_activate_group"). + Join("LEFT", "super_cloud_issuance_user_robot_bind_source_follow_group", "super_cloud_issuance_user_robot_with_activate_group.id = super_cloud_issuance_user_robot_bind_source_follow_group.follow_activate_group_id"). + Join("LEFT", "super_cloud_issuance_user_robot_bind_source", "super_cloud_issuance_user_robot_bind_source_follow_group.activate_group_id = super_cloud_issuance_user_robot_bind_source.activate_group_id"). + Where("super_cloud_issuance_user_robot_with_activate_group.uid = ?", uid). + OrderBy("super_cloud_issuance_user_robot_with_activate_group.id DESC"). + Cols("super_cloud_issuance_user_robot_with_activate_group.*,"+ + " super_cloud_issuance_user_robot_bind_source.activate_group_id as source_activate_group_id,"+ + " super_cloud_issuance_user_robot_bind_source.name as source_name,"+ + " super_cloud_issuance_user_robot_bind_source.desc as desc"). + Limit(pageSize, (page-1)*pageSize). + FindAndCount(&resp) + return +} + func (s SuperCloudIssuanceUserRobotWithActivateGroupDb) SaveSuperCloudIssuanceUserRobotWithActivateGroup(id interface{}, m *models.SuperCloudIssuanceUserRobotWithActivateGroup, forceColums ...string) (affected int64, err error) { if forceColums != nil { affected, err = s.Db.Where("id=?", id).Cols(forceColums...).Update(m) diff --git a/super_cloud_issuance/md/md_request.go b/super_cloud_issuance/md/md_request.go index c4af512..394fb1e 100644 --- a/super_cloud_issuance/md/md_request.go +++ b/super_cloud_issuance/md/md_request.go @@ -41,6 +41,10 @@ type SourceGroupListRequest struct { Page int `json:"page"` Limit int `json:"limit"` } +type SourceGroupIndexRequest struct { + Page int `json:"page"` + Limit int `json:"limit"` +} type PreviewSourceRequest struct { ActivateGroupId int `json:"activate_group_id"` Page int `json:"page"`