From 997ad806f0c0d94b6643b05535e91abdabacc3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Wed, 22 Nov 2023 10:55:40 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=96=B0=E5=A2=9E=E5=8F=91?= =?UTF-8?q?=E9=80=81=E8=AF=8D=E4=BA=91=E5=9B=BE=E7=89=87(=E9=9C=80?= =?UTF-8?q?=E9=85=8D=E5=90=88=E5=A4=96=E9=83=A8=E5=B7=A5=E5=85=B7=E9=A2=84?= =?UTF-8?q?=E5=85=88=E7=94=9F=E6=88=90=E8=AF=8D=E4=BA=91=E5=9B=BE=E7=89=87?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/month.go | 7 +++++++ tasks/water_group.go | 7 +++++++ tasks/week.go | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/tasks/month.go b/tasks/month.go index 088faf8..3f6ea24 100644 --- a/tasks/month.go +++ b/tasks/month.go @@ -8,13 +8,20 @@ import ( "go-wechat/utils" "log" "strings" + "time" ) // month // @description: 月排行榜 func month() { for _, id := range config.Conf.Task.WaterGroup.Groups { + // 消息统计 dealMonth(id) + // 获取上个月月份 + yd := time.Now().Local().AddDate(0, 0, -1).Format("200601") + // 发送词云 + fileName := fmt.Sprintf("%s_%s.png", yd, id) + utils.SendImage(id, "D:\\Share\\wordcloud\\"+fileName, 0) } } diff --git a/tasks/water_group.go b/tasks/water_group.go index 5bb7c43..f877bf1 100644 --- a/tasks/water_group.go +++ b/tasks/water_group.go @@ -8,6 +8,7 @@ import ( "go-wechat/utils" "log" "strings" + "time" ) // 水群排行榜 @@ -16,7 +17,13 @@ import ( // @description: 昨日排行榜 func yesterday() { for _, id := range config.Conf.Task.WaterGroup.Groups { + // 消息统计 dealYesterday(id) + // 获取昨日日期 + yd := time.Now().Local().AddDate(0, 0, -1).Format("20060102") + // 发送词云 + fileName := fmt.Sprintf("%s_%s.png", yd, id) + utils.SendImage(id, "D:\\Share\\wordcloud\\"+fileName, 0) } } diff --git a/tasks/week.go b/tasks/week.go index 2fda3f5..588a73b 100644 --- a/tasks/week.go +++ b/tasks/week.go @@ -8,13 +8,20 @@ import ( "go-wechat/utils" "log" "strings" + "time" ) // week // @description: 周排行榜 func week() { for _, id := range config.Conf.Task.WaterGroup.Groups { + // 消息统计 dealWeek(id) + // 获取上周周数 + year, weekNo := time.Now().Local().AddDate(0, 0, -1).ISOWeek() + // 发送词云 + fileName := fmt.Sprintf("%d%d_%s.png", year, weekNo, id) + utils.SendImage(id, "D:\\Share\\wordcloud\\"+fileName, 0) } }