-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from nukc/main
feat(page): 增加获取魔力建站落地页列表的接口
- Loading branch information
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package page | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/page" | ||
) | ||
|
||
// List 获取魔力建站落地页组信息列表 | ||
func List(clt *core.SDKClient, accessToken string, req *page.ListRequest) (*page.ListResponse, error) { | ||
var resp page.ListResponse | ||
err := clt.Post(accessToken, req, &resp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package page | ||
|
||
import "encoding/json" | ||
|
||
// ListRequest 获取魔力建站落地页信息列表 API Request | ||
type ListRequest struct { | ||
// AdvertiserID 广告主 ID,在获取 access_token 的时候返回 | ||
AdvertiserID int64 `json:"advertiser_id,omitempty"` | ||
// ViewComps 包含的组件类型, 多个类型之间是或的关系,0: 图片;1: 文本;2: 表单;3: 按钮;4: 轮播图;5: 视频;6: 地图;7: 应用下载;16: 空白组件;34:小游戏 | ||
ViewComps []int `json:"view_comps,omitempty"` | ||
// PageName 落地页名称 | ||
PageName string `json:"page_name,omitempty"` | ||
// PageType 落地页类型,1 表示联盟,非 1 现在都是主站 | ||
PageType int `json:"page_type,omitempty"` | ||
// FictionIDs 小说 ID 列表,仅对小说行业可选 | ||
FictionIDs []string `json:"fiction_ids,omitempty"` | ||
// Page 查询的页码数,默认为 1 | ||
Page int `json:"page,omitempty"` | ||
// PageSize 单页行数,默认为 20,不超过 500 | ||
PageSize int `json:"page_size,omitempty"` | ||
// ComponentRefIDs 组件中线索通ID(如:小游戏ID),和view_comps类型对应,如:查询含有小游戏id的落地页,view_comps=34;component_ref_ids=123 | ||
ComponentRefIDs []int64 `json:"component_ref_ids,omitempty"` | ||
// IsPageGroup 是否可创建程序化落地页组,仅对查询可创建程序化的落地页列表有效 | ||
IsPageGroup bool `json:"is_page_group,omitempty"` | ||
// Select 支持落地页名称模糊查询,落地页ID精准查询,和字段page_name不能同时生效 | ||
Select string `json:"select,omitempty"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r ListRequest) Url() string { | ||
return "v2/lp/page/list" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r ListRequest) Encode() []byte { | ||
ret, _ := json.Marshal(r) | ||
return ret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package page | ||
|
||
// ListResponse 获取魔力建站落地页信息列表 API Response | ||
type ListResponse struct { | ||
// TotalCount 总共条数 | ||
TotalCount int `json:"total_count,omitempty"` | ||
// Details json array | ||
Details []Page `json:"details,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package page | ||
|
||
// Page 魔力建站落地页 | ||
type Page struct { | ||
// ID 落地页 ID | ||
ID int64 `json:"id,omitempty"` | ||
// Comps 落地页包含的组件列表 | ||
Comps []Component `json:"comps,omitempty"` | ||
// URL 落地页 URL | ||
URL string `json:"url,omitempty"` | ||
// FictionID 落地页绑定的小说 ID | ||
FictionID int64 `json:"fiction_id,omitempty"` | ||
// BizType 落地页类型,0:站内;1:联盟;2:站内&联盟通投 | ||
BizType int `json:"biz_type,omitempty"` | ||
// CreateTime 创建时间,格式:yyyy-MM-dd hh:MM:ss | ||
CreateTime string `json:"create_time,omitempty"` | ||
// UpdateTime 修改时间,格式:yyyy-MM-dd hh:MM:ss | ||
UpdateTime string `json:"update_time,omitempty"` | ||
// ConversionTypes 落地页包含的转化组件类型:APP_DOWNLOAD_ANDROID_DRAG 应用下载-安卓、APP_DOWNLOAD_IOS_DRAG | ||
// 应用下载-ios、BUTTON_DRAG 按钮、XIANSUO_FORM_DRAG 表单、WEI_XIN_DRAG 微信、CUSTOMER_SERVICE_DRAG 客服咨询、 | ||
// COUPON_CARD 卡劵、TEL_DRAG 电话、WECHAT_GAME 小游戏、落地页组限制落地页必须含有相同转化组件类型 | ||
ConversionTypes []string `json:"conversion_type,omitempty"` | ||
// Details JSON 返回值 | ||
Details interface{} `json:"details,omitempty"` | ||
// CoverImgUrl 落地页封面图 | ||
CoverImgUrl string `json:"cover_img_url,omitempty"` | ||
} | ||
|
||
// Component 落地页包含的组件 | ||
type Component struct { | ||
// ID 组件 ID | ||
ID int64 `json:"id,omitempty"` | ||
// Type 组件类型,0: 图片;1: 文本;2: 表单;3: 按钮;4: 轮播图;5: 视频;6: 地图;7: 应用下载;16: 空白组件;34: 小游戏; | ||
Type int `json:"type,omitempty"` | ||
// Name 组件名称 | ||
Name string `json:"name,omitempty"` | ||
// Props 组件属性,仅当 Type 为 7 时有用, 其他类型没有这个属性 | ||
Props map[string]interface{} `json:"props,omitempty"` | ||
// WechatGameID 小游戏类型对应的 ID,Type 为 34 时有用 | ||
WechatGameID int64 `json:"wechat_game_id,omitempty"` | ||
// ButtonText 小游戏类型对应的按钮文案,Type 为 34 时有用 | ||
ButtonText string `json:"button_text,omitempty"` | ||
// GameName 小游戏的名称,Type 为 34 时有用 | ||
GameName string `json:"game_name,omitempty"` | ||
// Description 小游戏的说明,Type 为 34 时有用 | ||
Description string `json:"description,omitempty"` | ||
} |