huangjiajun преди 3 месеца
родител
ревизия
bb22b36bf4
променени са 1 файла, в които са добавени 17 реда и са изтрити 5 реда
  1. +17
    -5
      wph/goods.go

+ 17
- 5
wph/goods.go Целия файл

@@ -7,15 +7,19 @@ import (
"github.com/tidwall/gjson"
)

//关键字查询
// 关键字查询
func QueryWithOauth(serviceParam map[string]string, param string) []wph.WphGoods {
post, _ := SendPost("com.vip.adp.api.open.service.UnionGoodsService", "queryWithOauth", serviceParam, param)
var goods = make([]wph.OfficialGoods, 0)
json.Unmarshal([]byte(gjson.Get(post, "result.goodsInfoList").String()), &goods)
list := make([]wph.WphGoods, 0)
for _, v := range goods {
gid := v.GoodsId
if v.AdCode != "" {
gid = v.GoodsId + "adCode" + v.AdCode
}
tmp := wph.WphGoods{
Gid: v.GoodsId + "adCode" + v.AdCode,
Gid: gid,
AdCode: v.AdCode,
GoodsTitle: v.GoodsName,
GoodsDesc: v.GoodsDesc,
@@ -39,15 +43,19 @@ func QueryWithOauth(serviceParam map[string]string, param string) []wph.WphGoods
return list
}

//联盟在推商品列表
// 联盟在推商品列表
func GoodsListWithOauth(serviceParam map[string]string, param string) []wph.WphGoods {
post, _ := SendPost("com.vip.adp.api.open.service.UnionGoodsService", "goodsListWithOauth", serviceParam, param)
var goods = make([]wph.OfficialGoods, 0)
json.Unmarshal([]byte(gjson.Get(post, "result.goodsInfoList").String()), &goods)
list := make([]wph.WphGoods, 0)
for _, v := range goods {
gid := v.GoodsId
if v.AdCode != "" {
gid = v.GoodsId + "adCode" + v.AdCode
}
tmp := wph.WphGoods{
Gid: v.GoodsId + "adCode" + v.AdCode,
Gid: gid,
AdCode: v.AdCode,
GoodsTitle: v.GoodsName,
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)
list := make([]wph.WphGoods, 0)
for _, v := range goods {
gid := v.GoodsId
if v.AdCode != "" {
gid = v.GoodsId + "adCode" + v.AdCode
}
tmp := wph.WphGoods{
Gid: v.GoodsId + "adCode" + v.AdCode,
Gid: gid,
AdCode: v.AdCode,
GoodsTitle: v.GoodsName,
GoodsDesc: v.GoodsDesc,


Зареждане…
Отказ
Запис