|
@@ -7,15 +7,19 @@ import ( |
|
|
"github.com/tidwall/gjson" |
|
|
"github.com/tidwall/gjson" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
//关键字查询 |
|
|
|
|
|
|
|
|
// 关键字查询 |
|
|
func QueryWithOauth(serviceParam map[string]string, param string) []wph.WphGoods { |
|
|
func QueryWithOauth(serviceParam map[string]string, param string) []wph.WphGoods { |
|
|
post, _ := SendPost("com.vip.adp.api.open.service.UnionGoodsService", "queryWithOauth", serviceParam, param) |
|
|
post, _ := SendPost("com.vip.adp.api.open.service.UnionGoodsService", "queryWithOauth", serviceParam, param) |
|
|
var goods = make([]wph.OfficialGoods, 0) |
|
|
var goods = make([]wph.OfficialGoods, 0) |
|
|
json.Unmarshal([]byte(gjson.Get(post, "result.goodsInfoList").String()), &goods) |
|
|
json.Unmarshal([]byte(gjson.Get(post, "result.goodsInfoList").String()), &goods) |
|
|
list := make([]wph.WphGoods, 0) |
|
|
list := make([]wph.WphGoods, 0) |
|
|
for _, v := range goods { |
|
|
for _, v := range goods { |
|
|
|
|
|
gid := v.GoodsId |
|
|
|
|
|
if v.AdCode != "" { |
|
|
|
|
|
gid = v.GoodsId + "adCode" + v.AdCode |
|
|
|
|
|
} |
|
|
tmp := wph.WphGoods{ |
|
|
tmp := wph.WphGoods{ |
|
|
Gid: v.GoodsId + "adCode" + v.AdCode, |
|
|
|
|
|
|
|
|
Gid: gid, |
|
|
AdCode: v.AdCode, |
|
|
AdCode: v.AdCode, |
|
|
GoodsTitle: v.GoodsName, |
|
|
GoodsTitle: v.GoodsName, |
|
|
GoodsDesc: v.GoodsDesc, |
|
|
GoodsDesc: v.GoodsDesc, |
|
@@ -39,15 +43,19 @@ func QueryWithOauth(serviceParam map[string]string, param string) []wph.WphGoods |
|
|
return list |
|
|
return list |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//联盟在推商品列表 |
|
|
|
|
|
|
|
|
// 联盟在推商品列表 |
|
|
func GoodsListWithOauth(serviceParam map[string]string, param string) []wph.WphGoods { |
|
|
func GoodsListWithOauth(serviceParam map[string]string, param string) []wph.WphGoods { |
|
|
post, _ := SendPost("com.vip.adp.api.open.service.UnionGoodsService", "goodsListWithOauth", serviceParam, param) |
|
|
post, _ := SendPost("com.vip.adp.api.open.service.UnionGoodsService", "goodsListWithOauth", serviceParam, param) |
|
|
var goods = make([]wph.OfficialGoods, 0) |
|
|
var goods = make([]wph.OfficialGoods, 0) |
|
|
json.Unmarshal([]byte(gjson.Get(post, "result.goodsInfoList").String()), &goods) |
|
|
json.Unmarshal([]byte(gjson.Get(post, "result.goodsInfoList").String()), &goods) |
|
|
list := make([]wph.WphGoods, 0) |
|
|
list := make([]wph.WphGoods, 0) |
|
|
for _, v := range goods { |
|
|
for _, v := range goods { |
|
|
|
|
|
gid := v.GoodsId |
|
|
|
|
|
if v.AdCode != "" { |
|
|
|
|
|
gid = v.GoodsId + "adCode" + v.AdCode |
|
|
|
|
|
} |
|
|
tmp := wph.WphGoods{ |
|
|
tmp := wph.WphGoods{ |
|
|
Gid: v.GoodsId + "adCode" + v.AdCode, |
|
|
|
|
|
|
|
|
Gid: gid, |
|
|
AdCode: v.AdCode, |
|
|
AdCode: v.AdCode, |
|
|
GoodsTitle: v.GoodsName, |
|
|
GoodsTitle: v.GoodsName, |
|
|
GoodsDesc: v.GoodsDesc, |
|
|
GoodsDesc: v.GoodsDesc, |
|
@@ -77,8 +85,12 @@ func GetByGoodsIdsWithOauth(serviceParam map[string]string, param string) []wph. |
|
|
json.Unmarshal([]byte(gjson.Get(post, "result").String()), &goods) |
|
|
json.Unmarshal([]byte(gjson.Get(post, "result").String()), &goods) |
|
|
list := make([]wph.WphGoods, 0) |
|
|
list := make([]wph.WphGoods, 0) |
|
|
for _, v := range goods { |
|
|
for _, v := range goods { |
|
|
|
|
|
gid := v.GoodsId |
|
|
|
|
|
if v.AdCode != "" { |
|
|
|
|
|
gid = v.GoodsId + "adCode" + v.AdCode |
|
|
|
|
|
} |
|
|
tmp := wph.WphGoods{ |
|
|
tmp := wph.WphGoods{ |
|
|
Gid: v.GoodsId + "adCode" + v.AdCode, |
|
|
|
|
|
|
|
|
Gid: gid, |
|
|
AdCode: v.AdCode, |
|
|
AdCode: v.AdCode, |
|
|
GoodsTitle: v.GoodsName, |
|
|
GoodsTitle: v.GoodsName, |
|
|
GoodsDesc: v.GoodsDesc, |
|
|
GoodsDesc: v.GoodsDesc, |
|
|