package proxy_pool

import (
	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
	_ "github.com/gogf/gf/contrib/nosql/redis/v2"
	"github.com/gogf/gf/v2/os/gctx"
	"github.com/gogf/gf/v2/os/gtime"
	"kami/internal/service"
	"kami/utility/utils"
	"testing"
	"time"
)

func Test_sProxyPool_GetProxyByOrderId(t *testing.T) {
	service.RegisterProxyPool(New())
	ticker := time.NewTicker(time.Second)
	for range ticker.C {
		_ = service.ProxyPool().InitStrategy(gctx.GetInitCtx(), "http://api.dmdaili.com/dmgetip.asp?apikey=42bab0ac&pwd=1b567c2f286a08e391b5805565fa0882&getnum=1&httptype=1&geshi=1&fenge=3&fengefu=&operate=all", gtime.M)
		proxy, err2 := service.ProxyPool().GetProxyByOrderId(t.Context(), utils.GenerateRandomUUID())
		t.Log(proxy, err2)
	}
}
