You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
906 B
Go

package cache
import (
"context"
"joybuywork/internal/app"
"joybuywork/internal/config"
"joybuywork/internal/consts"
"joybuywork/internal/service/queue/producer"
"testing"
)
func conf() {
var filePath = config.FilePath{
ConfigName: "config-dev",
ConfigType: "yaml",
ConfigPath: "/Users/branchcn/Project/go/src/joybuywork/etc",
}
err := config.LoadConfig(filePath)
if err != nil {
panic(err)
}
err = app.InitFeiShu()
if err != nil {
panic(err)
}
app.InitLogger()
err = app.InitDB()
if err != nil {
panic(err)
}
err = app.InitRedis()
if err != nil {
panic(err)
}
//kafka
err = app.InitKafka()
if err != nil {
panic(err)
}
//队列生产者
producer.SetUp()
consts.RunTest = true
// 固定的奖品数据
app.FissionFixRewards.Init()
}
func TestReward(t *testing.T) {
conf()
c := NewReward(context.Background())
t.Log(c.FindByIds([]int64{1, 2}))
}