This commit is contained in:
richboo111
2023-10-16 09:33:08 +08:00
19 changed files with 122 additions and 43 deletions

View File

@@ -62,12 +62,12 @@ func (a *API) CommentQuery(poiCode string, startDateStr, endDateStr string, offs
params["pagesize"] = limit
result, err := a.AccessAPI("comment/query", true, params)
if err != nil {
return nil, err
break
}
var batchCommentList []*OrderComment
err = utils.Map2StructByJson(result, &batchCommentList, false)
if err != nil {
return nil, err
break
}
for _, comment := range batchCommentList {
if comment.CommentLables != "" {

View File

@@ -8,7 +8,7 @@ import (
)
func TestCommentQuery(t *testing.T) {
result, err := api.CommentQuery("18026738", "20230711", "20230717", 0, 0, CommentReplyStatusNotReplied)
result, err := api.CommentQuery("18805464", "20231009", "20231011", 0, 0, CommentReplyStatusNotReplied)
if err != nil {
t.Fatal(err)
}

View File

@@ -27,7 +27,8 @@ func init() {
//商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nngsVP37s-HXY86xe85H7Q") //token_n4TwqCntWWuvQwAawzxC0w
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_gdlIEWwQnWhl8xzj8rtPTw") //token_n4TwqCntWWuvQwAawzxC0w
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_rfAD6OxSVxkTeCO1XmNCZg") //token_n4TwqCntWWuvQwAawzxC0w
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
cookieStr := `
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
`

View File

@@ -291,7 +291,6 @@ func (a *API) RetailInitData(trackInfo, poiCode, foodCode string, params map[str
}
func (a *API) RetailBatchInitData(trackInfo, poiCode string, foodDataList []map[string]interface{}) (failedFoodList []*AppFoodResult, err error) {
globals.SugarLogger.Debugf("foodDataList :%s", utils.Format4Output(foodDataList, false))
result, err := a.AccessAPI2("retail/batchinitdata", false, map[string]interface{}{
KeyAppPoiCode: poiCode,
"food_data": string(utils.MustMarshal(foodDataList)),
@@ -300,7 +299,7 @@ func (a *API) RetailBatchInitData(trackInfo, poiCode string, foodDataList []map[
failedFoodList, err = handleRetailBatchResult(result)
}
globals.SugarLogger.Debugf("result :%s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("err :%s", utils.Format4Output(err, false))
globals.SugarLogger.Debugf("err :%v", err)
return failedFoodList, err
}