|
|
|
@ -45,7 +45,7 @@ func GetGroupInfoByGroupID(groupId string) (*db.Group, error) {
|
|
|
|
|
return nil, utils.Wrap(err, "")
|
|
|
|
|
}
|
|
|
|
|
var groupInfo db.Group
|
|
|
|
|
err = dbConn.Table("groups").Where("group_id=?", groupId).Find(&groupInfo).Error
|
|
|
|
|
err = dbConn.Table("groups").Where("group_id=?", groupId).Take(&groupInfo).Error
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@ -86,7 +86,6 @@ func GetGroups(pageNumber, showNumber int) ([]db.Group, error) {
|
|
|
|
|
return groups, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func OperateGroupStatus(groupId string, groupStatus int32) error {
|
|
|
|
|
group := db.Group{
|
|
|
|
|
GroupID: groupId,
|
|
|
|
@ -98,7 +97,6 @@ func OperateGroupStatus(groupId string, groupStatus int32) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func DeleteGroup(groupId string) error {
|
|
|
|
|
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
|
|
|
|
if err != nil {
|
|
|
|
@ -129,8 +127,7 @@ func OperateGroupRole(userId, groupId string, roleLevel int32) (string, string,
|
|
|
|
|
updateInfo := db.GroupMember{
|
|
|
|
|
RoleLevel: roleLevel,
|
|
|
|
|
}
|
|
|
|
|
groupMaster := db.GroupMember{
|
|
|
|
|
}
|
|
|
|
|
groupMaster := db.GroupMember{}
|
|
|
|
|
switch roleLevel {
|
|
|
|
|
case constant.GroupOwner:
|
|
|
|
|
err = dbConn.Transaction(func(tx *gorm.DB) error {
|
|
|
|
|