package jdSdk

import "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm"

func ConventUrl(r *RequestJD) ([]byte, error) {
	method := "jd.union.open.promotion.byunionid.get"
	args := map[string]interface{}{
		"materialId": r.MaterialId, //推广物料链接,建议链接使用微Q前缀,能较好适配微信手Q页面
		"unionId":    r.UnionId,    //	目标推客的联盟ID
		"positionId": r.PositionId, //推广位id
		"chainType":  "3",          //转链类型,1:长链, 2 :短链 ,3: 长链+短链,默认短链
	}
	if r.CouponUrl != "" {
		args["couponUrl"] = r.CouponUrl
	}
	return send(method, comm.Arg{"promotionCodeReq": args})
}