1
0
Fork 0

新增图片存储路径

This commit is contained in:
liuqx 2023-12-12 22:57:14 +08:00
parent e2029e48c5
commit e6b2de3d67
6 changed files with 9 additions and 3 deletions

View File

@ -6,6 +6,7 @@ wechat:
autoSetCallback: false
# 回调IP如果是Docker运行本参数必填(填auto表示自动不适用于 docker 环境)如果Docker修改了映射格式为 ip:port
callback: 10.0.0.51
imgPath: /data/
# 转发到其他地址
forward:
# - 10.0.0.247:4299

View File

@ -9,6 +9,7 @@ type wechat struct {
AutoSetCallback bool `json:"autoSetCallback" yaml:"autoSetCallback"` // 是否自动设置回调地址
Callback string `json:"callback" yaml:"callback"` // 回调地址
Forward []string `json:"forward" yaml:"forward"` // 转发地址
ImgPath string `json:"imgPath" yaml:"imgPath"` // 图片存储位置
}
// Check

View File

@ -44,5 +44,6 @@ services:
volumes:
# 配置文件请参阅项目根目录的config.yaml文件
- ./config/config.yaml:/app/config.yaml
- ./imgData:/data
ports:
- "19099:19099"

View File

@ -2,6 +2,7 @@ package watergroup
import (
"fmt"
"go-wechat/config"
"go-wechat/service"
"go-wechat/utils"
"log"
@ -25,7 +26,7 @@ func Month() {
yd := time.Now().Local().AddDate(0, 0, -1).Format("200601")
// 发送词云
fileName := fmt.Sprintf("%s_%s.png", yd, group.Wxid)
utils.SendImage(group.Wxid, "D:\\Share\\wordcloud\\"+fileName, 0)
utils.SendImage(group.Wxid, config.Conf.Wechat.ImgPath+fileName, 0)
}
}

View File

@ -2,6 +2,7 @@ package watergroup
import (
"fmt"
"go-wechat/config"
"go-wechat/service"
"go-wechat/utils"
"log"
@ -25,7 +26,7 @@ func Week() {
year, weekNo := time.Now().Local().AddDate(0, 0, -1).ISOWeek()
// 发送词云
fileName := fmt.Sprintf("%d%d_%s.png", year, weekNo, group.Wxid)
utils.SendImage(group.Wxid, "D:\\Share\\wordcloud\\"+fileName, 0)
utils.SendImage(group.Wxid, config.Conf.Wechat.ImgPath+fileName, 0)
}
}

View File

@ -2,6 +2,7 @@ package watergroup
import (
"fmt"
"go-wechat/config"
"go-wechat/service"
"go-wechat/utils"
"log"
@ -27,7 +28,7 @@ func Yesterday() {
yd := time.Now().Local().AddDate(0, 0, -1).Format("20060102")
// 发送词云
fileName := fmt.Sprintf("%s_%s.png", yd, group.Wxid)
utils.SendImage(group.Wxid, "D:\\Share\\wordcloud\\"+fileName, 0)
utils.SendImage(group.Wxid, config.Conf.Wechat.ImgPath+fileName, 0)
}
}