jd

package module
v0.0.0-...-5750f7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	AppKey    string        // 应用Key
	SecretKey string        // 密钥
	ZapLog    *zap.Logger   // 日志服务
	Db        *gorm.DB      // 关系数据库服务
	RDb       *redis.Client // 缓存数据库服务
	MDb       *mongo.Client // 非关系数据库服务
}

func (*App) CommissionIntegralToInt64

func (app *App) CommissionIntegralToInt64(GoodsPrice, CouponProportion int64) int64

CommissionIntegralToInt64 佣金积分

func (*App) CouponAmountToInt64

func (app *App) CouponAmountToInt64(Commission float64) int64

CouponAmountToInt64 优惠券金额

func (*App) CouponProportionToInt64

func (app *App) CouponProportionToInt64(CommissionShare float64) int64

CouponProportionToInt64 佣金比率

func (*App) GoodsOriginalPriceToInt64

func (app *App) GoodsOriginalPriceToInt64(Price float64) int64

GoodsOriginalPriceToInt64 商品原价

func (*App) GoodsPriceToInt64

func (app *App) GoodsPriceToInt64(LowestCouponPrice float64) int64

GoodsPriceToInt64 商品券后价

func (*App) Sign

func (app *App) Sign(p Params)

func (*App) UnionOpenGoodsJIngFenQuery

func (app *App) UnionOpenGoodsJIngFenQuery(notMustParams ...Params) *UnionOpenGoodsJIngFenQueryResult

UnionOpenGoodsJIngFenQuery 京东联盟精选优质商品,每日更新,可通过频道ID查询各个频道下的精选商品。用获取的优惠券链接调用转链接口时,需传入搜索接口link字段返回的原始优惠券链接,切勿对链接进行任何encode、decode操作,否则将导致转链二合一推广链接时校验失败 https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.goods.jingfen.query

func (*App) UnionOpenGoodsPromotionGoodsInfoQuery

func (app *App) UnionOpenGoodsPromotionGoodsInfoQuery(notMustParams ...Params) *UnionOpenGoodsPromotionGoodsInfoQueryResult

UnionOpenGoodsPromotionGoodsInfoQuery 通过SKUID查询推广商品的名称、主图、类目、价格、物流、是否自营、30天引单数量等详细信息,支持批量获取。通常用于在媒体侧展示商品详情。 https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.goods.promotiongoodsinfo.query

func (*App) UnionOpenPromotionCommonGet

func (app *App) UnionOpenPromotionCommonGet(notMustParams ...Params) *UnionOpenPromotionCommonGetResult

UnionOpenPromotionCommonGet 网站/APP来获取的推广链接,功能同宙斯接口的自定义链接转换、 APP领取代码接口通过商品链接、活动链接获取普通推广链接,支持传入subunionid参数,可用于区分媒体自身的用户ID,该参数可在订单查询接口返回,需向cps-qxsq@jd.com申请权限。 https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.promotion.common.get

type Params

type Params map[string]interface{}

Params 请求参数

func NewParams

func NewParams() Params

func NewParamsWithType

func NewParamsWithType(_method string, params ...Params) Params

func (Params) GetQuery

func (p Params) GetQuery() string

func (Params) Set

func (p Params) Set(key string, value interface{})

func (Params) SetCustomParameters

func (p Params) SetCustomParameters(uid string, sid string)

func (Params) SetParams

func (p Params) SetParams(params Params)

type UnionOpenGoodsJIngFenQueryQueryResult

type UnionOpenGoodsJIngFenQueryQueryResult struct {
	Code int `json:"code"`
	Data []struct {
		BrandCode    string `json:"brandCode"`
		BrandName    string `json:"brandName"`
		CategoryInfo struct {
			Cid1     int64  `json:"cid1"`
			Cid1Name string `json:"cid1Name"`
			Cid2     int    `json:"cid2"`
			Cid2Name string `json:"cid2Name"`
			Cid3     int    `json:"cid3"`
			Cid3Name string `json:"cid3Name"`
		} `json:"categoryInfo"`
		Comments       int `json:"comments"`
		CommissionInfo struct {
			Commission          float64 `json:"commission"`
			CommissionShare     float64 `json:"commissionShare"`
			CouponCommission    float64 `json:"couponCommission"`
			EndTime             int64   `json:"endTime"`
			IsLock              int     `json:"isLock"`
			PlusCommissionShare float64 `json:"plusCommissionShare"`
			StartTime           int64   `json:"startTime"`
		} `json:"commissionInfo"`
		CouponInfo struct {
			CouponList []struct {
				BindType     int     `json:"bindType"`
				Discount     float64 `json:"discount"`
				GetEndTime   int64   `json:"getEndTime"`
				GetStartTime int64   `json:"getStartTime"`
				HotValue     int     `json:"hotValue,omitempty"`
				IsBest       int     `json:"isBest"`
				Link         string  `json:"link"`
				PlatformType int     `json:"platformType"`
				Quota        float64 `json:"quota"`
				UseEndTime   int64   `json:"useEndTime"`
				UseStartTime int64   `json:"useStartTime"`
			} `json:"couponList"`
		} `json:"couponInfo"`
		DeliveryType      int     `json:"deliveryType"`
		ForbidTypes       []int   `json:"forbidTypes"`
		GoodCommentsShare float64 `json:"goodCommentsShare"`
		ImageInfo         struct {
			ImageList []struct {
				Url string `json:"url"`
			} `json:"imageList"`
			WhiteImage string `json:"whiteImage,omitempty"`
		} `json:"imageInfo"`
		InOrderCount30Days    int64  `json:"inOrderCount30Days"`
		InOrderCount30DaysSku int    `json:"inOrderCount30DaysSku"`
		IsHot                 int    `json:"isHot"`
		JxFlags               []int  `json:"jxFlags,omitempty"`
		MaterialUrl           string `json:"materialUrl"`
		Owner                 string `json:"owner"`
		PinGouInfo            struct {
			PingouEndTime   int64   `json:"pingouEndTime,omitempty"`
			PingouPrice     float64 `json:"pingouPrice,omitempty"`
			PingouStartTime int64   `json:"pingouStartTime,omitempty"`
			PingouTmCount   int     `json:"pingouTmCount,omitempty"`
			PingouUrl       string  `json:"pingouUrl,omitempty"`
		} `json:"pinGouInfo"`
		PriceInfo struct {
			HistoryPriceDay   int     `json:"historyPriceDay"`
			LowestCouponPrice float64 `json:"lowestCouponPrice"`
			LowestPrice       float64 `json:"lowestPrice"`
			LowestPriceType   int     `json:"lowestPriceType"`
			Price             float64 `json:"price"`
		} `json:"priceInfo"`
		ResourceInfo struct {
			EliteId   int    `json:"eliteId"`
			EliteName string `json:"eliteName"`
		} `json:"resourceInfo"`
		ShopInfo struct {
			ShopId                        int64   `json:"shopId"`
			ShopLabel                     string  `json:"shopLabel"`
			ShopLevel                     float64 `json:"shopLevel"`
			ShopName                      string  `json:"shopName"`
			AfsFactorScoreRankGrade       string  `json:"afsFactorScoreRankGrade,omitempty"`
			AfterServiceScore             string  `json:"afterServiceScore,omitempty"`
			CommentFactorScoreRankGrade   string  `json:"commentFactorScoreRankGrade,omitempty"`
			LogisticsFactorScoreRankGrade string  `json:"logisticsFactorScoreRankGrade,omitempty"`
			LogisticsLvyueScore           string  `json:"logisticsLvyueScore,omitempty"`
			ScoreRankRate                 string  `json:"scoreRankRate,omitempty"`
			UserEvaluateScore             string  `json:"userEvaluateScore,omitempty"`
		} `json:"shopInfo"`
		SkuId        int64 `json:"skuId"`
		SkuLabelInfo struct {
			FxgServiceList []interface{} `json:"fxgServiceList"`
			Is7ToReturn    int           `json:"is7ToReturn"`
		} `json:"skuLabelInfo"`
		SkuName string `json:"skuName"`
		Spuid   int64  `json:"spuid"`
	} `json:"data"`
	Message    string `json:"message"`
	TotalCount int    `json:"totalCount"`
}

type UnionOpenGoodsJIngFenQueryResult

type UnionOpenGoodsJIngFenQueryResult struct {
	Responce UnionOpenGoodsJIngFenQueryResultResponse // 结果
	Result   UnionOpenGoodsJIngFenQueryQueryResult    // 结果
	Body     []byte                                   // 内容
	Err      error                                    // 错误
}

type UnionOpenGoodsJIngFenQueryResultResponse

type UnionOpenGoodsJIngFenQueryResultResponse struct {
	JdUnionOpenGoodsJingfenQueryResponce struct {
		Code        string `json:"code"`
		QueryResult string `json:"queryResult"`
	} `json:"jd_union_open_goods_jingfen_query_responce"`
}

type UnionOpenGoodsPromotionGoodsInfoQueryQueryResult

type UnionOpenGoodsPromotionGoodsInfoQueryQueryResult struct {
	Code int `json:"code"`
	Data []struct {
		UnitPrice         float64 `json:"unitPrice"`
		MaterialUrl       string  `json:"materialUrl"`
		EndDate           int64   `json:"endDate"`
		IsFreeFreightRisk int     `json:"isFreeFreightRisk"`
		IsFreeShipping    int     `json:"isFreeShipping"`
		CommisionRatioWl  float64 `json:"commisionRatioWl"`
		CommisionRatioPc  float64 `json:"commisionRatioPc"`
		ImgUrl            string  `json:"imgUrl"`
		Vid               int     `json:"vid"`
		CidName           string  `json:"cidName"`
		WlUnitPrice       float64 `json:"wlUnitPrice"`
		Cid2Name          string  `json:"cid2Name"`
		IsSeckill         int     `json:"isSeckill"`
		Cid2              int     `json:"cid2"`
		Cid3Name          string  `json:"cid3Name"`
		Unt               int     `json:"unt"`
		Cid3              int     `json:"cid3"`
		ShopId            int     `json:"shopId"`
		IsJdSale          int     `json:"isJdSale"`
		GoodsName         string  `json:"goodsName"`
		SkuId             int64   `json:"skuId"`
		StartDate         int64   `json:"startDate"`
		Cid               int64   `json:"cid"`
	} `json:"data"`
	Message   string `json:"message"`
	RequestId string `json:"requestId"`
}

type UnionOpenGoodsPromotionGoodsInfoQueryResult

type UnionOpenGoodsPromotionGoodsInfoQueryResult struct {
	Responce UnionOpenGoodsPromotionGoodsInfoQueryResultResponse // 结果
	Result   UnionOpenGoodsPromotionGoodsInfoQueryQueryResult    // 结果
	Body     []byte                                              // 内容
	Err      error                                               // 错误
}

type UnionOpenGoodsPromotionGoodsInfoQueryResultResponse

type UnionOpenGoodsPromotionGoodsInfoQueryResultResponse struct {
	JdUnionOpenGoodsPromotiongoodsinfoQueryResponce struct {
		Code        string `json:"code"`
		QueryResult string `json:"queryResult"`
	} `json:"jd_union_open_goods_promotiongoodsinfo_query_responce"`
}

type UnionOpenPromotionCommonGetGetResult

type UnionOpenPromotionCommonGetGetResult struct {
	Code int `json:"code"`
	Data struct {
		ClickURL string `json:"clickURL"`
		JCommand string `json:"jCommand"`
	} `json:"data"`
	Message   string `json:"message"`
	RequestId string `json:"requestId"`
}

type UnionOpenPromotionCommonGetResult

type UnionOpenPromotionCommonGetResult struct {
	Responce UnionOpenPromotionCommonGetResultResponse // 结果
	Result   UnionOpenPromotionCommonGetGetResult      // 结果
	Body     []byte                                    // 内容
	Err      error                                     // 错误
}

type UnionOpenPromotionCommonGetResultResponse

type UnionOpenPromotionCommonGetResultResponse struct {
	JdUnionOpenPromotionCommonGetResponce struct {
		Code      string `json:"code"`
		GetResult string `json:"getResult"`
	} `json:"jd_union_open_promotion_common_get_responce"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL