Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

master
huangjiajun před 4 měsíci
rodič
revize
164655272b
11 změnil soubory, kde provedl 89 přidání a 33 odebrání
  1. +0
    -1
      src/dao/super_cloud_issuance_add_group_welcome_message_dao.go
  2. +0
    -1
      src/dao/super_cloud_issuance_keyword_reply_with_activate_group_dao.go
  3. +20
    -17
      src/dao/super_cloud_issuance_user_robot_bind_group_dao.go
  4. +22
    -0
      src/dao/super_cloud_issuance_user_robot_with_activate_group_dao.go
  5. +2
    -1
      src/implement/super_cloud_issuance_add_group_welcome_message_db.go
  6. +2
    -1
      src/implement/super_cloud_issuance_keyword_reply_with_activate_group_db.go
  7. +1
    -1
      src/implement/super_cloud_issuance_package_ord_db.go
  8. +9
    -7
      src/implement/super_cloud_issuance_user_robot_bind_group_db.go
  9. +5
    -4
      src/implement/super_cloud_issuance_user_robot_bind_source_follow_group_db.go
  10. +15
    -0
      src/implement/super_cloud_issuance_user_robot_with_activate_group_db.go
  11. +13
    -0
      super_cloud_issuance/md/md_request.go

+ 0
- 1
src/dao/super_cloud_issuance_add_group_welcome_message_dao.go Zobrazit soubor

@@ -12,7 +12,6 @@ type SuperCloudIssuanceAddGroupWelcomeMessageDao interface {
}

type FindSuperCloudIssuanceAddGroupWelcomeMessageResponse struct {
Id int `json:"id" xorm:"not null pk autoincr comment('自增id') INT(11)"`
ActivateGroupId int `json:"activate_group_id" xorm:"not null default 0 comment('绑定激活群id') INT(11)"`
Content string `json:"content" xorm:"not null default '' comment('内容') VARCHAR(255)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1正常 2暂停)') TINYINT(1)"`


+ 0
- 1
src/dao/super_cloud_issuance_keyword_reply_with_activate_group_dao.go Zobrazit soubor

@@ -10,7 +10,6 @@ type SuperCloudIssuanceKeywordReplyWithActivateGroupDao interface {
}

type FindSuperCloudIssuanceKeywordReplyWithActivateGroupResponse struct {
Id int `json:"id" xorm:"not null pk autoincr comment('自增id') INT(11)"`
ActivateGroupId int `json:"activate_group_id" xorm:"not null default 0 comment('绑定激活群id') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1正常 2暂停)') TINYINT(1)"`
IsFollowOfficial int `json:"is_follow_official"`


+ 20
- 17
src/dao/super_cloud_issuance_user_robot_bind_group_dao.go Zobrazit soubor

@@ -2,32 +2,35 @@

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
"time"
"xorm.io/xorm"
)

type SuperCloudIssuanceUserRobotBindGroupDao interface {
GetSuperCloudIssuanceUserRobotBindGroup(id int) (m *models.SuperCloudIssuanceUserRobotBindGroup, err error)
GetSuperCloudIssuanceUserRobotBindGroupByChatRoomId(chatRoomId string) (m *models.SuperCloudIssuanceUserRobotBindGroup, err error)
InsertSuperCloudIssuanceUserRobotBindGroup(m *models.SuperCloudIssuanceUserRobotBindGroup) (id int, err error)
InsertSuperCloudIssuanceUserRobotBindGroup(sess *xorm.Session, m *models.SuperCloudIssuanceUserRobotBindGroup) (id int, err error)
SaveSuperCloudIssuanceUserRobotBindGroup(id interface{}, m *models.SuperCloudIssuanceUserRobotBindGroup, forceColums ...string) (affected int64, err error)
DeleteSuperCloudIssuanceUserRobotBindGroup(id interface{}) (affected int64, err error)
FindSuperCloudIssuanceUserRobotBindGroup() (resp []*FindCloudIssuanceUserRobotBindGroupResponse, total int64, err error)
FindSuperCloudIssuanceUserRobotBindGroup(page, pageSize int) (resp []*FindCloudIssuanceUserRobotBindGroupResponse, total int64, err error)
FindSuperCloudIssuanceUserRobotBindGroupByCategory(categoryId int) (m []*models.SuperCloudIssuanceUserRobotBindGroup, err error)
}

type FindCloudIssuanceUserRobotBindGroupResponse struct {
Id int `json:"id" `
Uid int `json:"uid"`
Name string `json:"name"`
RobotId int `json:"robot_id"`
ChatRoomId string `json:"chat_room_id"`
ChatRoomOwner string `json:"chat_room_owner"`
MemberCount int `json:"member_count"`
BigHeadImgUrl string `json:"big_head_img_url"`
SmallHeadImgUrl string `json:"small_head_img_url"`
GoodsCategoryId int `json:"goods_category_id"`
State int `json:"state"`
GoodsCategoryName string `json:"goods_category_name"`
CreateAt time.Time `json:"create_at"`
UpdateAt time.Time `json:"update_at"`
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"`

GoodsCategoryId int `json:"goods_category_id"`
GoodsCategoryName string `json:"goods_category_name"`
}

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

+ 2
- 1
src/implement/super_cloud_issuance_add_group_welcome_message_db.go Zobrazit soubor

@@ -20,7 +20,8 @@ func (s SuperCloudIssuanceAddGroupWelcomeMessageDb) FindSuperCloudIssuanceAddGro
Join("LEFT", "super_cloud_issuance_add_group_welcome_message", "super_cloud_issuance_user_robot_with_activate_group.id = super_cloud_issuance_add_group_welcome_message.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_add_group_welcome_message.*,"+
Cols("super_cloud_issuance_add_group_welcome_message.content, super_cloud_issuance_add_group_welcome_message.state,"+
" super_cloud_issuance_user_robot_with_activate_group.id as activate_group_id,"+
" super_cloud_issuance_user_robot_with_activate_group.uid,"+
" super_cloud_issuance_user_robot_with_activate_group.name,"+
" super_cloud_issuance_user_robot_with_activate_group.robot_id,"+


+ 2
- 1
src/implement/super_cloud_issuance_keyword_reply_with_activate_group_db.go Zobrazit soubor

@@ -32,7 +32,8 @@ func (s SuperCloudIssuanceKeywordReplyWithActivateGroupDb) FindSuperCloudIssuanc
Join("LEFT", "super_cloud_issuance_keyword_reply_with_activate_group", "super_cloud_issuance_user_robot_with_activate_group.id = super_cloud_issuance_keyword_reply_with_activate_group.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_keyword_reply_with_activate_group.*,"+
Cols("super_cloud_issuance_keyword_reply_with_activate_group.state,super_cloud_issuance_keyword_reply_with_activate_group.is_follow_official,"+
" super_cloud_issuance_user_robot_with_activate_group.id as activate_group_id,"+
" super_cloud_issuance_user_robot_with_activate_group.uid,"+
" super_cloud_issuance_user_robot_with_activate_group.name,"+
" super_cloud_issuance_user_robot_with_activate_group.robot_id,"+


+ 1
- 1
src/implement/super_cloud_issuance_package_ord_db.go Zobrazit soubor

@@ -36,7 +36,7 @@ func (s SuperCloudIssuancePackageOrdDb) SaveCloudIssuancePackageOrd(id interface

func (s SuperCloudIssuancePackageOrdDb) UserOrdList(uid interface{}, req md.BuyPackageRecordsRequest) (resp []*md.BuyPackageRecordsResponse, total int64, err error) {
total, err = s.Db.Table("super_cloud_issuance_package_ord").
Join("INNER", "super_cloud_issuance_package_ord", "super_cloud_issuance_package_ord.package_id = super_cloud_issuance_robot_package.id").
Join("INNER", "super_cloud_issuance_robot_package", "super_cloud_issuance_package_ord.package_id = super_cloud_issuance_robot_package.id").
Where("super_cloud_issuance_package_ord.uid = ?", uid).
OrderBy("super_cloud_issuance_package_ord.id DESC").
Cols("super_cloud_issuance_package_ord.*, super_cloud_issuance_robot_package.name as package_name").


+ 9
- 7
src/implement/super_cloud_issuance_user_robot_bind_group_db.go Zobrazit soubor

@@ -43,8 +43,8 @@ func (s SuperCloudIssuanceUserRobotBindGroupDb) GetSuperCloudIssuanceUserRobotBi
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindGroupDb) InsertSuperCloudIssuanceUserRobotBindGroup(m *models.SuperCloudIssuanceUserRobotBindGroup) (id int, err error) {
_, err = s.Db.InsertOne(m)
func (s SuperCloudIssuanceUserRobotBindGroupDb) InsertSuperCloudIssuanceUserRobotBindGroup(sess *xorm.Session, m *models.SuperCloudIssuanceUserRobotBindGroup) (id int, err error) {
_, err = sess.InsertOne(m)
if err != nil {
return 0, err
}
@@ -69,12 +69,14 @@ func (s SuperCloudIssuanceUserRobotBindGroupDb) DeleteSuperCloudIssuanceUserRobo
return 1, nil
}

func (s SuperCloudIssuanceUserRobotBindGroupDb) FindSuperCloudIssuanceUserRobotBindGroup() (resp []*dao.FindCloudIssuanceUserRobotBindGroupResponse, total int64, err error) {
total, err = s.Db.Table("super_cloud_issuance_user_robot_bind_group").
func (s SuperCloudIssuanceUserRobotBindGroupDb) FindSuperCloudIssuanceUserRobotBindGroup(page, pageSize int) (resp []*dao.FindCloudIssuanceUserRobotBindGroupResponse, 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_group", "super_cloud_issuance_user_robot_with_activate_group.id = super_cloud_issuance_user_robot_bind_group.activate_group_id").
Join("LEFT", "super_cloud_issuance_goods_category", "super_cloud_issuance_user_robot_bind_group.goods_category_id = super_cloud_issuance_goods_category.id").
Where("super_cloud_issuance_user_robot_bind_group.uid = ?", s.Uid).
OrderBy("super_cloud_issuance_user_robot_bind_group.id DESC").
Cols("super_cloud_issuance_user_robot_bind_group.*, super_cloud_issuance_goods_category.name as goods_category_name").
Where("super_cloud_issuance_user_robot_with_activate_group.uid = ?", s.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_group.activate_group_id, super_cloud_issuance_goods_category.name as goods_category_name").
Limit(pageSize, (page-1)*pageSize).
FindAndCount(&resp)
return
}


+ 5
- 4
src/implement/super_cloud_issuance_user_robot_bind_source_follow_group_db.go Zobrazit soubor

@@ -6,16 +6,17 @@ import (
"xorm.io/xorm"
)

func NewSuperCloudIssuanceUserRobotBindSourceFollowGroupDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindSourceFollowGroupDao {
return &SuperCloudIssuanceUserRobotBindSourceFollowGroupDb{Db: engine}
func NewSuperCloudIssuanceUserRobotBindSourceFollowGroupDb(engine *xorm.Engine, session *xorm.Session) dao.SuperCloudIssuanceUserRobotBindSourceFollowGroupDao {
return &SuperCloudIssuanceUserRobotBindSourceFollowGroupDb{Db: engine, Session: session}
}

type SuperCloudIssuanceUserRobotBindSourceFollowGroupDb struct {
Db *xorm.Engine
Db *xorm.Engine
Session *xorm.Session
}

func (s SuperCloudIssuanceUserRobotBindSourceFollowGroupDb) BatchAddSuperCloudIssuanceUserRobotBindSourceFollowGroups(data []*models.SuperCloudIssuanceUserRobotBindSourceFollowGroup) (int64, error) {
affected, err := s.Db.Insert(data)
affected, err := s.Session.Insert(data)
if err != nil {
return 0, err
}


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


+ 13
- 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"`
@@ -189,3 +193,12 @@ type GroupManageWhiteWithUserSaveRequest struct {
ActivateGroupId int `json:"activate_group_id"`
WxIds []string `json:"wc_ids"`
}

type OneClickGroupSendIndexRequest struct {
Page int `json:"page"`
Limit int `json:"limit"`
}
type OneClickGroupSendBindCategoryRequest struct {
ActivateGroupId int `json:"activate_group_id"`
CategoryId int `json:"category_id"`
}

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