From f0aff7f191f0d12d28840ad5c586fddcb234197c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 4 Apr 2024 21:55:06 +0800 Subject: [PATCH] 1 --- server/imserver_new/constant/constant.go | 6 ++++++ server/imserver_new/guild/guildmgr.go | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/server/imserver_new/constant/constant.go b/server/imserver_new/constant/constant.go index 90ddad21..8c5221e6 100644 --- a/server/imserver_new/constant/constant.go +++ b/server/imserver_new/constant/constant.go @@ -42,6 +42,12 @@ const ( GUILD_NAME_LOCK_KEY = "guild_name:" ) +const ( + GUILD_APPLY_STATUS_NONE = 0 + GUILD_APPLY_STATUS_ACCEPT = 1 + GUILD_APPLY_STATUS_REJECT = 2 + GUILD_APPLY_STATUS_IGNORE = 3 +) // im server chat const ( CCBegin = iota diff --git a/server/imserver_new/guild/guildmgr.go b/server/imserver_new/guild/guildmgr.go index 85707c0a..99b84186 100644 --- a/server/imserver_new/guild/guildmgr.go +++ b/server/imserver_new/guild/guildmgr.go @@ -266,7 +266,7 @@ func (this *guildMgr) AsyncGetApplyList(lastIdx int64, accountId string, f5.GetDbFilter().GT("idx", q5.ToString(lastIdx)).And(), f5.GetDbFilter().EQ("guild_id", guild.GetGuildId()).And(), f5.GetDbFilter().EQ("account_id", accountId).And(), - f5.GetDbFilter().EQ("status", "0"), + f5.GetDbFilter().EQ("status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)), ), "", func (err error, pg *f5.Pagination) { @@ -300,13 +300,13 @@ func (this *guildMgr) AsyncApplyJoin(accountId string, guildId string, cb func(i {"account_id", accountId}, }, [][]string{ - {"status", q5.ToString(0)}, + {"status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)}, {"last_apply_time", q5.ToString(nowTime)}, }, [][]string{ {"guild_id", guildId}, {"account_id", accountId}, - {"status", q5.ToString(0)}, + {"status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)}, {"last_apply_time", q5.ToString(nowTime)}, {"createtime", q5.ToString(nowTime)}, {"modifytime", q5.ToString(nowTime)}, @@ -416,7 +416,8 @@ func (this *guildMgr) AsyncGetGuildLogs(string, string, func(int32, string)) { } -func (this *guildMgr) asyncSetApplyStatus(accountId string, guildId string, status int32) { +func (this *guildMgr) asyncSetApplyStatus(accountId string, guildId string, status int32, + cb func(error, int64, int64)) { f5.GetJsStyleDb().Update( constant.FRIEND_DB, "t_guild_apply", @@ -428,7 +429,5 @@ func (this *guildMgr) asyncSetApplyStatus(accountId string, guildId string, stat {"account_id", accountId}, {"guild_id", guildId}, }, - func (err error, lastInsertId int64, rowsAffected int64) { - - }) + cb) }