🏗️ microservice fabric splitting

This commit is contained in:
2024-12-24 00:38:41 +08:00
parent 462e811742
commit 89d64336f5
311 changed files with 18384 additions and 2428 deletions

View File

@@ -0,0 +1,35 @@
package wechat_official
import (
"os"
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel"
"github.com/ArtisanCloud/PowerWeChat/v3/src/officialAccount"
)
// NewWechatPublic 微信公众号实例化
func NewWechatPublic(appId, appSecret, token, aesKey, addr, pass string, db int) *officialAccount.OfficialAccount {
OfficialAccountApp, err := officialAccount.NewOfficialAccount(&officialAccount.UserConfig{
AppID: appId,
Secret: appSecret,
Token: token,
AESKey: aesKey,
Log: officialAccount.Log{
Level: "error",
File: "./logs/wechat/wechat_official.log",
Stdout: false,
},
ResponseType: os.Getenv("response_type"),
HttpDebug: false,
Debug: false,
Cache: kernel.NewRedisClient(&kernel.UniversalOptions{
Addrs: []string{addr},
Password: pass,
DB: db,
}),
})
if err != nil {
panic(err)
}
return OfficialAccountApp
}