dengbiao před 5 měsíci
rodič
revize
1646ec1c28
3 změnil soubory, kde provedl 41 přidání a 0 odebrání
  1. +22
    -0
      src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go
  2. +15
    -0
      src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go
  3. +4
    -0
      super_cloud_issuance/md/md_request.go

+ 22
- 0
src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go Zobrazit soubor

@@ -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"`
}

+ 15
- 0
src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go Zobrazit soubor

@@ -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)


+ 4
- 0
super_cloud_issuance/md/md_request.go Zobrazit soubor

@@ -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"`


Načítá se…
Zrušit
Uložit