Browse Source

update

master
dengbiao 4 months ago
parent
commit
1fa71e6dfa
10 changed files with 256 additions and 16 deletions
  1. +5
    -1
      src/dao/super_cloud_issuance_package_ord_dao.go
  2. +9
    -1
      src/dao/super_cloud_issuance_user_robot_bind_follow_dao.go
  3. +8
    -1
      src/dao/super_cloud_issuance_user_robot_bind_follow_group_dao.go
  4. +9
    -1
      src/dao/super_cloud_issuance_user_robot_bind_follow_user_dao.go
  5. +24
    -5
      src/implement/super_cloud_issuance_package_ord_db.go
  6. +60
    -2
      src/implement/super_cloud_issuance_user_robot_bind_follow_db.go
  7. +58
    -2
      src/implement/super_cloud_issuance_user_robot_bind_follow_group_db.go
  8. +62
    -2
      src/implement/super_cloud_issuance_user_robot_bind_follow_user_db.go
  9. +1
    -1
      src/models/super_cloud_issuance_user_robot_bind_source.go
  10. +20
    -0
      super_cloud_issuance/md/md_request.go

+ 5
- 1
src/dao/super_cloud_issuance_package_ord_dao.go View File

@@ -1,7 +1,11 @@
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/super_cloud_issuance/md"
)

type SuperCloudIssuancePackageOrdDao interface {
GetCloudIssuancePackageOrd(ordNo string) (m *models.SuperCloudIssuancePackageOrd, err error)
UserOrdList(uid interface{}, req md.BuyPackageRecordsRequest) (resp []*md.BuyPackageRecordsResponse, total int64, err error)
}

+ 9
- 1
src/dao/super_cloud_issuance_user_robot_bind_follow_dao.go View File

@@ -1,5 +1,13 @@
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceUserRobotBindFollowDao interface {
//TODO:: You can add specific method definitions here
GetCloudIssuanceUserRobotBindFollow(id int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error)
GetCloudIssuanceUserRobotBindFollowByChatRoomId(chatRoomId string, robotId int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error)
InsertCloudIssuanceUserRobotBindFollow(m *models.SuperCloudIssuanceUserRobotBindFollow) (id int, err error)
SaveCloudIssuanceUserRobotBindFollow(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollow, forceColums ...string) (affected int64, err error)
DeleteCloudIssuanceUserRobotBindFollow(id interface{}) (affected int64, err error)
CountCloudIssuanceUserRobotBindFollow(uid int) (total int64, err error)
//FindCloudIssuanceUserRobotBindFollow() (list []*CloudIssuanceUserRobotBindFollowList, err error)
}

+ 8
- 1
src/dao/super_cloud_issuance_user_robot_bind_follow_group_dao.go View File

@@ -1,5 +1,12 @@
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceUserRobotBindFollowGroupDao interface {
//TODO:: You can add specific method definitions here
GetCloudIssuanceUserRobotBindFollowGroup(id int) (m *models.SuperCloudIssuanceUserRobotBindFollowGroup, err error)
GetCloudIssuanceUserRobotBindFollowGroupByBindId(bandId int) (m []*models.SuperCloudIssuanceUserRobotBindFollowGroup, err error)
InsertCloudIssuanceUserRobotBindFollowGroup(m *models.SuperCloudIssuanceUserRobotBindFollowGroup) (id int, err error)
BatchAddCloudIssuanceUserRobotBindFollowGroups(data []*models.SuperCloudIssuanceUserRobotBindFollowGroup) (int64, error)
SaveCloudIssuanceUserRobotBindFollowGroup(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollowGroup, forceColums ...string) (affected int64, err error)
DeleteCloudIssuanceUserRobotBindFollowGroup(bindId interface{}) (affected int64, err error)
}

+ 9
- 1
src/dao/super_cloud_issuance_user_robot_bind_follow_user_dao.go View File

@@ -1,5 +1,13 @@
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceUserRobotBindFollowUserDao interface {
//TODO:: You can add specific method definitions here
GetCloudIssuanceUserRobotBindFollowUser(id int) (m *models.SuperCloudIssuanceUserRobotBindFollowUser, err error)
GetCloudIssuanceUserRobotBindFollowUserByWxId(wxId string) (m *models.SuperCloudIssuanceUserRobotBindFollowUser, err error)
InsertCloudIssuanceUserRobotBindFollowUser(m *models.SuperCloudIssuanceUserRobotBindFollowUser) (id int, err error)
BatchAddCloudIssuanceUserRobotBindFollowUsers(data []*models.SuperCloudIssuanceUserRobotBindFollowUser) (int64, error)
SaveCloudIssuanceUserRobotBindFollowUser(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollowUser, forceColums ...string) (affected int64, err error)
DeleteCloudIssuanceUserRobotBindFollowUser(bindId interface{}) (affected int64, err error)
//FindCloudIssuanceUserRobotBindFollowUser(params map[string]interface{}) ([]*models.SuperCloudIssuanceUserRobotBindFollowUser, error)
}

+ 24
- 5
src/implement/super_cloud_issuance_package_ord_db.go View File

@@ -3,18 +3,37 @@ package implement
import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/super_cloud_issuance/md"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

func NewSuperCloudIssuancePackageOrdDb(engine *xorm.Engine) dao.SuperCloudIssuancePackageOrdDao {
return &SuperCloudIssuancePackageOrdDb{Db: engine}
}

type SuperCloudIssuancePackageOrdDb struct {
Db *xorm.Engine
}

func (s SuperCloudIssuancePackageOrdDb) GetCloudIssuancePackageOrd(ordNo string) (m *models.SuperCloudIssuancePackageOrd, err error) {
//TODO implement me
panic("implement me")
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").
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").
Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&resp)
return
}

func NewSuperCloudIssuancePackageOrdDb(engine *xorm.Engine) dao.SuperCloudIssuancePackageOrdDao {
return &SuperCloudIssuancePackageOrdDb{Db: engine}
func (s SuperCloudIssuancePackageOrdDb) GetCloudIssuancePackageOrd(ordNo string) (m *models.SuperCloudIssuancePackageOrd, err error) {
m = new(models.SuperCloudIssuancePackageOrd)
has, err := s.Db.Where("ord_no =?", ordNo).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

+ 60
- 2
src/implement/super_cloud_issuance_user_robot_bind_follow_db.go View File

@@ -2,13 +2,71 @@ package implement

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

func NewSuperCloudIssuanceUserRobotBindFollowDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindFollowDao {
return &SuperCloudIssuanceUserRobotBindFollowDb{Db: engine}
}

type SuperCloudIssuanceUserRobotBindFollowDb struct {
Db *xorm.Engine
}

func NewSuperCloudIssuanceUserRobotBindFollowDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindFollowDao {
return &SuperCloudIssuanceUserRobotBindFollowDb{Db: engine}
func (s SuperCloudIssuanceUserRobotBindFollowDb) GetCloudIssuanceUserRobotBindFollow(id int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) {
m = new(models.SuperCloudIssuanceUserRobotBindFollow)
has, err := s.Db.Where("id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowDb) GetCloudIssuanceUserRobotBindFollowByChatRoomId(chatRoomId string, robotId int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) {
m = new(models.SuperCloudIssuanceUserRobotBindFollow)
has, err := s.Db.Where("chat_room_id =? AND robot_id = ? AND state = 1", chatRoomId, robotId).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowDb) InsertCloudIssuanceUserRobotBindFollow(m *models.SuperCloudIssuanceUserRobotBindFollow) (id int, err error) {
_, err = s.Db.InsertOne(m)
if err != nil {
return 0, err
}
id = m.Id
return id, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowDb) SaveCloudIssuanceUserRobotBindFollow(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollow, forceColums ...string) (affected int64, err error) {
if forceColums != nil {
affected, err = s.Db.Where("id=?", id).Cols(forceColums...).Update(m)
} else {
affected, err = s.Db.Where("id=?", id).Update(m)
}
return
}

func (s SuperCloudIssuanceUserRobotBindFollowDb) DeleteCloudIssuanceUserRobotBindFollow(id interface{}) (affected int64, err error) {
_, err = s.Db.Where("id=?", id).Delete(models.SuperCloudIssuanceUserRobotBindFollow{})
if err != nil {
return 0, err
}
return 1, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowDb) CountCloudIssuanceUserRobotBindFollow(uid int) (total int64, err error) {
var m []*models.SuperCloudIssuanceUserRobotBindFollow
total, err = s.Db.Where("uid=?", uid).OrderBy("id DESC").FindAndCount(&m)
return
}

+ 58
- 2
src/implement/super_cloud_issuance_user_robot_bind_follow_group_db.go View File

@@ -2,13 +2,69 @@ package implement

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

func NewSuperCloudIssuanceUserRobotBindFollowGroupDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindFollowGroupDao {
return &SuperCloudIssuanceUserRobotBindFollowGroupDb{Db: engine}
}

type SuperCloudIssuanceUserRobotBindFollowGroupDb struct {
Db *xorm.Engine
}

func NewSuperCloudIssuanceUserRobotBindFollowGroupDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindFollowGroupDao {
return &SuperCloudIssuanceUserRobotBindFollowGroupDb{Db: engine}
func (s SuperCloudIssuanceUserRobotBindFollowGroupDb) GetCloudIssuanceUserRobotBindFollowGroup(id int) (m *models.SuperCloudIssuanceUserRobotBindFollowGroup, err error) {
m = new(models.SuperCloudIssuanceUserRobotBindFollowGroup)
has, err := s.Db.Where("id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowGroupDb) GetCloudIssuanceUserRobotBindFollowGroupByBindId(bandId int) (m []*models.SuperCloudIssuanceUserRobotBindFollowGroup, err error) {
err = s.Db.Where("bind_id =?", bandId).Find(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowGroupDb) InsertCloudIssuanceUserRobotBindFollowGroup(m *models.SuperCloudIssuanceUserRobotBindFollowGroup) (id int, err error) {
_, err = s.Db.InsertOne(m)
if err != nil {
return 0, err
}
id = m.Id
return id, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowGroupDb) BatchAddCloudIssuanceUserRobotBindFollowGroups(data []*models.SuperCloudIssuanceUserRobotBindFollowGroup) (int64, error) {
affected, err := s.Db.Insert(data)
if err != nil {
return 0, err
}
return affected, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowGroupDb) SaveCloudIssuanceUserRobotBindFollowGroup(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollowGroup, forceColums ...string) (affected int64, err error) {
if forceColums != nil {
affected, err = s.Db.Where("id=?", id).Cols(forceColums...).Update(m)
} else {
affected, err = s.Db.Where("id=?", id).Update(m)
}
return
}

func (s SuperCloudIssuanceUserRobotBindFollowGroupDb) DeleteCloudIssuanceUserRobotBindFollowGroup(bindId interface{}) (affected int64, err error) {
_, err = s.Db.Where("bind_id=?", bindId).Delete(models.SuperCloudIssuanceUserRobotBindFollowGroup{})
if err != nil {
return 0, err
}
return 1, nil
}

+ 62
- 2
src/implement/super_cloud_issuance_user_robot_bind_follow_user_db.go View File

@@ -2,13 +2,73 @@ package implement

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

func NewSuperCloudIssuanceUserRobotBindFollowUserDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindFollowUserDao {
return &SuperCloudIssuanceUserRobotBindFollowUserDb{Db: engine}
}

type SuperCloudIssuanceUserRobotBindFollowUserDb struct {
Db *xorm.Engine
}

func NewSuperCloudIssuanceUserRobotBindFollowUserDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindFollowUserDao {
return &SuperCloudIssuanceUserRobotBindFollowUserDb{Db: engine}
func (s SuperCloudIssuanceUserRobotBindFollowUserDb) GetCloudIssuanceUserRobotBindFollowUser(id int) (m *models.SuperCloudIssuanceUserRobotBindFollowUser, err error) {
m = new(models.SuperCloudIssuanceUserRobotBindFollowUser)
has, err := s.Db.Where("id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowUserDb) GetCloudIssuanceUserRobotBindFollowUserByWxId(wxId string) (m *models.SuperCloudIssuanceUserRobotBindFollowUser, err error) {
m = new(models.SuperCloudIssuanceUserRobotBindFollowUser)
has, err := s.Db.Where("monitor_host_wx_id =?", wxId).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowUserDb) InsertCloudIssuanceUserRobotBindFollowUser(m *models.SuperCloudIssuanceUserRobotBindFollowUser) (id int, err error) {
_, err = s.Db.InsertOne(m)
if err != nil {
return 0, err
}
id = m.Id
return id, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowUserDb) BatchAddCloudIssuanceUserRobotBindFollowUsers(data []*models.SuperCloudIssuanceUserRobotBindFollowUser) (int64, error) {
affected, err := s.Db.Insert(data)
if err != nil {
return 0, err
}
return affected, nil
}

func (s SuperCloudIssuanceUserRobotBindFollowUserDb) SaveCloudIssuanceUserRobotBindFollowUser(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollowUser, forceColums ...string) (affected int64, err error) {
if forceColums != nil {
affected, err = s.Db.Where("id=?", id).Cols(forceColums...).Update(m)
} else {
affected, err = s.Db.Where("id=?", id).Update(m)
}
return
}

func (s SuperCloudIssuanceUserRobotBindFollowUserDb) DeleteCloudIssuanceUserRobotBindFollowUser(bindId interface{}) (affected int64, err error) {
_, err = s.Db.Where("bind_id=?", bindId).Delete(models.SuperCloudIssuanceUserRobotBindFollowUser{})
if err != nil {
return 0, err
}
return 1, nil
}

+ 1
- 1
src/models/super_cloud_issuance_user_robot_bind_source.go View File

@@ -3,7 +3,7 @@ package models
type SuperCloudIssuanceUserRobotBindSource struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('源头名称') VARCHAR(255)"`
ActivateGroupId string `json:"activate_group_id" xorm:"not null default '' comment('激活群id') VARCHAR(255)"`
ActivateGroupId int `json:"activate_group_id" xorm:"not null default '' comment('激活群id') VARCHAR(255)"`
IsSee int `json:"is_see" xorm:"not null default 1 comment('是否可见(1可见 2不可见)') TINYINT(1)"`
IsUse int `json:"is_use" xorm:"not null default 1 comment('是否可用(1正常转发 2暂停转发)') TINYINT(1)"`
SendOrderNums int `json:"send_order_nums" xorm:"not null default 0 comment('发单量') INT(11)"`


+ 20
- 0
super_cloud_issuance/md/md_request.go View File

@@ -0,0 +1,20 @@
package md

type BuyPackageRecordsRequest struct {
Page int `json:"page"`
Limit int `json:"limit"`
}
type BuyPackageRecordsResponse struct {
Id int `json:"id"`
OrdNo string `json:"ord_no"`
TradeNo string `json:"trade_no"`
PackageId int `json:"package_id"`
Uid int `json:"uid"`
Amount string `json:"amount"`
State int `json:"state"`
PayChannel int `json:"pay_channel"`
Months int `json:"months"`
PackageName string `json:"package_name"`
CreateAt string `json:"create_at" `
UpdateAt string `json:"update_at" `
}

Loading…
Cancel
Save