创建聊天组

This commit is contained in:
苏尹岚
2020-10-22 10:23:04 +08:00
parent bd1ae5558c
commit b8f18712a9
5 changed files with 15 additions and 30 deletions

View File

@@ -251,7 +251,7 @@ func CreateUser(user *model.User, creatorName string) (err error) {
dao.WrapAddIDCULDEntity(user, creatorName)
user.UserID = utils.GetUUID()
user.Status = model.UserStatusNormal
user.DividePercentage = 1
// user.DividePercentage = 1
return dao.CreateEntity(nil, user)
}

View File

@@ -127,7 +127,7 @@ func GetOperateEvents(ctx *jxcontext.Context, name string, apiFunctions []string
return pageInfo, err
}
func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName string, dividePercentage int) (messageGroupResult *dao.GetMessageGroupsResult, err error) {
func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName string, dividePercentage, quitPrice int) (messageGroupResult *dao.GetMessageGroupsResult, err error) {
var (
db = dao.GetDB()
groupID int
@@ -190,6 +190,11 @@ func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName strin
Type: model.GroupTypeMulit,
MaxCount: 50,
DividePercentage: dividePercentage,
QuitPrice: quitPrice,
}
user, err := dao.GetUserByID(db, "user_id", userID)
if groupName == "" {
messageGroup.Name = user.Name + "的集团"
}
dao.WrapAddIDCULDEntity(messageGroup, ctx.GetUserName())
dao.CreateEntity(db, messageGroup)