-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(audiencepackage): 定向包相关接口能力升级拓展更新支持推广场景
- Loading branch information
Showing
35 changed files
with
407 additions
and
76 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
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,19 @@ | ||
package v3 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
v3 "github.com/bububa/oceanengine/marketing-api/model/audiencepackage/v3" | ||
) | ||
|
||
// BindInfoGet 定向包查询关联项目信息 | ||
// 定向包查询关联项目信息 | ||
// 可通过【获取定向包】接口获取定向包ID,根据定向包ID查询该定向包关联了哪些项目 | ||
func BindInfoGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *v3.BindInfoGetRequest) (*v3.BindInfoGetResult, error) { | ||
var resp v3.BindInfoGetResponse | ||
if err := clt.GetAPI(ctx, "v3.0/audience_package_bindinfo/get/", 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,2 @@ | ||
// Package v3 定向包相关V3 | ||
package v3 |
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,21 @@ | ||
package v3 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
v3 "github.com/bububa/oceanengine/marketing-api/model/audiencepackage/v3" | ||
) | ||
|
||
// Get 获取定向包 | ||
// 落地页:可用于推广目的为销售线索收集或推广目的为应用推广且下载方式为落地页的计划 | ||
// 应用推广(Android):可用于推广目的为应用推广且下载方式为Android下载链接的计划 | ||
// 应用推广(iOS):可用于推广目的为应用推广且下载方式为iOS下载链接的计划 | ||
// 其余类型:可应用于推广目的为该类型名称的计划 | ||
func Get(ctx context.Context, clt *core.SDKClient, accessToken string, req *v3.GetRequest) (*v3.GetResult, error) { | ||
var resp v3.GetResponse | ||
if err := clt.GetAPI(ctx, "v3.0/audience_package/get/", 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 | ||
|
||
// AudiencePackageFiltetEvent 自定义过滤事件 | ||
type AudiencePackageFiltetEvent string | ||
|
||
const ( | ||
// AudiencePackageFiltetEvent_AD_CONVERT_EXTERNAL_ACTION 优化目标 | ||
AudiencePackageFiltetEvent_AD_CONVERT_EXTERNAL_ACTION AudiencePackageFiltetEvent = "AD_CONVERT_EXTERNAL_ACTION" | ||
// AudiencePackageFiltetEvent_AD_CONVERT_TYPE_ACTIVE 激活 | ||
AudiencePackageFiltetEvent_AD_CONVERT_TYPE_ACTIVE AudiencePackageFiltetEvent = "AD_CONVERT_TYPE_ACTIVE" | ||
// AudiencePackageFiltetEvent_AD_CONVERT_TYPE_ACTIVE_REGISTER 注册 | ||
AudiencePackageFiltetEvent_AD_CONVERT_TYPE_ACTIVE_REGISTER AudiencePackageFiltetEvent = "AD_CONVERT_TYPE_ACTIVE_REGISTER" | ||
// AudiencePackageFiltetEvent_AD_CONVERT_TYPE_PAY 付费 | ||
AudiencePackageFiltetEvent_AD_CONVERT_TYPE_PAY AudiencePackageFiltetEvent = "AD_CONVERT_TYPE_PAY" | ||
) |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...api/enum/local/converted_time_duration.go → ...eting-api/enum/converted_time_duration.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package local | ||
package enum | ||
|
||
// ConvertedTimeDuration 过滤已转化投放时间 | ||
type ConvertedTimeDuration string | ||
|
6 changes: 5 additions & 1 deletion
6
...eting-api/enum/local/hide_if_converted.go → marketing-api/enum/hide_if_converted.go
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,55 @@ | ||
package enum | ||
|
||
import "strconv" | ||
|
||
// HideIfExists 已安装用户 | ||
// 0表示不限,1表示过滤,2表示定向;过滤表示投放时不给安装客户展示广告,支持应用推广;定向表示投放时给安装客户展示广告;投放时优先获取直达链接,无直达链接时使用应用包名进行投放;如果无直达链接或应用包名,定向安装选项实际不生效;定向仅对Android链接生效。 | ||
type HideIfExists string | ||
|
||
const ( | ||
// HideIfExists_UNLIMITED 不限(默认值) | ||
HideIfExists_UNLIMITED HideIfExists = "UNLIMITED" | ||
// HideIfExists_FILTER 过滤,仅安卓应用推广时支持,其他情况传入不生效 | ||
HideIfExists_FILTER HideIfExists = "FILTER" | ||
// HideIfExists_TARGETING 定向 | ||
HideIfExists_TARGETING HideIfExists = "TARGET" | ||
) | ||
|
||
// UnmarshalJSON implement json Unmarshal interface | ||
func (he *HideIfExists) UnmarshalJSON(b []byte) (err error) { | ||
if b[0] == '"' && b[len(b)-1] == '"' { | ||
b = b[1 : len(b)-1] | ||
} | ||
var ret int | ||
str := string(b) | ||
switch str { | ||
case "UNLIMITED": | ||
ret = 0 | ||
case "FILTER": | ||
ret = 1 | ||
case "TARGETING": | ||
ret = 2 | ||
default: | ||
ret, _ = strconv.Atoi(str) | ||
} | ||
*he = HideIfExists(ret) | ||
return | ||
} | ||
|
||
func (he HideIfExists) Value() int { | ||
switch he { | ||
case HideIfExists_FILTER: | ||
return 1 | ||
case HideIfExists_TARGETING: | ||
return 2 | ||
default: | ||
return 0 | ||
} | ||
} | ||
|
||
func (he HideIfExists) String() string { | ||
if he == "" { | ||
return string(HideIfExists_UNLIMITED) | ||
} | ||
return string(he) | ||
} |
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,10 @@ | ||
package enum | ||
|
||
type OnOff string | ||
|
||
const ( | ||
// ON 开启 | ||
ON OnOff = "ON" | ||
// OFF 关闭 | ||
OFF OnOff = "OFF" | ||
) |
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
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
Oops, something went wrong.