This commit is contained in:
aozhiwei 2024-04-04 10:25:14 +08:00
parent 3bd2bb8ff7
commit d9ada89aca
2 changed files with 50 additions and 1 deletions

View File

@ -157,6 +157,55 @@ func (this *guildMgr) AsyncCreateGuild(accountId string, avatar int32, name stri
return
}
this.addUsingName(name)
guildId := q5.ToString(f5.GetApp().NewNodeUuid())
nowTime := f5.GetApp().GetNowSeconds()
f5.GetJsStyleDb().Insert(
constant.FRIEND_DB,
"t_guild",
[][]string{
{"guild_id", guildId},
{"guild_name", name},
{"owner_id", accountId},
{"creator_id", accountId},
{"badge", q5.ToString(avatar)},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
},
func (err error, lastInsertId int64, rowsAffected int64) {
this.removeUsingName(name)
if err != nil {
cb(1, "", 0)
return
}
f5.GetJsStyleDb().Upsert(
constant.FRIEND_DB,
"t_guild",
[][]string{
{"member_id", accountId},
},
[][]string{
{"guild_id", guildId},
{"deleted", q5.ToString(0)},
{"join_time", q5.ToString(nowTime)},
},
[][]string{
{"guild_id", guildId},
{"member_id", accountId},
{"join_time", q5.ToString(nowTime)},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
},
func (err error, lastInsertId int64, rowsAffected int64) {
if err != nil {
cb(1, "", 0)
return
}
guild := newGuild()
this.idHash[guild.guildId] = guild
this.nameHash[guild.guildName] = guild
this.accountIdHash[accountId] = guild
})
})
}
func (this *guildMgr) AsyncGetApplyList(lastIdx int64, accountId string,

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit ba7db1fa1f1633d56c4f01cbdd33ce1d22f2285b
Subproject commit 1a19949e6464872e9d54154bc69e13cfc858d106