-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
293 additions
and
1 deletion.
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
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 tools | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools" | ||
) | ||
|
||
// AssetLinkList 获取字节小程序/小游戏详情内容 | ||
// 获取字节小程序/小游戏详情内容 | ||
func AssetLinkList(clt *core.SDKClient, accessToken string, req *tools.AssetLinkListRequest) (*tools.AssetLinkListResult, error) { | ||
var resp tools.AssetLinkListResponse | ||
if err := clt.Get("v3.0/tools/asset_link/list/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, 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,16 @@ | ||
package tools | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools" | ||
) | ||
|
||
// MicroAppList 获取字节小程序 | ||
// 获取巨量工作台上字节小程序资产列表 | ||
func MicroAppList(clt *core.SDKClient, accessToken string, req *tools.MicroAppListRequest) (*tools.MicroAppListResult, error) { | ||
var resp tools.MicroAppListResponse | ||
if err := clt.Get("v3.0/tools/micro_app/list/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, 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,16 @@ | ||
package tools | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools" | ||
) | ||
|
||
// MicroGameList 获取字节小游戏 | ||
// 获取字节小游戏列表,对应在巨量工作台上的字节小游戏资产 | ||
func MicroGameList(clt *core.SDKClient, accessToken string, req *tools.MicroAppListRequest) (*tools.MicroAppListResult, error) { | ||
var resp tools.MicroAppListResponse | ||
if err := clt.Get("v3.0/tools/micro_game/list/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, 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,15 @@ | ||
package enum | ||
|
||
// MicroAppAuditStatus 审核状态 | ||
type MicroAppAuditStatus string | ||
|
||
const ( | ||
// MicroAppAuditStatus_AUDIT_ACCEPTED 审核通过 | ||
MicroAppAuditStatus_AUDIT_ACCEPTED MicroAppAuditStatus = "AUDIT_ACCEPTED" | ||
// MicroAppAuditStatus_AUDITING 审核中 | ||
MicroAppAuditStatus_AUDITING MicroAppAuditStatus = "AUDITING" | ||
// MicroAppAuditStatus_AUDIT_REJECTED 审核不通过 | ||
MicroAppAuditStatus_AUDIT_REJECTED MicroAppAuditStatus = "AUDIT_REJECTED" | ||
// MicroAppAuditStatus_ALL 全部(默认值) | ||
MicroAppAuditStatus_ALL MicroAppAuditStatus = "ALL" | ||
) |
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,11 @@ | ||
package enum | ||
|
||
// MicroAppSearchType 搜索类型,可选值: | ||
type MicroAppSearchType string | ||
|
||
const ( | ||
// MicroAppSearchType_CREATE_ONLY 只查询该账户创建的应用(默认值) | ||
MicroAppSearchType_CREATE_ONLY MicroAppSearchType = "CREATE_ONLY" | ||
// MicroAppSearchType_SHARE_ONLY 只查询被共享的应用 | ||
MicroAppSearchType_SHARE_ONLY MicroAppSearchType = "SHARE_ONLY" | ||
) |
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
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
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,7 @@ | ||
package model | ||
|
||
// DateRange 日期范围 | ||
type DateRange struct { | ||
StartTime string `json:"start_time,omitempty"` | ||
EndTime string `json:"end_time,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,82 @@ | ||
package tools | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// AssetLinkListRequest 获取字节小程序/小游戏详情内容 API Request | ||
type AssetLinkListRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// Filtering 过滤条件 | ||
Filtering *AssetLinkListFilter `json:"filtering,omitempty"` | ||
// Page 页码,默认值:1 | ||
Page int `json:"page,omitempty"` | ||
// PageSize 分页大小,默认值:10,最大值100 | ||
PageSize int `json:"page_size,omitempty"` | ||
} | ||
|
||
type AssetLinkListFilter struct { | ||
// InstanceID 资产id | ||
InstanceID string `json:"instance_id,omitempty"` | ||
// CreateTime 按创建时间查询的时间范围 | ||
CreateTime *model.DateRange `json:"create_time,omitempty"` | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r AssetLinkListRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
if r.Filtering != nil { | ||
values.Set("filtering", string(util.JSONMarshal(r.Filtering))) | ||
} | ||
if r.Page > 0 { | ||
values.Set("page", strconv.Itoa(r.Page)) | ||
} | ||
if r.PageSize > 0 { | ||
values.Set("page_size", strconv.Itoa(r.PageSize)) | ||
} | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// AssetLinkListResponse 获取字节小程序/小游戏详情内容 API Response | ||
type AssetLinkListResponse struct { | ||
model.BaseResponse | ||
Data *AssetLinkListResult `json:"data,omitempty"` | ||
} | ||
|
||
type AssetLinkListResult struct { | ||
// PageInfo 页面信息 | ||
PageInfo *model.PageInfo `json:"page_info,omitempty"` | ||
// List 字节小游戏/小程序列表 | ||
List []AssetLink `json:"list,omitempty"` | ||
} | ||
|
||
// AssetLink 字节小游戏/小程序 | ||
type AssetLink struct { | ||
// LinkID 链接id | ||
LinkID uint64 `json:"link_id,omitempty"` | ||
// InstanceID 资产id | ||
InstanceID uint64 `json:"instance_id,omitempty"` | ||
// AppID app id | ||
AppID string `json:"app_id,omitempty"` | ||
// AdvertiserID 所属广告主账户ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// Link 启动链接 | ||
Link string `json:"link,omitempty"` | ||
// LinkRemark 链接备注 | ||
LinkRemark string `json:"link_remark,omitempty"` | ||
// StartPage 启动页面 | ||
StartPage string `json:"start_page,omitempty"` | ||
// StartParam 启动参数 | ||
StartParam string `json:"start_param,omitempty"` | ||
// CreateTime 创建时间 | ||
CreateTime string `json:"create_time,omitempty"` | ||
// ModifyTime 更新时间 | ||
ModifyTime string `json:"modify_time,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,96 @@ | ||
package tools | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/enum" | ||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// MicroAppListRequest 获取字节小程序 API Request | ||
type MicroAppListRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// Filtering 过滤条件 | ||
Filtering *MicroAppListFilter `json:"filtering,omitempty"` | ||
// Page 页码,默认值:1 | ||
Page int `json:"page,omitempty"` | ||
// PageSize 分页大小,默认值:10,最大值100 | ||
PageSize int `json:"page_size,omitempty"` | ||
} | ||
|
||
type MicroAppListFilter struct { | ||
// SearchType 搜索类型,可选值: | ||
// CREATE_ONLY只查询该账户创建的应用(默认值) | ||
// SHARE_ONLY只查询被共享的应用 | ||
SearchType enum.MicroAppSearchType `json:"search_type,omitempty"` | ||
// SearchKey 小程序名称或备注的模糊匹配 | ||
SearchKey string `json:"search_key,omitempty"` | ||
// AuditStatus 审核状态,可选值: | ||
// AUDIT_ACCEPTED 审核通过 | ||
// AUDITING 审核中 | ||
// AUDIT_REJECTED 审核不通过 | ||
// ALL 全部(默认值) | ||
AuditStatus enum.MicroAppAuditStatus `json:"audit_status,omitempty"` | ||
// CreateTime 按创建时间查询的时间范围 | ||
CreateTime *model.DateRange `json:"create_time,omitempty"` | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r MicroAppListRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
if r.Filtering != nil { | ||
values.Set("filtering", string(util.JSONMarshal(r.Filtering))) | ||
} | ||
if r.Page > 0 { | ||
values.Set("page", strconv.Itoa(r.Page)) | ||
} | ||
if r.PageSize > 0 { | ||
values.Set("page_size", strconv.Itoa(r.PageSize)) | ||
} | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// MicroAppListResponse 获取字节小程序 API Response | ||
type MicroAppListResponse struct { | ||
model.BaseResponse | ||
Data *MicroAppListResult `json:"data,omitempty"` | ||
} | ||
|
||
type MicroAppListResult struct { | ||
// PageInfo 页面信息 | ||
PageInfo *model.PageInfo `json:"page_info,omitempty"` | ||
// List 字节小程序 列表 | ||
List []MicroApp `json:"list,omitempty"` | ||
} | ||
|
||
// MicroApp 字节小程序 | ||
type MicroApp struct { | ||
// InstanceID 小程序资产id | ||
InstanceID uint64 `json:"instance_id,omitempty"` | ||
// Remark 字节小程序备注名称 | ||
Remark string `json:"remark,omitempty"` | ||
// AppID 字节小程序app id | ||
AppID string `json:"app_id,omitempty"` | ||
// AuditStatus 审核状态: | ||
// AUDIT_ACCEPTED | ||
// AUDITING | ||
// AUDIT_REJECTED | ||
AuditStatus enum.MicroAppAuditStatus `json:"audit_status,omitempty"` | ||
// Reason 审核拒绝原因 | ||
Reason string `json:"reason,omitempty"` | ||
// AdvertiserID 所属广告主账户ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// CreateTime 创建时间 | ||
CreateTime string `json:"create_time,omitempty"` | ||
// ModifyTime 修改时间 | ||
ModifyTime string `json:"modify_time,omitempty"` | ||
// Category 所属账户类型 | ||
Category uint64 `json:"category,omitempty"` | ||
// Name 字节小程序名称 | ||
Name string `json:"name,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