1
This commit is contained in:
@@ -2,17 +2,30 @@ package mtwmapi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestCommentQuery(t *testing.T) {
|
||||
result, err := api.CommentQuery("18805464", "20231009", "20231011", 0, 0, CommentReplyStatusNotReplied)
|
||||
result, err := api.CommentQuery("8694203", "20240711", "20240716", 0, 0, CommentReplyStatusAll)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
for _, mtwmComment := range result {
|
||||
foodNameList := make([]string, len(mtwmComment.CommentOrderDetail))
|
||||
for _, fn := range mtwmComment.CommentOrderDetail {
|
||||
if len(fn.FoodName)-strings.LastIndex(fn.FoodName, ")") > 3 {
|
||||
foodNameList = append(foodNameList, fn.FoodName)
|
||||
} else {
|
||||
foodNameList = append(foodNameList, fn.FoodName[0:strings.LastIndex(fn.FoodName, "(")])
|
||||
}
|
||||
}
|
||||
fmt.Println(foodNameList)
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
|
||||
//t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestCommentAddReply(t *testing.T) {
|
||||
@@ -21,7 +34,3 @@ func TestCommentAddReply(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTime(t *testing.T) {
|
||||
fmt.Println(utils.TryStr2Time("2023-07-16"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user