From 0f506e5afcdfa6aed7c0b08d0c8d788736362c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Wed, 12 Jun 2024 21:47:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E5=A5=BD?= =?UTF-8?q?=E5=8F=8B=E5=88=97=E8=A1=A8=E5=90=8C=E6=AD=A5=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/friends/friends.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/friends/friends.go b/tasks/friends/friends.go index 7bfa87a..404bad5 100644 --- a/tasks/friends/friends.go +++ b/tasks/friends/friends.go @@ -103,6 +103,7 @@ func Sync() { "custom_account": friend.CustomAccount, "pinyin": friend.Pinyin, "pinyin_all": friend.PinyinAll, + "is_ok": true, } err = tx.Model(&entity.Friend{}).Where("wxid = ?", friend.Wxid).Updates(pm).Error if err != nil { From 2238e23c8dbc53201e28567ae5f47ff0f762e523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Thu, 13 Jun 2024 07:02:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E5=A5=BD?= =?UTF-8?q?=E5=8F=8B=E5=88=97=E8=A1=A8=E5=90=8C=E6=AD=A5=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/friends/friends.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tasks/friends/friends.go b/tasks/friends/friends.go index 404bad5..b423839 100644 --- a/tasks/friends/friends.go +++ b/tasks/friends/friends.go @@ -134,7 +134,19 @@ func Sync() { } // 清理不在列表中的好友 - err = tx.Model(&entity.Friend{}).Where("wxid NOT IN (?)", nowIds).Update("is_ok", false).Error + clearPm := map[string]any{ + "is_ok": false, + "enable_chat_rank": false, + "enable_welcome": false, + "enable_summary": false, + "enable_news": false, + "clear_member": false, + "enable_ai": false, + } + err = tx.Model(&entity.Friend{}).Where("wxid NOT IN (?)", nowIds).Updates(clearPm).Error + if err != nil { + log.Printf("清理好友失败: %s", err.Error()) + } log.Println("同步好友列表完成") }