44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package ebaiapi
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func (a *API) OrderRatesGet(shopID string, baiduShopID int64, startTime, endTime time.Time, replyStatus int) (commentList []map[string]interface{}, err error) {
|
|
params := a.genShopIDParams(shopID, baiduShopID, 0)
|
|
if !utils.IsTimeZero(startTime) {
|
|
params["startTime"] = startTime
|
|
}
|
|
if !utils.IsTimeZero(endTime) {
|
|
params["endTime"] = endTime
|
|
}
|
|
if replyStatus >= 0 {
|
|
params["replyStatus"] = replyStatus
|
|
}
|
|
pageNo := 1
|
|
for {
|
|
params["page"] = pageNo
|
|
result, err := a.AccessAPI("ugc.orderrates.get", params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
data := result.Data.(map[string]interface{})
|
|
commentList = append(commentList, utils.Slice2MapSlice(data["comment_list"].([]interface{}))...)
|
|
total := int(utils.MustInterface2Int64(data["total"]))
|
|
if len(commentList) >= total {
|
|
break
|
|
}
|
|
}
|
|
return commentList, err
|
|
}
|
|
|
|
func (a *API) OrderRatesReply(shopID string, baiduShopID int64, commentID, content string) (err error) {
|
|
params := a.genShopIDParams(shopID, baiduShopID, 0)
|
|
params["comment_id"] = commentID
|
|
params["content"] = content
|
|
_, err = a.AccessAPI("ugc.reply", params)
|
|
return err
|
|
}
|