Compare commits

..

No commits in common. "master" and "v4" have entirely different histories.
master ... v4

7 changed files with 9 additions and 54 deletions

View File

@ -142,7 +142,7 @@ eino_tools:
# == 通用工具 ==
# 表格转图片
excel2pic:
base_url: "http://192.168.6.109:8010/api/v1/convert"
base_url: "http://excel2pic:8000/api/v1/convert"
dingtalk:
api_key: "dingsbbntrkeiyazcfdg"

View File

@ -378,9 +378,7 @@ func (d *DingTalkBotBiz) HandleStreamRes(ctx context.Context, data *chatbot.BotC
}
func (d *DingTalkBotBiz) SendReport(ctx context.Context, groupInfo *model.AiBotGroup, report *bbxt.ReportRes) (err error) {
if report == nil {
return errors.New("report is nil")
}
reportChan := make(chan string, 10)
defer close(reportChan)
reportChan <- report.Title

View File

@ -1,12 +0,0 @@
package biz
import (
"context"
"testing"
)
func Test_report(t *testing.T) {
run()
chatId, err := groupConfigBiz.GetReportLists(context.Background(), nil)
t.Log(chatId, err)
}

View File

@ -10,7 +10,6 @@ import (
"ai_scheduler/internal/pkg/l_request"
"ai_scheduler/internal/tools/bbxt"
"context"
"fmt"
"log"
"strings"
"time"
@ -112,10 +111,6 @@ func (q *QywxAppBiz) SendReport(ctx context.Context, groupInfo *model.AiBotGroup
// SendReportV2 发送到货易通指定的群聊
func (q *QywxAppBiz) SendReportHYT(ctx context.Context, groupInfo *model.AiBotGroupQywx, report *bbxt.ReportRes) (err error) {
if report == nil {
return fmt.Errorf("report is nil")
}
// 文本消息
err = q.sendReportHYT(groupInfo, &bbxt.ReportRes{
Title: report.Title,

View File

@ -2,17 +2,8 @@ package biz
import (
"ai_scheduler/internal/biz/handle/qywx"
"ai_scheduler/internal/biz/tools_regis"
"ai_scheduler/internal/config"
"ai_scheduler/internal/data/impl"
"ai_scheduler/internal/domain/component"
"ai_scheduler/internal/domain/component/callback"
"ai_scheduler/internal/domain/repo"
"ai_scheduler/internal/domain/workflow"
"ai_scheduler/internal/pkg"
"ai_scheduler/internal/pkg/lsxd"
"ai_scheduler/internal/pkg/utils_ollama"
"ai_scheduler/internal/pkg/utils_oss"
"ai_scheduler/utils"
"context"
"testing"
@ -27,7 +18,6 @@ func Test_InitGroup(t *testing.T) {
var (
configConfig *config.Config
qywxAppBiz *QywxAppBiz
groupConfigBiz *GroupConfigBiz
)
func run() {
@ -38,21 +28,6 @@ func run() {
botGroupQywxImpl := impl.NewBotGroupQywxImpl(db)
qywxAuth := qywx.NewAuth(configConfig, rdb)
group := qywx.NewGroup(botGroupQywxImpl, qywxAuth)
sessionImpl := impl.NewSessionImpl(db)
other := qywx.NewOther(qywxAuth)
repos := repo.NewRepos(sessionImpl, configConfig, rdb)
pkgRdb := pkg.NewRdb(configConfig)
redisManager := callback.NewRedisManager(pkgRdb)
login := lsxd.NewLogin(configConfig, rdb)
components := component.NewComponents(redisManager, login)
repos = repo.NewRepos(sessionImpl, configConfig, rdb)
botToolsImpl := impl.NewBotToolsImpl(db)
toolRegis := tools_regis.NewToolsRegis(botToolsImpl)
utils_ossClient, _ := utils_oss.NewClient(configConfig)
client, _, _ := utils_ollama.NewClient(configConfig)
registry := workflow.NewRegistry(configConfig, client, repos, components)
botGroupConfigImpl := impl.NewBotGroupConfigImpl(db)
qywxAppBiz = NewQywxAppBiz(configConfig, botGroupQywxImpl, group, other)
groupConfigBiz = NewGroupConfigBiz(toolRegis, utils_ossClient, botGroupConfigImpl, registry, configConfig)
}

View File

@ -41,13 +41,13 @@ func (c *CronServer) InitJobs(ctx context.Context) {
c.jobs = []*cronJob{
{
Func: c.cronService.CronReportSendDingTalk,
Name: "直连天下报表推送(钉钉)",
Schedule: "20 12,18,23 * * *",
Name: "直连天下报表推送",
Schedule: "0 12,18,23 * * *",
},
{
Func: c.cronService.CronReportSendQywx,
Name: "直连天下报表推送(微信)",
Schedule: "20 12,18,23 * * *",
Name: "直连天下报表推送",
Schedule: "0 12,18,23 * * *",
},
}
}

View File

@ -72,8 +72,7 @@ func Test_GetStatisOfficialProductSumDecline(t *testing.T) {
}
s := "官方--腾讯-周卡,官方--腾讯-月卡,官方--腾讯-季卡,官方--腾讯-年卡,官方--优酷周卡,官方--优酷月卡,官方--优酷季卡,官方--优酷年卡,官方--爱奇艺-周卡,官方--爱奇艺-月卡,官方--爱奇艺-季卡,官方--爱奇艺-年卡,官方--芒果-PC周卡,官方--芒果-PC月卡,官方--芒果-PC季卡,官方--美团外卖红包5元,官方--美团外卖红包10元,官方--QQ音乐-绿钻月卡,官方--饿了么超级会员月卡,官方--网易云黑胶vip月卡,官方--喜马拉雅巅峰会员月卡"
//s := "官方--QQ音乐-绿钻月卡"
now := time.Now()
report, err := o.GetStatisOfficialProductSumDecline(time.Date(now.Year(), now.Month(), now.Day(), 12, 0, 0, 0, now.Location()), 1000, strings.Split(s, ","), -150)
report, err := o.GetStatisOfficialProductSumDecline(time.Now(), 1000, strings.Split(s, ","), -150)
t.Log(report, err)