美团外卖评价正确设置TagList

This commit is contained in:
gazebo
2019-11-11 16:34:18 +08:00
parent 88b0241955
commit 281e2b436a

View File

@@ -1,6 +1,7 @@
package mtwm
import (
"strings"
"time"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
@@ -35,6 +36,13 @@ func (c *PurchaseHandler) refreshCommentOnce() {
})
}
func formalizeTagList(mtwmTagList string) (outTagList string) {
if mtwmTagList != "" {
outTagList = string(utils.Format4Output(strings.Split(mtwmTagList, ","), true))
}
return outTagList
}
func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) {
storeMapList, err2 := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDMTWM}, nil, model.StoreStatusAll, model.StoreIsSyncYes, "")
if err = err2; err != nil {
@@ -59,7 +67,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
VendorID: model.VendorIDMTWM,
UserCommentID: utils.Int64ToStr(mtwmComment.CommentID),
VendorStoreID: storeMap.VendorStoreID,
TagList: mtwmComment.CommentLables,
TagList: formalizeTagList(mtwmComment.CommentLables),
Score: int8(mtwmComment.FoodCommentScore),
ModifyDuration: BAD_COMMENTS_MAX_MODIFY_TIME,
OriginalMsg: string(utils.MustMarshal(mtwmComment)),