|
|
@@ -5,6 +5,7 @@ import ( |
|
|
|
"encoding/json" |
|
|
|
"github.com/syyongx/php2go" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
|
|
|
|
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 { |
|
|
|
if v.LinkInfoDto.CouponLongUrl == "" && v.LinkInfoDto.CpsLongUrl == "" { |
|
|
|
continue |
|
|
|
} |
|
|
|
url = v.LinkInfoDto.CouponLongUrl |
|
|
|
tkl = v.LinkInfoDto.CouponFullTpwd |
|
|
|
shortTkl = v.LinkInfoDto.CouponShortTpwd |
|
|
@@ -263,6 +267,18 @@ func (t *TB) WnConvertUrlSC(itemId, types, pid, externalId string) (*md.Converte |
|
|
|
shortTkl = v.LinkInfoDto.CpsShortTpwd |
|
|
|
itemUrl = url |
|
|
|
} |
|
|
|
isDown := "0" |
|
|
|
if tkl == "" { |
|
|
|
isDown = "2" |
|
|
|
} |
|
|
|
if strings.Contains(string(resp), "该商品已下架") { |
|
|
|
isDown = "1" |
|
|
|
} |
|
|
|
if isDown == "1" { |
|
|
|
tkl = "" |
|
|
|
shortTkl = "" |
|
|
|
itemId = "" |
|
|
|
} |
|
|
|
return &md.ConvertedUrls{ |
|
|
|
Tkl: tkl, |
|
|
|
ShortTkl: shortTkl, |
|
|
|