package ebaiapi import ( "fmt" "testing" "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/utils" ) func TestGetRealMobileNumber4Order(t *testing.T) { orderId := "15501080494587" desiredMobile := "18483673654" mobile, err := api.GetRealMobile4Order(orderId) if err != nil { t.Fatal(err) } if mobile != desiredMobile { t.Fatalf("orderId:%s's mobile is wrong, should be %s, but it's:%s", orderId, desiredMobile, mobile) } baseapi.SugarLogger.Debug(mobile) } func TestGetStoreOrderInfo(t *testing.T) { orderId := "1577329467196263592" // desiredMobile := "18483673654" orderInfo, err := api.GetStoreOrderInfo(orderId) if err != nil { t.Fatal(err) } baseapi.SugarLogger.Debug(utils.Format4Output(orderInfo, false)) } func TestGetStoreOrderInfoList(t *testing.T) { orderInfoList, err := api.GetStoreOrderInfoList("2019-02-14 13:00:00", "2019-02-14 15:30:00", "", -1) if err != nil { t.Fatal(err) } if true { baseapi.SugarLogger.Debug(utils.Format4Output(orderInfoList, false)) baseapi.SugarLogger.Debug(len(orderInfoList)) } } func TestGetEleCommentList(t *testing.T) { commentList, err := api.GetEleCommentList(utils.Str2Time("2019-09-29 00:00:00"), utils.Str2Time("2019-09-30 23:30:00"), "", "", ReplyStatusAll, CommentLevelAll, CommentContentAll) if err != nil { t.Fatal(err) } if true { baseapi.SugarLogger.Debug(utils.Format4Output(commentList, false)) baseapi.SugarLogger.Debug(len(commentList)) } } func TestPageGetSkuList(t *testing.T) { skuList, err := api.PageGetSkuList(2233065941) if err != nil { t.Fatal(err) } if true { baseapi.SugarLogger.Debug(utils.Format4Output(skuList, false)) } } func TestPageGetCustomSkuList(t *testing.T) { skuList, err := api.PageGetCustomSkuList(2267121521, 1552729500062) if err != nil { t.Fatal(err) } if true { baseapi.SugarLogger.Debug(utils.Format4Output(skuList, false)) } } func TestPageGetCustomCatList(t *testing.T) { catList, err := api.PageGetCustomCatList(2233065941) if err != nil { t.Fatal(err) } if true { baseapi.SugarLogger.Debug(utils.Format4Output(catList, false)) } } func TestSwitchShop(t *testing.T) { cookie, err := api.SwitchShop(2233065941) if err != nil { t.Fatal(err) } t.Log(cookie) } func TestGetShopUserInfo(t *testing.T) { result, err := api.GetShopUserInfo(32267034127) if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(result, false)) } func TestGetShopHealthByDetail(t *testing.T) { result, err := api.GetShopHealthByDetail(32267034127) if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(result, false)) } func TestGetStoreList(t *testing.T) { result, err := api.GetStoreList("104.057218", "30.6949", 0, 0) if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(result, false)) } func TestGetStoreList2(t *testing.T) { result, err := api.GetStoreList2(104.010554, 30.637072) if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(result, false)) } func TestGetStoreInfo(t *testing.T) { result, err := api.GetStoreInfo("170879219") if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(result, false)) } func TestGetStoreInfo2(t *testing.T) { result, err := api.GetStoreInfo2("2233065925") if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(result, false)) } func TestGetShopListIDs(t *testing.T) { result, total, _ := api.GetShopListByPage(1, 10, 500, 1) fmt.Println(total) for _, v := range result { fmt.Println(v.Name, v.Wid) } } func TestGetStoresShowWindowSkus(t *testing.T) { result, _ := api.GetStoresShowWindowSkus(32267089415) t.Log(utils.Format4Output(result, false)) }