package tbunionapi

import (
	"git.rosy.net.cn/baseapi/utils"
	"testing"
)

func TestAdzoneCreate(t *testing.T) {
	err := api.AdzoneCreate(2293250207, "999999")
	if err != nil {
		t.Fatal(err)
	}
	//t.Log(utils.Format4Output(result, false))
}

func TestActivityInfoGet(t *testing.T) {
	result, err := api.ActivityInfoGet("1439B3E07D3911EA881A525400E86DC0", "20150318020002597", 111339100149)
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestAllOrders(t *testing.T) {
	result, err := api.AllOrders("2021-04-23 00:00:00", "2021-04-23 23:59:59")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestNewUserAllOrders(t *testing.T) {
	result, err := api.NewUserAllOrders("20150318020002597")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestRebateOrderGet(t *testing.T) {
	result, err := api.RebateOrderGet("2021-04-05 09:10:00")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestGatewayUnionpub(t *testing.T) {
	result, err := api.GatewayUnionpub()
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestSpreadGet(t *testing.T) {
	result, err := api.SpreadGet("https://s.click.taobao.com/t?e=m%3D2%26s%3D2gqN73exILFw4vFB6t2Z2ueEDrYVVa64Dne87AjQPk9yINtkUhsv0NoOB2fLPTMnkVwhSHgXrieh50lqdFqzEbW9xosplKRRRCvhzyw83VKVDvy6A0dAZeLisOrebtw4UyNpxLfgKr0jWpzpm6nEC0AG4SvB2excV3hN7ukc%2BfWwcfTMMtg5PxhC2gPyIPYTElgJOKaPvK1xKmPmpIKZsA%3D%3D&scm=1007.15348.115058.0_28026&pvid=a6cb6b60-9b39-4d8e-bcec-eef56cfeac8a&app_pvid=59590_33.8.141.241_825_1620441096797&ptl=floorId:28026;originalFloorId:28026;pvid:a6cb6b60-9b39-4d8e-bcec-eef56cfeac8a;app_pvid:59590_33.8.141.241_825_1620441096797&union_lens=lensId%3AMAPI%401620441096%40a6cb6b60-9b39-4d8e-bcec-eef56cfeac8a_591944957973%401")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestTpwdCreate(t *testing.T) {
	result, err := api.TpwdCreate("https://s.click.taobao.com/t?e=m%3D2%26s%3D2gqN73exILFw4vFB6t2Z2ueEDrYVVa64Dne87AjQPk9yINtkUhsv0NoOB2fLPTMnkVwhSHgXrieh50lqdFqzEbW9xosplKRRRCvhzyw83VKVDvy6A0dAZeLisOrebtw4UyNpxLfgKr0jWpzpm6nEC0AG4SvB2excV3hN7ukc%2BfWwcfTMMtg5PxhC2gPyIPYTElgJOKaPvK1xKmPmpIKZsA%3D%3D&scm=1007.15348.115058.0_28026&pvid=a6cb6b60-9b39-4d8e-bcec-eef56cfeac8a&app_pvid=59590_33.8.141.241_825_1620441096797&ptl=floorId:28026;originalFloorId:28026;pvid:a6cb6b60-9b39-4d8e-bcec-eef56cfeac8a;app_pvid:59590_33.8.141.241_825_1620441096797&union_lens=lensId%3AMAPI%401620441096%40a6cb6b60-9b39-4d8e-bcec-eef56cfeac8a_591944957973%401")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}
