修复聚推客取链报错问题

This commit is contained in:
yanfan 2025-06-24 11:35:45 +08:00
parent ce8c7bfd50
commit ea00ab3a31
3 changed files with 11 additions and 1 deletions

View File

@ -65,6 +65,15 @@ func (a *jutuikeApiImpl) GenerateLink(ctx context.Context, req GenerateLinkReque
result.PosterQrcodeUrl = cast.ToString(posterQrcodeUrl) result.PosterQrcodeUrl = cast.ToString(posterQrcodeUrl)
} }
} }
if taoBaoPoster, ok := data["taobao_poster_qrcode_url"]; ok {
if result.PosterQrcodeUrl == "" {
result.PosterQrcodeUrl = cast.ToString(taoBaoPoster)
}
}
if tkl, ok := data["tkl"]; ok {
result.Tkl = cast.ToString(tkl)
}
if h5Url, ok := data["h5"]; ok { if h5Url, ok := data["h5"]; ok {
if h5Url != nil { if h5Url != nil {
result.H5 = cast.ToString(h5Url) result.H5 = cast.ToString(h5Url)

View File

@ -28,7 +28,7 @@ func (a *apiClientSuite) SetupSuite() {
func (a *apiClientSuite) Test_GenerateLink() { func (a *apiClientSuite) Test_GenerateLink() {
req := GenerateLinkRequest{ req := GenerateLinkRequest{
ActId: 74, ActId: 60,
Sid: "10001zdt100034", Sid: "10001zdt100034",
} }
result, err := a.api.GenerateLink(context.Background(), req) result, err := a.api.GenerateLink(context.Background(), req)

View File

@ -20,6 +20,7 @@ type GenerateLinkData struct {
LongH5 string `json:"long_h5"` // 推广长链接(部分活动没有,请注意判断) LongH5 string `json:"long_h5"` // 推广长链接(部分活动没有,请注意判断)
H5Evoke string `json:"h5_evoke"` H5Evoke string `json:"h5_evoke"`
DeepLink string `json:"deeplink"` DeepLink string `json:"deeplink"`
Tkl string `json:"tkl"`
WeAppInfo *WeAppInfo `json:"we_app_info"` // 微信小程序信息(部分活动没有,请注意判断) WeAppInfo *WeAppInfo `json:"we_app_info"` // 微信小程序信息(部分活动没有,请注意判断)
AlipayAppInfo *AlipayAppInfo `json:"alipay_app_info"` //支付宝小程序信息(部分活动没有,请注意判断) AlipayAppInfo *AlipayAppInfo `json:"alipay_app_info"` //支付宝小程序信息(部分活动没有,请注意判断)
} }