Skip to content

Commit

Permalink
Merge branch 'release/v1.27.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Sep 26, 2024
2 parents 2921485 + 6fb7df6 commit 7d715ea
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
16 changes: 16 additions & 0 deletions marketing-api/api/dpa/clue_product_save.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package dpa

import (
"context"

"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/dpa"
)

func ClueProductSave(ctx context.Context, clt *core.SDKClient, accessToken string, req *dpa.ClueProductSaveRequest) (*dpa.ClueProductSaveResult, error) {
var resp dpa.ClueProductSaveResponse
if err := clt.PostAPI(ctx, "2/dpa/clue_product/save/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
34 changes: 34 additions & 0 deletions marketing-api/model/dpa/clue_product_save.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package dpa

import (
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)

// ClueProductSaveRequest 创建/编辑升级版商品 API Request
type ClueProductSaveRequest struct {
// Product 商品信息
Product *Product `json:"product,omitempty"`
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Encode implements PostRequest interface
func (r ClueProductSaveRequest) Encode() []byte {
return util.JSONMarshal(r)
}

// ClueProductSaveResponse 创建/编辑升级版商品 API Response
type ClueProductSaveResponse struct {
model.BaseResponse
Data *ClueProductSaveResult `json:"data,omitempty"`
}

type ClueProductSaveResult struct {
// PlatformProductID 商品ID
PlatformProductID uint64 `json:"platform_product_id,omitempty"`
// OuterID 商品外部ID
OuterID string `json:"outer_id,omitempty"`
// StoreID 店铺ID
StoreID string `json:"store_id,omitempty"`
}
10 changes: 10 additions & 0 deletions marketing-api/model/dpa/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type Product struct {
Stock int `json:"stock,omitempty"`
// LandingInfo 落地页信息
LandingInfo *LandingInfo `json:"landing_info,omitempty"`
// LandingURL 落地页信息
LandingURL *LandingInfo `json:"landing_url,omitempty"`
// BrandInfo 品牌信息
BrandInfo *BrandInfo `json:"brand_info,omitempty"`
// ShopKeeperInfo 商户信息
Expand Down Expand Up @@ -82,6 +84,8 @@ type Product struct {
ExternalURL string `json:"external_url,omitempty"`
// Category 商品类目信息
Category *ProductCategory `json:"category,omitempty"`
// CategoryID 类目ID
CategoryID uint64 `json:"category_id,omitempty"`
// FirstCategory 商品所处一级行业
FirstCategory string `json:"first_category,omitempty"`
// SubCategory 商品所处二级行业
Expand Down Expand Up @@ -220,6 +224,12 @@ type PriceInfo struct {
type Profession struct {
// Platform 平台信息,枚举值:淘宝 天猫 京东 其他
Platform string `json:"platform,omitempty"`
// StoreName 店铺名称
StoreName string `json:"store_name,omitempty"`
// StoreID 店铺ID
StoreID string `json:"store_ID,omitempty"`
// PriceList 商品价格
PriceList string `json:"price_list,omitempty"`
// Chapter 章节信息,结构为一个json字符串,章节名称name长度小于100;章节详细内容content长度小于5000
// 示例:"[{"id":"0","name":"莫欺少年穷","content":"莫欺少年穷"},{"id":"1","name":"莫欺中年穷","content":"莫欺中年穷"}]"
Chapter string `json:"chapter,omitempty"`
Expand Down

0 comments on commit 7d715ea

Please sign in to comment.