diff --git a/chain_transfer/svc/svc_turnchain.go b/chain_transfer/svc/svc_turnchain.go index 3ca050e..3659528 100644 --- a/chain_transfer/svc/svc_turnchain.go +++ b/chain_transfer/svc/svc_turnchain.go @@ -1,7 +1,6 @@ package svc import ( - taoke "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/dataoke" "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/db" "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/db/model" "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/db/offical" @@ -440,20 +439,19 @@ func TikTokUrl(eg *xorm.Engine, dbName string, gid, activityId string) string { // 淘口令 func CheckTaobaoWordGetId(eg *xorm.Engine, dbName string, s string, args map[string]string) string { - ak := db.SysCfgGetWithDb(eg, dbName, md.KEY_CFG_ZM_AK) - sk := db.SysCfgGetWithDb(eg, dbName, md.KEY_CFG_ZM_SK) taobaoSdk, _ := taobao.NewTaobaoSDK(eg, dbName, args["platfrom"], zhios_third_party_utils.StrToInt(args["acc_taobao_share_id"]), args["union_id"]) if taobaoSdk == nil { return "" } - itemData := zhimeng.WordParse(ak, sk, taobaoSdk.SelfPromoIdWeb, s, taobaoSdk.UserSID, taobaoSdk.Svc_AK) - fmt.Println(itemData) + urls, _ := taobaoSdk.WnConvertUrlSC(s, "2", taobaoSdk.SelfPromoIdWeb, args["acc_taobao_share_id"]) + if urls == nil { + return "" + } // 查无数据 - if itemData.Gid == "" { + if urls.ItemId == "" { return "" } - - return itemData.Gid + return urls.ItemId } func CommGetGoods(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]string, tcPrase md.TCPrase, isFirst int, reqCount, pvd, goodsId, countUrl, tklWord, isTkl string) (md.TCPrase, string) { newPvd := pvd @@ -778,16 +776,19 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]str } func CheckTaobao(eg *xorm.Engine, dbName, s string, args map[string]string) *md.ItemParseInfo { bizSceneId := "2" + taobaoSdk, _ := taobao.NewTaobaoSDK(eg, args["master_id"], args["platform"], zhios_third_party_utils.StrToInt(args["acc_taobao_share_id"]), args["union_id"]) + if taobaoSdk == nil { + return nil + } + if strings.Contains(s, "s.click.Taobao") { - parse, err := taoke.DaTaoKeContentParse(s) - if err != nil || parse.ItemId == "" { + gid := CheckTaobaoWordGetId(eg, dbName, s, args) + if gid == "" { return nil } - s = "https://uland.taobao.com/item/edetail?id=" + parse.ItemId + s = "https://uland.taobao.com/item/edetail?id=" + gid bizSceneId = "" - } - taobaoSdk, _ := taobao.NewTaobaoSDK(eg, args["master_id"], args["platform"], zhios_third_party_utils.StrToInt(args["acc_taobao_share_id"]), args["union_id"]) itemInfo, err := taobaoSdk.ItemDetailByLink(s, bizSceneId) if itemInfo == nil || err != nil { return nil @@ -800,16 +801,6 @@ func CheckTaobao(eg *xorm.Engine, dbName, s string, args map[string]string) *md. convertUrl, err := ConvertUrl(eg, args) if err == nil && convertUrl != nil { couponUrl = convertUrl.ShortenURL - ////如果优惠券高 - //if strings.Contains(couponUrl, "uland.") { - // if strings.Contains(couponUrl, "?") { - // couponUrl += "&activityId=" + itemInfo.ActivityId - // } else { - // couponUrl += "?activityId=" + itemInfo.ActivityId - // } - //} - couponUrl = couponUrl + "&relationId=" + args["acc_taobao_share_id"] - } provider := md.PVD_TB if itemInfo.UserType == 1 {