- 将URL信息放到配置文件中

This commit is contained in:
gazebo
2019-04-25 12:13:01 +08:00
parent d9276e5833
commit 1ef854a0c6
7 changed files with 33 additions and 20 deletions

View File

@@ -80,7 +80,7 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, ti
BillTitle: title,
}
if err = dao.CreateEntity(db, billRec); err == nil {
err = weixinmsg.NotifySaleBill(storeID, title, shopName, "http://www.jxc4.com/billshow/?path="+billRec.Url)
err = weixinmsg.NotifySaleBill(storeID, title, shopName, fmt.Sprintf("%s/billshow/?path=%s", globals.BackstageHost, billRec.Url))
if err != nil {
globals.SugarLogger.Infof("SendFilesToStores NotifySaleBill file:%s error:%v", fileHeader.Filename, err)
}

View File

@@ -423,7 +423,7 @@ func BuildSkuFromEbaiStore(ctx *jxcontext.Context, baiduShopID int64, isAsync, i
err = nil
continue
}
qiniuImgURL := "http://image.jxc4.com/" + key + "?imageMogr2/thumbnail/x800/gravity/Center/crop/800x800"
qiniuImgURL := jxutils.ComposeQiniuResURL(key) + "?imageMogr2/thumbnail/x800/gravity/Center/crop/800x800"
for _, sku := range skuNameExt.Skus {
jdCatID := 22410 // 其他国产水果
if cat.Name == "进口水果" {

View File

@@ -15,12 +15,10 @@ import (
)
const (
// WX_TO_ORDER_PAGE_URL = "http://www.jxc4.com/jx/h5/#/?jxStoreId="
// WX_TO_SHOW_COMMENTS_DETAIL_URL = "http://www.jxc4.com/jx/h5/#/assess-list?jxStoreId=" //展示差评详情的页面
WX_TO_ORDER_PAGE_URL = "http://wx.jxc4.com/#/?jxStoreId="
WX_TO_STORE_SKU_PAGE_URL = "http://wx.jxc4.com/#/shop?jxStoreId="
WX_TO_SHOW_COMMENTS_DETAIL_URL = "http://wx.jxc4.com/#/assess-list?jxStoreId=" //展示差评详情的页面
WX_TO_SHOW_MSG = "http://wx.jxc4.com/#/message-detail?msgID=%d&msgStatusID=%d"
WX_TO_ORDER_PAGE_URL = "/#/?jxStoreId="
WX_TO_STORE_SKU_PAGE_URL = "/#/shop?jxStoreId="
WX_TO_SHOW_COMMENTS_DETAIL_URL = "/#/assess-list?jxStoreId=" //展示差评详情的页面
WX_TO_SHOW_MSG = "/#/message-detail?msgID=%d&msgStatusID=%d"
WX_MINI_TO_ORDER_PAGE_URL = "pages/order-manager/main"
WX_MINI_TO_STORE_SKU_PAGE_URL = "pages/goods-manager/main"
@@ -205,7 +203,7 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
},
}
storeID := jxutils.GetSaleStoreIDFromOrder(order)
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
}
func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlreadyCandidate bool) error {
@@ -340,7 +338,7 @@ func PushJDBadCommentToWeiXin(comment *legacymodel.JxBadComments) (err error) {
},
}
storeID := int(utils.Str2Int64(comment.Jxstoreid))
return SendMsgToStore(storeID, WX_BAD_COMMENT_PUSH_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_SHOW_COMMENTS_DETAIL_URL, storeID), WX_MINI_TO_SHOW_COMMENTS_DETAIL_URL, data)
return SendMsgToStore(storeID, WX_BAD_COMMENT_PUSH_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_SHOW_COMMENTS_DETAIL_URL, storeID), WX_MINI_TO_SHOW_COMMENTS_DETAIL_URL, data)
}
func NotifySaleBill(storeID int, title, shopName, fileURL string) (err error) {
@@ -379,7 +377,7 @@ func NotifySaleBill(storeID int, title, shopName, fileURL string) (err error) {
func NotifyStoreOpRequestStatus(isAccepted bool, storeID, nameID int, spuName string, originalUnitPrice, unitPrice int, rejectReason string) (err error) {
globals.SugarLogger.Debugf("NotifyStoreOpRequestStatus isAccepted:%t, storeID:%d, nameID:%d, spuName:%s, originalUnitPrice:%d, unitPrice:%d, rejectReason:%s", isAccepted, storeID, nameID, spuName, originalUnitPrice, unitPrice, rejectReason)
templateID := ""
fileURL := fmt.Sprintf("%s%d", WX_TO_STORE_SKU_PAGE_URL, storeID)
fileURL := globals.WxBackstageHost + fmt.Sprintf("%s%d", WX_TO_STORE_SKU_PAGE_URL, storeID)
data := make(map[string]interface{})
if isAccepted {
templateID = WX_CHANGE_APPROVED_TEMPLATE_ID
@@ -426,7 +424,7 @@ func NotifyStoreOpRequestStatus(isAccepted bool, storeID, nameID int, spuName st
func NotifyStoreMessage(storeID, msgID, msgStatusID int, title, content string) (err error) {
globals.SugarLogger.Debugf("NotifyStoreMessage storeID:%d, msgID:%d, title:%s, content:%s", storeID, msgID, title, content)
templateID := WX_NORMAL_STORE_MSG_TEMPLATE_ID
fileURL := fmt.Sprintf(WX_TO_SHOW_MSG, msgID, msgStatusID)
fileURL := globals.WxBackstageHost + fmt.Sprintf(WX_TO_SHOW_MSG, msgID, msgStatusID)
data := map[string]interface{}{
"first": map[string]interface{}{
"value": content,