ai_scheduler/internal/tools/bbxt/bbxt_test.go

67 lines
1.5 KiB
Go

package bbxt
import (
"ai_scheduler/internal/config"
"ai_scheduler/internal/pkg/utils_oss"
"testing"
"time"
)
func Test_StatisOursProductLossSumApiTotal(t *testing.T) {
var config = &config.Config{
Oss: config.Oss{
AccessKey: "LTAI5tGGZzjf3tvqWk8SQj2G",
SecretKey: "S0NKOAUaYWoK4EGSxrMFmYDzllhvpq",
Bucket: "attachment-public",
Domain: "https://attachment-public.oss-cn-hangzhou.aliyuncs.com",
Endpoint: "https://oss-cn-hangzhou.aliyuncs.com",
},
}
ossClient, err := utils_oss.NewClient(config)
if err != nil {
panic(err)
}
o, err := NewBbxtTools()
if err != nil {
panic(err)
}
reports, err := o.DailyReport(time.Now(), []string{"官方-爱奇艺-星钻季卡", "官方-爱奇艺-星钻半年卡", "官方--腾讯-年卡", "官方--爱奇艺-月卡"}, ossClient)
t.Log(reports, err)
}
func Test_StatisOursProductLossSum(t *testing.T) {
o, err := NewBbxtTools()
if err != nil {
panic(err)
}
report, err := o.StatisOursProductLossSum(time.Now())
t.Log(report, err)
}
func Test_GetProfitRankingSum(t *testing.T) {
o, err := NewBbxtTools()
if err != nil {
panic(err)
}
report, err := o.GetProfitRankingSum(time.Now())
t.Log(report, err)
}
func Test_GetStatisOfficialProductSum(t *testing.T) {
o, err := NewBbxtTools()
if err != nil {
panic(err)
}
report, err := o.GetStatisOfficialProductSum(time.Now(), []string{"官方-爱奇艺-星钻季卡", "官方-爱奇艺-星钻半年卡", "官方--腾讯-年卡", "官方--爱奇艺-月卡"})
t.Log(report, err)
}