|
@@ -5,6 +5,7 @@ import ( |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
"github.com/syyongx/php2go" |
|
|
"github.com/syyongx/php2go" |
|
|
"strconv" |
|
|
"strconv" |
|
|
|
|
|
"strings" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
type UrlInfo struct { |
|
|
type UrlInfo struct { |
|
@@ -235,6 +236,9 @@ func (t *TB) WnConvertUrlSC(itemId, types, pid, externalId string) (*md.Converte |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for _, v := range tmp.TbkScGeneralLinkConvertResponse.Data.MaterialUrlList.MaterialUrlList { |
|
|
for _, v := range tmp.TbkScGeneralLinkConvertResponse.Data.MaterialUrlList.MaterialUrlList { |
|
|
|
|
|
if v.LinkInfoDto.CouponLongUrl == "" && v.LinkInfoDto.CpsLongUrl == "" { |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
url = v.LinkInfoDto.CouponLongUrl |
|
|
url = v.LinkInfoDto.CouponLongUrl |
|
|
tkl = v.LinkInfoDto.CouponFullTpwd |
|
|
tkl = v.LinkInfoDto.CouponFullTpwd |
|
|
shortTkl = v.LinkInfoDto.CouponShortTpwd |
|
|
shortTkl = v.LinkInfoDto.CouponShortTpwd |
|
@@ -263,6 +267,18 @@ func (t *TB) WnConvertUrlSC(itemId, types, pid, externalId string) (*md.Converte |
|
|
shortTkl = v.LinkInfoDto.CpsShortTpwd |
|
|
shortTkl = v.LinkInfoDto.CpsShortTpwd |
|
|
itemUrl = url |
|
|
itemUrl = url |
|
|
} |
|
|
} |
|
|
|
|
|
isDown := "0" |
|
|
|
|
|
if tkl == "" { |
|
|
|
|
|
isDown = "2" |
|
|
|
|
|
} |
|
|
|
|
|
if strings.Contains(string(resp), "该商品已下架") { |
|
|
|
|
|
isDown = "1" |
|
|
|
|
|
} |
|
|
|
|
|
if isDown == "1" { |
|
|
|
|
|
tkl = "" |
|
|
|
|
|
shortTkl = "" |
|
|
|
|
|
itemId = "" |
|
|
|
|
|
} |
|
|
return &md.ConvertedUrls{ |
|
|
return &md.ConvertedUrls{ |
|
|
Tkl: tkl, |
|
|
Tkl: tkl, |
|
|
ShortTkl: shortTkl, |
|
|
ShortTkl: shortTkl, |
|
|