package zltx

import (
	config2 "ai_scheduler/internal/config"
	"ai_scheduler/internal/entitys"
	"context"
	"strings"
	"testing"
)

func Test_task(t *testing.T) {
	c := NewZltxOrderDetailTool(config2.ToolConfig{
		BaseURL: "https://revcl.1688sup.com/api/admin/direct/ai/%s",
		AddURL:  "https://revcl.1688sup.com/api/admin/direct/log/%s/%s",
	}, nil)
	ch := make(chan entitys.Response, 10000)
	err :=
		c.Execute(context.Background(), &entitys.Recognize{
			Match: &entitys.Match{
				Parameters: `{"order_number": 864086822064234497}`,
			},
			Ext:         []byte(`{"auth":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyQ2VudGVyIiwiZXhwIjoxNzY3OTM0MTg1LCJuYmYiOjE3Njc5MjMzODUsImp0aSI6IjE3OSIsIlBob25lIjoiMTUwMDA0NTAxNTUiLCJVc2VyTmFtZSI6IjE1MDAwNDUwMTU1IiwiUmVhbE5hbWUiOiLliJjlvanlhpsiLCJBY2NvdW50VHlwZSI6MSwiR3JvdXBDb2RlcyI6IlZDTF9BRE1JTixWQ0xfU1lTVEVNLENSTV9BRE1JTixMU1hERFNfQURNSU4sTFNYRERTX1NZU1RFTSxNQVJLRVRJTkdTQUFTX1NVUEVSQURNSU4sU1RBVElTVElDQUxTWVNURU1fQURNSU4sUEhZU0lDQUxHT09EU19BRE1JTixNQVJLRVRJTkdTWVNURU1fU1VQRVIsUkVQT1JUQ0VOVEVSX0FETUlOLE1PTklUT1JfTUFESU4sWkxUWF9BRE1JTixaTFRYX09QRVJBVEUiLCJEaW5nVXNlcklkIjoiMTcxMTkzNTg3NTAzMjk5MzUifQ.d9z0S1Ia-PFAxhGstT055Amt8PI09bUHxG0_lba4UwvSomiTNCD-5DFdMkbZHwiDTlhVdBjcd1mDYFRRZXWMPoSnanubMBnRnuvTi8csch5nz1L9oWNo-HFyBE3lMw9-UJ5j84gz228_kcBsvRATT1Ixs9bnuaN9CDNz20c524llDt10C3cc8wLGMin4jWEMF4RNrf2oBZOFAahRYSJNeBmutIwRSIP1pMIAaUy_IkMCyOwK8JzgMnHJGLwIH_nxR9XZXlAN0FmrmtWVkRA2YUKvoDX5a5BCYmDVNqUbi_ZNuRPJH87Ia7_-UoyJu8Yq79jX0Qgsm6qJ4rX2nauneg"}`),
			UserContent: &entitys.RecognizeUserContent{Text: "订单查询：864086822064234497\n"},
		})
	if err != nil {
		t.Log(err)
	}
	var res strings.Builder
	for v := range ch {
		res.WriteString(v.Content)
	}
	t.Log(res)

}
