diff --git a/platformapi/mtwmapi/comment_test.go b/platformapi/mtwmapi/comment_test.go index fde47762..c8e15f8f 100644 --- a/platformapi/mtwmapi/comment_test.go +++ b/platformapi/mtwmapi/comment_test.go @@ -11,7 +11,7 @@ import ( ) func TestCommentQuery(t *testing.T) { - result, err := api.CommentQuery("23932637", "20240813", "20240819", 0, 0, CommentReplyStatusNotReplied) + result, err := api.CommentQuery("27674533", "20250415", "20250506", 19, 1, CommentReplyStatusAll) if err != nil { t.Fatal(err) } @@ -26,14 +26,15 @@ func TestCommentQuery(t *testing.T) { for _, fn := range mtwmComment.CommentOrderDetail { if len(fn.FoodName)-strings.LastIndex(fn.FoodName, ")") > 3 { - foodNameList[fn.FoodName] = 1 + foodNameList[strings.TrimSpace(fn.FoodName)] = 1 } else { - foodNameList[fn.FoodName[0:strings.LastIndex(fn.FoodName, "(")]] = 1 + foodNameList[strings.TrimSpace(fn.FoodName[0:strings.LastIndex(fn.FoodName, "(")])] = 1 } } fmt.Println(foodNameList) } + fmt.Println(result[19]) //t.Log(utils.Format4Output(result, false)) } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 176e6b4f..ffa2df47 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -20,10 +20,10 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 - api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") + //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_n49KrTnbe-Qatd-80sFOnQ") diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index f23a1fd8..aefb1f79 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -5,6 +5,7 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" "testing" + "time" ) // 京西速食(蔬菜) @@ -41,3 +42,20 @@ func TestGetSkuDetailLocalID(t *testing.T) { globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false)) globals.SugarLogger.Debugf("data=%s", err) } + +func TestAaa(t *testing.T) { + strTime := []string{"2025-05-06", "2025-05-07"} + var err error + timeList := make([]time.Time, len(strTime)) + for k, v := range strTime { + if v == "" { + timeList[k] = utils.DefaultTimeValue + } else { + if timeList[k], err = utils.TryStr2Time(v); err != nil { + fmt.Println(err) + } + } + } + timeList[1].Add(24 * 60 * time.Minute) + fmt.Println(timeList) +}