- refactor config ReallyCallPlatformAPI, ReallySendWeixinMsg and ReallyReplyComment

This commit is contained in:
gazebo
2019-03-15 11:09:43 +08:00
parent df54ea9478
commit bb01fc422b
9 changed files with 55 additions and 63 deletions

View File

@@ -125,9 +125,7 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
comment.Status = COMMENT_RESOLVED
}
if score <= JX_BAD_COMMENTS_MAX_LEVEL && comment.Jxstoreid != "" {
if globals.ReallyCallPlatformAPI {
weixinmsg.PushJDBadCommentToWeiXin(comment)
}
weixinmsg.PushJDBadCommentToWeiXin(comment)
}
if err == nil {
if isNewComment {
@@ -157,13 +155,7 @@ func (c *PurchaseHandler) replyOrderComment(intOrderID int64, jdStoreNo string,
content := config.comments[rand.Intn(len(config.comments))]
globals.SugarLogger.Debugf("replyOrderComment orderID:%d, delaySeconds:%d, content:%s", intOrderID, delaySeconds, content)
utils.AfterFuncWithRecover(time.Duration(delaySeconds)*time.Second, func() {
// err2 := utils.CallFuncLogError(func() error {
// if globals.ReallyCallPlatformAPI {
// return api.JdAPI.OrgReplyComment(intOrderID, jdStoreNo, content, utils.GetAPIOperator(""))
// }
// return nil
// }, "replyOrderComment %d", intOrderID)
if globals.ReallySendWeixinMsg {
if globals.ReallyReplyComment {
err2 := api.JdAPI.OrgReplyComment(intOrderID, jdStoreNo, content, utils.GetAPIOperator(""))
globals.SugarLogger.Debugf("replyOrderComment orderID:%d, error:%v", intOrderID, err2)
}