This commit is contained in:
苏尹岚
2021-03-10 10:30:11 +08:00
parent 0bad10fc85
commit f210ed13db
2 changed files with 27 additions and 0 deletions

View File

@@ -315,3 +315,22 @@ func (a *API) PoiSettleAuditSubmit(appPoiCodes []string) (err error) {
})
return err
}
type CommentScoreResult struct {
AppPoiCode string `json:"appPoiCode"`
AvgPoiScore float64 `json:"avgPoiScore"`
AvgTasteScore float64 `json:"avgTasteScore"`
AvgPackingScore float64 `json:"avgPackingScore"`
AvgDeliveryScore float64 `json:"avgDeliveryScore"`
}
// 通过门店ID获取当前门店评分
func (a *API) CommentScore(appPoiCode string) (commentScoreResult *CommentScoreResult, err error) {
result, err := a.AccessAPI("comment/score", true, map[string]interface{}{
"app_poi_code": appPoiCode,
})
if err == nil {
utils.Map2StructByJson(result, &commentScoreResult, false)
}
return commentScoreResult, err
}

View File

@@ -149,3 +149,11 @@ func TestPoiSettleSettlementList(t *testing.T) {
}
t.Log(utils.Format4Output(result, false))
}
func TestCommentScore(t *testing.T) {
result, err := api.CommentScore("11182878")
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}