From 3fa233f2bef27af663962d17ef8ed201595878dd Mon Sep 17 00:00:00 2001 From: Syd Xu Date: Fri, 1 Nov 2024 12:42:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(tools/security):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A3=8E=E6=8E=A7=E8=BF=9D=E8=A7=84=E7=A7=AF?= =?UTF-8?q?=E5=88=86API=E5=92=8CSPI=E8=83=BD=E5=8A=9B=EF=BC=8C=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8C=96=E6=8F=90=E6=95=88=E9=A3=8E=E6=8E=A7=E6=B2=BB?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marketing-api/OCEANENGINE.md | 35 ++++--- marketing-api/api/tools/security/doc.go | 2 + .../tools/security/score_disposal_info_get.go | 17 ++++ .../security/score_violation_event_get.go | 17 ++++ .../api/tools/security/total_score_get.go | 17 ++++ .../enum/security_score_illegal_type.go | 11 +++ .../security_score_violation_event_status.go | 15 +++ marketing-api/model/spi/message.go | 76 +++++++++----- marketing-api/model/tools/security/doc.go | 2 + .../tools/security/score_disposal_info_get.go | 99 +++++++++++++++++++ .../model/tools/security/score_total_get.go | 76 ++++++++++++++ .../tools/security/score_violation_event.go | 99 +++++++++++++++++++ 12 files changed, 424 insertions(+), 42 deletions(-) create mode 100644 marketing-api/api/tools/security/doc.go create mode 100644 marketing-api/api/tools/security/score_disposal_info_get.go create mode 100644 marketing-api/api/tools/security/score_violation_event_get.go create mode 100644 marketing-api/api/tools/security/total_score_get.go create mode 100644 marketing-api/enum/security_score_illegal_type.go create mode 100644 marketing-api/enum/security_score_violation_event_status.go create mode 100644 marketing-api/model/tools/security/doc.go create mode 100644 marketing-api/model/tools/security/score_disposal_info_get.go create mode 100644 marketing-api/model/tools/security/score_total_get.go create mode 100644 marketing-api/model/tools/security/score_violation_event.go diff --git a/marketing-api/OCEANENGINE.md b/marketing-api/OCEANENGINE.md index e23b5de..b8dab64 100644 --- a/marketing-api/OCEANENGINE.md +++ b/marketing-api/OCEANENGINE.md @@ -377,23 +377,26 @@ - 查询白名单能力 [ GrayGet(clt *core.SDKClient, accessToken string, req *tools.GrayGetRequest) ([]tools.GrayItem, error) ] - 查询建议出价(巨量广告升级版) [ tools.v3.BidSuggest(clt *core.SDKClient, accessToken string, req *v3.BidSuggestRequest) (*tools.BidSuggest, error) ] - 获取绑定的抖音号 [ IesAccountSearch(clt *core.SDKClient, accessToken string, req *tools.IesAccountSearchRequest) ([]tools.IesAccount, error) ] - - 应用管理 (tools/appmanagement) - - 查询游戏信息 [ BookingGet(clt *core.SDKClient, accessToken string, req *appmanagement.AppListRequest) (*appmanagement.AppListResponseData, error) ] - - 查询应用信息 [ AppGet(clt *core.SDKClient, accessToken string, req *appmanagement.AppListRequest) (*appmanagement.AppListResponseData, error) ] - - 查询安卓应用信息(支持所有账户体系) [ AndroidAppList(clt *core.SDKClient, accessToken string, req *appmanagement.AndroidAppListRequest) (*appmanagement.AppListResponseData, error) ] - - 查询应用预约记录 [ BookingRecordsGet(clt *core.SDKClient, accessToken string, req *appmanagement.BookingRecordsGetRequest) (*appmanagement.BookingRecordsGetData, error) ] - - 提交解析应用包任务 [ DownloadPackageParse(clt *core.SDKClient, accessToken string, req *appmanagement.DownloadPackageParseRequest) (string, error) ] - - 查询包解析状态 [ DownloadPackageGet(clt *core.SDKClient, accessToken string, req *appmanagement.DownloadPackageGetRequest) (appmanagement.DownloadPackageStatus, error) ] - - 查询应用分包列表 [ ExtendPackageList(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageListRequest) (*appmanagement.ExtendPackageListData, error) ] - - 查询应用分包列表 (支持所有账户体系) [ ExtendPackageListV2(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageListV2Request) (*appmanagement.ExtendPackageListData, error) ] - - 创建应用分包 [ ExtendPackageCreate(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageCreateRequest) error ] - - 创建应用分包 (支持所有账户体系)[ ExtendPackageCreateV2(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageCreateV2Request) error ] - - 更新应用子包版本 [ ExtendPackageUpdate(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageUpdateRequest) error ] - - 查看应用共享范围 [ ShareAccountList(clt *core.SDKClient, accessToken string, req *appmanagement.ShareAccountListRequest) (*appmanagement.ShareAccountListData, error) ] - - 设置应用共享 [ BpShare(clt *core.SDKClient, accessToken string, req *appmanagement.BpShareRequest) (*appmanagement.BpShareData, error) ] - - 取消应用共享关系 [ BpShareCancel(clt *core.SDKClient, accessToken string, req *appmanagement.BpShareRequest) (*appmanagement.BpShareData, error) ] - - 更新应用共享关系 [ UpdateAuthorization(clt *core.SDKClient, accessToken string, req *appmanagement.UpdateAuthorizationRequest) error ] - 获取账户下原生锚点 [ tools.NativeAnchorGet(clt *core.SDKClient, accessToken string, req *tools.NativeAnchorGetRequest) (*tools.NativeAnchorGetResponseData, error) ] + - 查询账户累计积分 [ security.ScoreTotalGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *security.ScoreTotalGetRequest) (*security.ScoreTotalGetResult, error) ] + - 查询违规积分明细 [ security.ScoreViolationEventGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *security.ScoreViolationEventGetRequest) (*security.ScoreViolationEventGetResult, error) ] + - 查看积分处置详情 [ security.ScoreDisposalInfoGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *security.ScoreDisposalInfoGetRequest) (*security.ScoreDisposalInfoGetResult, error) ] + - 应用管理 (tools/appmanagement) + - 查询游戏信息 [ BookingGet(clt *core.SDKClient, accessToken string, req *appmanagement.AppListRequest) (*appmanagement.AppListResponseData, error) ] + - 查询应用信息 [ AppGet(clt *core.SDKClient, accessToken string, req *appmanagement.AppListRequest) (*appmanagement.AppListResponseData, error) ] + - 查询安卓应用信息(支持所有账户体系) [ AndroidAppList(clt *core.SDKClient, accessToken string, req *appmanagement.AndroidAppListRequest) (*appmanagement.AppListResponseData, error) ] + - 查询应用预约记录 [ BookingRecordsGet(clt *core.SDKClient, accessToken string, req *appmanagement.BookingRecordsGetRequest) (*appmanagement.BookingRecordsGetData, error) ] + - 提交解析应用包任务 [ DownloadPackageParse(clt *core.SDKClient, accessToken string, req *appmanagement.DownloadPackageParseRequest) (string, error) ] + - 查询包解析状态 [ DownloadPackageGet(clt *core.SDKClient, accessToken string, req *appmanagement.DownloadPackageGetRequest) (appmanagement.DownloadPackageStatus, error) ] + - 查询应用分包列表 [ ExtendPackageList(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageListRequest) (*appmanagement.ExtendPackageListData, error) ] + - 查询应用分包列表 (支持所有账户体系) [ ExtendPackageListV2(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageListV2Request) (*appmanagement.ExtendPackageListData, error) ] + - 创建应用分包 [ ExtendPackageCreate(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageCreateRequest) error ] + - 创建应用分包 (支持所有账户体系)[ ExtendPackageCreateV2(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageCreateV2Request) error ] + - 更新应用子包版本 [ ExtendPackageUpdate(clt *core.SDKClient, accessToken string, req *appmanagement.ExtendPackageUpdateRequest) error ] + - 查看应用共享范围 [ ShareAccountList(clt *core.SDKClient, accessToken string, req *appmanagement.ShareAccountListRequest) (*appmanagement.ShareAccountListData, error) ] + - 设置应用共享 [ BpShare(clt *core.SDKClient, accessToken string, req *appmanagement.BpShareRequest) (*appmanagement.BpShareData, error) ] + - 取消应用共享关系 [ BpShareCancel(clt *core.SDKClient, accessToken string, req *appmanagement.BpShareRequest) (*appmanagement.BpShareData, error) ] + - 更新应用共享关系 [ UpdateAuthorization(clt *core.SDKClient, accessToken string, req *appmanagement.UpdateAuthorizationRequest) error ] - 抖音达人 (tools/aweme) - 查询抖音帐号和类目信息 [ AwemeInfoSearch(clt *core.SDKClient, accessToken string, req *aweme.AwemeInfoSearchRequest) (*aweme.AwemeInfoSearchResult, error) ] - 查询抖音类似帐号 [ AwemeSimilarAuthorSearch(clt *core.SDKClient, accessToken string, req *aweme.AwemeSimilarAuthorSearchRequest) ([]aweme.Author, error) ] diff --git a/marketing-api/api/tools/security/doc.go b/marketing-api/api/tools/security/doc.go new file mode 100644 index 0000000..30fd22b --- /dev/null +++ b/marketing-api/api/tools/security/doc.go @@ -0,0 +1,2 @@ +// Package security 风控违规积分 +package security diff --git a/marketing-api/api/tools/security/score_disposal_info_get.go b/marketing-api/api/tools/security/score_disposal_info_get.go new file mode 100644 index 0000000..2e203ed --- /dev/null +++ b/marketing-api/api/tools/security/score_disposal_info_get.go @@ -0,0 +1,17 @@ +package security + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/tools/security" +) + +// ScoreDisposalInfoGet 查看积分处置详情 +func ScoreDisposalInfoGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *security.ScoreDisposalInfoGetRequest) (*security.ScoreDisposalInfoGetResult, error) { + var resp security.ScoreDisposalInfoGetResponse + if err := clt.GetAPI(ctx, "v3.0/security/score_disposal_info/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/tools/security/score_violation_event_get.go b/marketing-api/api/tools/security/score_violation_event_get.go new file mode 100644 index 0000000..55d262d --- /dev/null +++ b/marketing-api/api/tools/security/score_violation_event_get.go @@ -0,0 +1,17 @@ +package security + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/tools/security" +) + +// ScoreViolationEventGet 查询违规积分明细 +func ScoreViolationEventGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *security.ScoreViolationEventGetRequest) (*security.ScoreViolationEventGetResult, error) { + var resp security.ScoreViolationEventGetResponse + if err := clt.GetAPI(ctx, "v3.0/security/score_violation_event/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/tools/security/total_score_get.go b/marketing-api/api/tools/security/total_score_get.go new file mode 100644 index 0000000..c20d5fb --- /dev/null +++ b/marketing-api/api/tools/security/total_score_get.go @@ -0,0 +1,17 @@ +package security + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/tools/security" +) + +// ScoreTotalGet 查询账户累计积分 +func ScoreTotalGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *security.ScoreTotalGetRequest) (*security.ScoreTotalGetResult, error) { + var resp security.ScoreTotalGetResponse + if err := clt.GetAPI(ctx, "v3.0/security/score_total/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/enum/security_score_illegal_type.go b/marketing-api/enum/security_score_illegal_type.go new file mode 100644 index 0000000..0401c7b --- /dev/null +++ b/marketing-api/enum/security_score_illegal_type.go @@ -0,0 +1,11 @@ +package enum + +// SecurityScoreIllegalType 违规类型 +type SecurityScoreIllegalType string + +const ( + // SecurityScoreIllegalType_GENERAL 一般违规(AD) + SecurityScoreIllegalType_GENERAL SecurityScoreIllegalType = "GENERAL" + // SecurityScoreIllegalType_SERIOUS 严重违规(AD) + SecurityScoreIllegalType_SERIOUS SecurityScoreIllegalType = "SERIOUS" +) diff --git a/marketing-api/enum/security_score_violation_event_status.go b/marketing-api/enum/security_score_violation_event_status.go new file mode 100644 index 0000000..a640c4f --- /dev/null +++ b/marketing-api/enum/security_score_violation_event_status.go @@ -0,0 +1,15 @@ +package enum + +// SecurityScoreViolationEventStatus 生效状态 +type SecurityScoreViolationEventStatus string + +const ( + // SecurityScoreViolationEventStatus_APPEAL 已申诉(失效) + SecurityScoreViolationEventStatus_APPEAL SecurityScoreViolationEventStatus = "APPEAL" + // SecurityScoreViolationEventStatus_FAILAPPEAL 申诉失败 + SecurityScoreViolationEventStatus_FAILAPPEAL SecurityScoreViolationEventStatus = "FAILAPPEAL" + // SecurityScoreViolationEventStatus_ONAPPEAL 申诉中 + SecurityScoreViolationEventStatus_ONAPPEAL SecurityScoreViolationEventStatus = "ONAPPEAL" + // SecurityScoreViolationEventStatus_VALID 生效 + SecurityScoreViolationEventStatus_VALID SecurityScoreViolationEventStatus = "VALID" +) diff --git a/marketing-api/model/spi/message.go b/marketing-api/model/spi/message.go index ae08a63..9d1a71d 100644 --- a/marketing-api/model/spi/message.go +++ b/marketing-api/model/spi/message.go @@ -10,16 +10,16 @@ import ( type Message struct { // MessageID 唯一标识一条推送消息/数据; 64字符 MessageID string `json:"message_id,omitempty"` - // SubscribeTaskID 订阅任务id,订阅任务的主键; 64字符 - SubscribeTaskID uint64 `json:"subscribe_task_id,omitempty"` - // AdvertiserIDs 消息对应的广告主账号,report.advertiser.beforeday 时返回所有已产出的广告主ID组,其余服务类型一次仅返回一个广告主ID - AdvertiserIDs []uint64 `json:"advertiser_ids,omitempty"` // AccountRelation 推送广告主账号的订阅来源,是订阅的哪个账号下的广告主数据; min=1,max=1k AccountRelation string `json:"account_relation,omitempty"` // ServiceLabel 订阅服务类型 ServiceLabel string `json:"service_label,omitempty"` // Data 推送数据信息,具体结构参考子文档 Data string `json:"data,omitempty"` + // AdvertiserIDs 消息对应的广告主账号,report.advertiser.beforeday 时返回所有已产出的广告主ID组,其余服务类型一次仅返回一个广告主ID + AdvertiserIDs []uint64 `json:"advertiser_ids,omitempty"` + // SubscribeTaskID 订阅任务id,订阅任务的主键; 64字符 + SubscribeTaskID uint64 `json:"subscribe_task_id,omitempty"` // PublishTime 消息实际产生时间 PublishTime int64 `json:"publish_time,omitempty"` // Timestamp 毫秒时间戳,本条消息实际推送时间 @@ -34,30 +34,22 @@ type AccountRelation struct { AgentIDs map[string][]uint64 `json:"agent_ids,omitempty"` // CoreUserIDs 用户授权账号 CoreUserIDs map[string][]uint64 `json:"core_user_ids,omitempty"` - // AdvertiserIDs 广告主id直接授权 - AdvertiserIDs []uint64 `json:"advertiser_ids,omitempty"` // CcIDs 巨量纵横账号 Ccids map[string][]uint64 `json:"cc_ids,omitempty"` + // AdvertiserIDs 广告主id直接授权 + AdvertiserIDs []uint64 `json:"advertiser_ids,omitempty"` } // MessageDataBase . type MessageDataBase struct { - // AppID 应用APPID - AppID uint64 `json:"app_id,omitempty"` - // UserID 创意归属广告主id - UserID uint64 `json:"user_id,omitempty"` + // Event 事件名称 + Event string `json:"event,omitempty"` // FromUserID 触发事件发送者open_id FromUserID string `json:"from_user_id,omitempty"` // ToUserID 触发事件接收者open_id ToUserID string `json:"to_user_id,omitempty"` - // CoreUserID 登陆用户id - CoreUserID uint64 `json:"core_user_id,omitempty"` - // AdvertiserID 广告主I D - AdvertiserID uint64 `json:"advertiser_id,omitempty"` // CoreUserIDs 登陆用户ids CoreUserIDs []uint64 `json:"core_user_ids,omitempty"` - // AdID 创意归属计划id - AdID uint64 `json:"ad_id,omitempty"` // AdIDs 聚合周期内发生指标变更的计划列表,service_label 为report.ad.activeprogram时有值 AdIDs []uint64 `json:"ad_ids,omitempty"` // CreativeIDs 聚合周期内发生指标变更的创意列表,service_label 为report.creative.activeprogram时有值 @@ -68,22 +60,30 @@ type MessageDataBase struct { PromotionIDs []uint64 `json:"promotion_ids,omitempty"` // MaterialIDs 聚合周期内发生指标变更的素材列表,service_label 为report.material.activeprogram时有值 MaterialIDs []uint64 `json:"material_ids,omitempty"` - // Event 事件名称 - Event string `json:"event,omitempty"` + // AppID 应用APPID + AppID uint64 `json:"app_id,omitempty"` + // UserID 创意归属广告主id + UserID uint64 `json:"user_id,omitempty"` + // CoreUserID 登陆用户id + CoreUserID uint64 `json:"core_user_id,omitempty"` + // AdvertiserID 广告主I D + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // AdID 创意归属计划id + AdID uint64 `json:"ad_id,omitempty"` } // MessageData . type MessageData struct { - MessageDataBase // Content 事件内容 Content *EventContent `json:"content,omitempty"` + MessageDataBase } // MessageDataV2 . type MessageDataV2 struct { - MessageDataBase // Content 事件内容 Content string `json:"content,omitempty"` + MessageDataBase } // EventContent 事件内容 @@ -175,12 +175,8 @@ type EventContent struct { QualificationType enum.DeliveryQualificationType `json:"qualification_type,omitempty"` // QualificationID 资质ID QualificationID []uint64 `json:"qualification_id,omitempty"` - // Status 资质状态 - // STATUS_CONFIRM 审核通过 - // STATUS_CONFIRM_FAIL 审核不通过 - // STATUS_PENDING_CONFIRM 审核中 - // STATUS_WAIT_CONFIRM 待审核 - Status enum.DeliveryQualificationStatus `json:"status,omitempty"` + // Status 状态 + Status string `json:"status,omitempty"` // MaterialIDs 聚合周期内发生指标变更的素材列表 MaterialIDs []uint64 `json:"material_ids,omitempty"` // MaterialType 素材类型: @@ -189,6 +185,34 @@ type EventContent struct { MaterialType string `json:"material_type,omitempty"` // IllegalMaterialIDs 违规素材id list IllegalMaterialIDs []uint64 `json:"illegal_material_ids,omitempty"` + // EventID 违规单id + EventID uint64 `json:"event_id,omitempty"` + // BusinessLine 业务线AD + BusinessLine string `json:"business_line,omitempty"` + // AdID 计划id(AD2.0为广告id) + AdID uint64 `json:"ad_id,omitempty"` + // MaterialID 素材id + MaterialID uint64 `json:"material_id,omitempty"` + // ViolationEvidenceImg 违规证据截图 + ViolationEvidenceImg string `json:"violation_evidence_img,omitempty"` + // Score 扣罚分值 + Score int64 `json:"score,omitempty"` + // RejectReason 拒绝理由 + RejectReason string `json:"reject_reason,omitempty"` + // IllegalType 违规类型 可选值: + // GENERAL 一般违规(AD) + // SERIOUS 严重违规(AD) + IllegalType enum.SecurityScoreIllegalType `json:"illegal_type,omitempty"` + // DisposalID 处置单id + DisposalID uint64 `json:"disposal_id,omitempty"` + // DisposalTerm 执行时长 + DisposalTerm string `json:"disposal_term,omitempty"` + // DisposalStartTime 处置开始时间 + DisposalStartTime string `json:"disposal_start_time,omitempty"` + // DisposalEndTime 处置结束时间 + DisposalEndTime string `json:"disposal_end_time,omitempty"` + // DisposalReason 处置原因 + DisposalReason string `json:"disposal_reason,omitempty"` } // CommentUser 用户信息 diff --git a/marketing-api/model/tools/security/doc.go b/marketing-api/model/tools/security/doc.go new file mode 100644 index 0000000..30fd22b --- /dev/null +++ b/marketing-api/model/tools/security/doc.go @@ -0,0 +1,2 @@ +// Package security 风控违规积分 +package security diff --git a/marketing-api/model/tools/security/score_disposal_info_get.go b/marketing-api/model/tools/security/score_disposal_info_get.go new file mode 100644 index 0000000..46728bf --- /dev/null +++ b/marketing-api/model/tools/security/score_disposal_info_get.go @@ -0,0 +1,99 @@ +package security + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ScoreDisposalInfoGetRequest 查看积分处置详情 API Request +type ScoreDisposalInfoGetRequest struct { + // Filtering 过滤条件 + Filtering *ScoreDisposalInfoGetFilter `json:"filtering,omitempty"` + // BusinessLine 业务线,允许值: + // AD 巨量广告 + BusinessLine string `json:"business_line,omitempty"` + // OrderField 排序字段 ,允许值: + // disposal_start_time 处置开始时间 + // disposal_end_time 处置结束时间 + OrderField string `json:"order_field,omitempty"` + // OrderType 排序方式 可选值: + // ASC 升序,默认 + // DESC 降序 + OrderType string `json:"order_type,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // Page 页数,默认值:1,page范围为[1,99999] + Page int `json:"page,omitempty"` + // PageSize 页面大小,默认值:10,page_size范围为[1,100] + PageSize int `json:"page_size,omitempty"` +} + +type ScoreDisposalInfoGetFilter struct { + // DisposalAction 处置行为,允许值: + // ACCOUNTCLEAR 账号封停+主体限制新开 + // 默认值: ACCOUNTCLEAR + DisposalAction string `json:"disposal_action,omitempty"` + // DisposalStatus 处置状态,允许值: + // DISPOSAL 已处置 + // 默认值: DISPOSAL + DisposalStatus string `json:"disposal_status,omitempty"` +} + +func (r ScoreDisposalInfoGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("page", strconv.Itoa(r.Page)) + values.Set("page_size", strconv.Itoa(r.PageSize)) + if r.BusinessLine != "" { + values.Set("business_line", r.BusinessLine) + } + if r.OrderField != "" { + values.Set("order_field", r.OrderField) + } + if r.OrderType != "" { + values.Set("order_type", r.OrderType) + } + if r.Filtering != nil { + values.Set("filtering", string(util.JSONMarshal(r.Filtering))) + } + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// ScoreDisposalInfoGetResponse 查看积分处置详情 API Response +type ScoreDisposalInfoGetResponse struct { + Data *ScoreDisposalInfoGetResult `json:"data,omitempty"` + model.BaseResponse +} + +type ScoreDisposalInfoGetResult struct { + // PageInfo 分页信息 + PageInfo *model.PageInfo `json:"page_info,omitempty"` + // DisposalInfoList 处置信息 + DisposalInfoList []DisposalInfo `json:"disposal_info_list,omitempty"` +} + +// DisposalInfo 处置信息 +type DisposalInfo struct { + // DisposalAction 处置行为 + // ACCOUNTCLEAR 账户封停+主体限制新建账户 + DisposalAction string `json:"disposal_action,omitempty"` + // DisposalTerm 处置时长 + DisposalTerm string `json:"disposal_term,omitempty"` + // DisposalStartTime 处置开始时间 + DisposalStartTime string `json:"disposal_start_time,omitempty"` + // DisposalEndTime 处置结束时间 + DisposalEndTime string `json:"disposal_end_time,omitempty"` + // DisposalStatus 处置状态 + // DISPOSAL 已处置 + DisposalStatus string `json:"disposal_status,omitempty"` + // OuterText 对外文案 + OuterText string `json:"outer_text,omitempty"` + // AdvertiserID 广告主id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // DisposalScore 落罚分值 + DisposalScore int64 `json:"disposal_score,omitempty"` +} diff --git a/marketing-api/model/tools/security/score_total_get.go b/marketing-api/model/tools/security/score_total_get.go new file mode 100644 index 0000000..34f5b18 --- /dev/null +++ b/marketing-api/model/tools/security/score_total_get.go @@ -0,0 +1,76 @@ +package security + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ScoreTotalGetRequest 查询账户累计积分 API Request +type ScoreTotalGetRequest struct { + // Filter 过滤器 + Filter *ScoreTotalGetFilter `json:"filter,omitempty"` + // BusinessLine 业务线,允许值: + // AD 巨量广告 + BusinessLine string `json:"business_line,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // Page 页数,默认值:1,page范围为[1,99999] + Page int `json:"page,omitempty"` + // PageSize 页面大小,默认值:10,page_size范围为[1,100] + PageSize int `json:"page_size,omitempty"` +} + +type ScoreTotalGetFilter struct { + // Year 积分年度,如:2000 + Year string `json:"year,omitempty"` + // IllegalType 违规类型 可选值: + // GENERAL 一般违规(AD) + // SERIOUS 严重违规(AD) + IllegalType enum.SecurityScoreIllegalType `json:"illegal_type,omitempty"` +} + +func (r ScoreTotalGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("page", strconv.Itoa(r.Page)) + values.Set("page_size", strconv.Itoa(r.PageSize)) + if r.BusinessLine != "" { + values.Set("business_line", r.BusinessLine) + } + if r.Filter != nil { + values.Set("filter", string(util.JSONMarshal(r.Filter))) + } + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// ScoreTotalGetResponse 查询账户累计积分 API Response +type ScoreTotalGetResponse struct { + Data *ScoreTotalGetResult `json:"data,omitempty"` + model.BaseResponse +} + +type ScoreTotalGetResult struct { + // PageInfo 分页信息 + PageInfo *model.PageInfo `json:"page_info,omitempty"` + // ScoreInfoList 积分详情 + ScoreInfoLIst []ScoreInfo `json:"score_info_list,omitempty"` +} + +// ScoreInfo 积分详情 +type ScoreInfo struct { + // IllegalType 违规类型 可选值: + // GENERAL 一般违规(AD) + // SERIOUS 严重违规(AD) + IllegalType enum.SecurityScoreIllegalType `json:"illegal_type,omitempty"` + // Year 积分年度 + Year string `json:"year,omitempty"` + // AdvertiserID 广告主id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // Score 积分 + Score int `json:"score,omitempty"` +} diff --git a/marketing-api/model/tools/security/score_violation_event.go b/marketing-api/model/tools/security/score_violation_event.go new file mode 100644 index 0000000..1a85a36 --- /dev/null +++ b/marketing-api/model/tools/security/score_violation_event.go @@ -0,0 +1,99 @@ +package security + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ScoreViolationEventGetRequest 查询违规积分明细 API Request +type ScoreViolationEventGetRequest struct { + // Filtering 过滤器 + Filtering *ScoreViolationEventGetFilter `json:"filtering,omitempty"` + // BusinessLine 业务线,允许值: + // AD 巨量广告 + BusinessLine string `json:"business_line,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // Page 页数,默认值:1,page范围为[1,99999] + Page int `json:"page,omitempty"` + // PageSize 页面大小,默认值:10,page_size范围为[1,100] + PageSize int `json:"page_size,omitempty"` +} + +type ScoreViolationEventGetFilter struct { + // Status 生效状态,允许值: + // APPEAL 已申诉(失效) + // FAILAPPEAL 申诉失败 + // ONAPPEAL 申诉中 + // VALID 生效 + Status enum.SecurityScoreViolationEventStatus `json:"status,omitempty"` + // StartTime 开始时间 + StartTime string `json:"start_time,omitempty"` + // EndTime 结束时间 + EndTime string `json:"end_time,omitempty"` + // IllegalType 违规类型 + // GENERAL 一般违规(AD) + // SERIOUS 严重违规(AD) + IllegalType enum.SecurityScoreIllegalType `json:"illegal_type,omitempty"` + // EventID 积分违规单 + EventID uint64 `json:"event_id,omitempty"` +} + +func (r ScoreViolationEventGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("page", strconv.Itoa(r.Page)) + values.Set("page_size", strconv.Itoa(r.PageSize)) + if r.BusinessLine != "" { + values.Set("business_line", r.BusinessLine) + } + if r.Filtering != nil { + values.Set("filtering", string(util.JSONMarshal(r.Filtering))) + } + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// ScoreViolationEventGetResponse 查询违规积分明细 API Response +type ScoreViolationEventGetResponse struct { + Data *ScoreViolationEventGetResult `json:"data,omitempty"` + model.BaseResponse +} + +type ScoreViolationEventGetResult struct { + // PageInfo 分页信息 + PageInfo *model.PageInfo `json:"page_info,omitempty"` + // AdvScoreEvent + AdvScoreEvent []ScoreEvent `json:"adv_score_event,omitempty"` +} + +type ScoreEvent struct { + // MaterialID 素材id + MaterialID string `json:"material_id,omitempty"` + // ViolationEvidenceImg 违规证据截图 + ViolationEvidenceImg string `json:"violation_evidence_img,omitempty"` + // RejectReason 拒绝理由 + RejectReason string `json:"reject_reason,omitempty"` + // CreateTIme 创建时间 + CreateTIme string `json:"create_time,omitempty"` + // Status 状态,枚举值: + // APPEAL 已申诉(失效) + // FAILAPPEAL 申诉失败 + // ONAPPEAL 申诉中 + // VALID 生效 + Status enum.SecurityScoreViolationEventStatus `json:"status,omitempty"` + // IllegalType 违规类型 + IllegalType enum.SecurityScoreIllegalType `json:"illegal_type,omitempty"` + // EventID 违规单id + EventID uint64 `json:"event_id,omitempty"` + // AdvertiserID 广告主id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // AdID 计划id(AD2.0为广告id) + AdID uint64 `json:"ad_id,omitempty"` + // Score 扣罚分值 + Score int64 `json:"score,omitempty"` +}