diff --git a/platformapi/ebaiapi/order_test.go b/platformapi/ebaiapi/order_test.go index d7b1962a..68433e71 100644 --- a/platformapi/ebaiapi/order_test.go +++ b/platformapi/ebaiapi/order_test.go @@ -79,7 +79,7 @@ func TestGetReverseOrder(t *testing.T) { } } func TestOrderGet2(t *testing.T) { - result, err := api.OrderGet2("4043790061034194507") + result, err := api.OrderGet2("4048550075863379470") if err != nil { t.Fatal(err) } else { @@ -113,15 +113,8 @@ func TestOrderListAll(t *testing.T) { } } -func TestTestOnOrderDetail(t *testing.T) { - aa := map[string]string{"1": "1"} - k, v := aa["1"] - fmt.Println(k) - fmt.Println(v) -} - func TestOrderPartRefundGet(t *testing.T) { - result, err := api.OrderPartRefundGet("4089610070568120915") + result, err := api.OrderPartRefundGet("4048550075863379470") if err != nil { t.Fatal(err) } else { diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index ab0fb50c..c654d0e3 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -20,13 +20,13 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_hVoW4uxX65tW2pJ-WxxEVw") //token_n4TwqCntWWuvQwAawzxC0w + api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kYOJ_jIKPYCvQgkDdCJMug") //token_n4TwqCntWWuvQwAawzxC0w cookieStr := ` acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; ` diff --git a/platformapi/mtwmapi/order_test.go b/platformapi/mtwmapi/order_test.go index cd500109..0e1ea412 100644 --- a/platformapi/mtwmapi/order_test.go +++ b/platformapi/mtwmapi/order_test.go @@ -4,6 +4,7 @@ import ( "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" + "math" "strings" "testing" "time" @@ -29,7 +30,7 @@ func getTimeFromTimestamp(timeStamp int64) time.Time { } func TestOrderGetOrderDetail(t *testing.T) { - result, err := api.OrderGetOrderDetail(2301030621026530024, false) + result, err := api.OrderGetOrderDetail(3801105140856800486, false) if err != nil { t.Fatal(err) } @@ -44,6 +45,14 @@ func TestOrderGetOrderDetail(t *testing.T) { //globals.SugarLogger.Debugf("%s", utils.Format4Output(result, false)) } +func TestJsuan(t *testing.T) { + fmt.Println(StandardPrice2Int2(-12.39)) +} + +func StandardPrice2Int2(value float64) int64 { + return int64(math.Round(value * 100)) +} + func TestOrderGetOrderDetail2(t *testing.T) { result, err := api.OrderGetOrderDetail2(1100687990339131759, false) if err != nil { @@ -141,7 +150,7 @@ func TestOrderGetRiderInfoPhoneNumber(t *testing.T) { } func TestGetOrderRefundDetail(t *testing.T) { - result, err := api.GetOrderRefundDetail(70263190513673732, 0) + result, err := api.GetOrderRefundDetail(3801105140856800486, 0) if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/poi.go b/platformapi/mtwmapi/poi.go index a2867930..f02a0a13 100644 --- a/platformapi/mtwmapi/poi.go +++ b/platformapi/mtwmapi/poi.go @@ -3,6 +3,7 @@ package mtwmapi import ( "encoding/json" "fmt" + "git.rosy.net.cn/jx-callback/globals" "io/ioutil" "net/http" "strings" @@ -260,6 +261,9 @@ func (a *API) PoiSettleSave(poiSettleSaveParam *PoiSettleSaveParam) (vendorStore "type": poiSettleSaveParam.Type, "apply_info": string(data), }) + globals.SugarLogger.Debugf("========data := %s", utils.Format4Output(data, false)) + globals.SugarLogger.Debugf("========result := %s", utils.Format4Output(result, false)) + globals.SugarLogger.Debugf("========err := %v", err) if err == nil { vendorStoreID = result.(map[string]interface{})["success_list"].([]interface{})[0].(map[string]interface{})["app_poi_code"].(string) } diff --git a/platformapi/mtwmapi/poi_test.go b/platformapi/mtwmapi/poi_test.go index 6be87572..dd136e13 100644 --- a/platformapi/mtwmapi/poi_test.go +++ b/platformapi/mtwmapi/poi_test.go @@ -144,7 +144,7 @@ func TestPoiSettleSave(t *testing.T) { Type: 0, ApplyInfos: []*ApplyInfo{ &ApplyInfo{ - AppPoiCode: "", + AppPoiCode: "12342", SettlementID: 0, //结算ID MultiPoiBasicInfo: &MultiPoiBasicInfo{ Name: "xxx店", diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index a79523a2..de3a588f 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -487,16 +487,18 @@ func (a *API) CategoryAttrValueList(attr_id int64, keyword string) (categoryAttr } type RetailRecommendTagResp struct { - UpcCode string `json:"upc_code"` //条形码编号 如类目匹配失败,返回null - Name string `json:"name"` //商品名称 如类目匹配失败,返回null - TagID int `json:"tag_id"` //美团内部类目id - GeneralAttrs []GeneralAttrs + UpcCode string `json:"upc_code"` //条形码编号 如类目匹配失败,返回null + Name string `json:"name"` //商品名称 如类目匹配失败,返回null + TagID int `json:"tag_id"` //美团内部类目id + WeightForUnit float64 `json:"weight_for_unit"` //重量值 + WeightUnit string `json:"weight_unit"` // 表示sku的重量数值单位,枚举值如下: 1."克(g)" 2."千克(kg)" 3."毫升(ml)" 4."升(L)" 5."磅" 6."斤" 7."两"。 + GeneralAttrs []GeneralAttrs `json:"general_attrs"` } type GeneralAttrs struct { - AttrID string `json:"attr_id"` //属性id - AttrName string `json:"attr_name"` //属性名称 - ValueList []ValueList + AttrID string `json:"attr_id"` //属性id + AttrName string `json:"attr_name"` //属性名称 + ValueList []ValueList `json:"value_list"` } type ValueList struct { ValueID string `json:"value_id"` //属性值id diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 84d4bfc3..a228a7d8 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -206,6 +206,11 @@ func TestRetailGetSpTagIds(t *testing.T) { if len(result) == 0 { t.Fatal("should have items") } + for _, v := range result { + if v.Name == "神价商品" { + fmt.Println(v) + } + } t.Log(utils.Format4Output(result, false)) } @@ -231,7 +236,7 @@ func TestBatchSetPrice(t *testing.T) { } func TestRetailDelete(t *testing.T) { - poiCode := "7954977" + poiCode := "18877719" i := 0 count := 0 @@ -477,7 +482,7 @@ func TestRetailSellStatus2(t *testing.T) { //根据分类id查询属性列表 func TestCategoryAttrList(t *testing.T) { //result, err := api.CategoryAttrList(200002680) - result, err := api.CategoryAttrList(200005790) + result, err := api.CategoryAttrList(200005659) if err != nil { t.Fatal(err) } @@ -498,7 +503,7 @@ func TestCategoryAttrValueList(t *testing.T) { } func TestRetailRecommendTag(t *testing.T) { - result, err := api.RetailRecommendTag("长豆角", "", 0, 1) + result, err := api.RetailRecommendTag("碱粽子", "", 200004956, 2) if err != nil { t.Fatal(err) } diff --git a/platformapi/tao_vegetable/order_test.go b/platformapi/tao_vegetable/order_test.go index f179c073..8017f955 100644 --- a/platformapi/tao_vegetable/order_test.go +++ b/platformapi/tao_vegetable/order_test.go @@ -243,8 +243,8 @@ func TestDeliveryTrajectory(t *testing.T) { func TestQueryBillList(t *testing.T) { queryData := time.Now() - create := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-26, 0, 0, 0, 0, queryData.Location()) - end := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-14, 23, 59, 59, 59, queryData.Location()) + create := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-17, 0, 0, 0, 0, queryData.Location()) + end := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-15, 23, 59, 59, 59, queryData.Location()) data, err := GetOrderTotalShopMoney("", "JX668429", create, end) diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index d1c0344f..e815e2fd 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -8,7 +8,7 @@ import ( ) // 京西速食(蔬菜) -var token1 = `{"access_token":"71480acc-92ff-4044-8848-a6a76d1ae186","expires_in":1717551716,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"98eab67a-fa88-442d-ba46-48a6dcf5a101","authority_id":""}` +var token1 = `{"access_token":"83b9af04-3419-46ae-90fd-fe496330bb69","expires_in":1718153350,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"804d69e4-4b0a-4bc5-a409-ca35455f67f7","authority_id":""}` // 美好菜市 //var token1 = `{"access_token":"9a315a03-c737-4a82-ae52-c9a6ce827007","expires_in":1699490747,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"8334c006-5301-4d25-911b-4d8cc7b70ebb","authority_id":""}` diff --git a/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go b/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go index 9129a218..3397e18d 100644 --- a/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go +++ b/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go @@ -8,7 +8,7 @@ import ( ) func TestBillDetail(t *testing.T) { - orderDetail, err := a.GetTiktokOrderDetail("6925277063668307022") + orderDetail, err := a.GetTiktokOrderDetail("6930445286770611595") if err != nil { fmt.Println(err) } @@ -17,7 +17,7 @@ func TestBillDetail(t *testing.T) { for _, v := range orderDetail.SkuOrderList { childrenOrderList = append(childrenOrderList, v.OrderId) } - childrenOrderList = append(childrenOrderList, "6925277063668307022") + childrenOrderList = append(childrenOrderList, "6930445286770611595") date, datae, err := a.GetSettleBillDetailV3(&order_getSettleBillDetailV3_request.OrderGetSettleBillDetailV3Param{ Size: 20,