diff --git a/marketing-api/STAR.md b/marketing-api/STAR.md index 9863a473..747bf3f8 100644 --- a/marketing-api/STAR.md +++ b/marketing-api/STAR.md @@ -17,3 +17,4 @@ - 获取订单投后分析报表 [ ReportOrderOverviewGet(clt *core.SDKClient, accessToken string, req *star.ReportOrderOverviewGetRequest) (*star.ReportOrderOverviewGetResponseData, error) ] - 获取订单投后受众报表 [ ReportOrderUserDistributionGet(clt *core.SDKClient, accessToken string, req *star.ReportOrderUserDistributionGetRequest) (*star.ReportOrderUserDistributionGetResponseData, error) ] - 获取星图订单投后线索 [ ClueList(clt *core.SDKClient, accessToken string, req *star.ClueListRequest) (*star.ClueListResponseData, error) ] + - 获取星图账户信息 [ Info(clt *core.SDKClient, accessToken string, req *star.InfoRequest) ([]star.Info, error) ] diff --git a/marketing-api/api/star/info.go b/marketing-api/api/star/info.go new file mode 100644 index 00000000..d9e7a3e9 --- /dev/null +++ b/marketing-api/api/star/info.go @@ -0,0 +1,16 @@ +package star + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/star" +) + +// Info 获取星图账户信息 +// 获取星图账户全量信息 +func Info(clt *core.SDKClient, accessToken string, req *star.InfoRequest) ([]star.Info, error) { + var resp star.InfoResponse + if err := clt.Get("2/star/info/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data.InfoList, nil +} diff --git a/marketing-api/enum/star_info_status.go b/marketing-api/enum/star_info_status.go new file mode 100644 index 00000000..1cf0e96f --- /dev/null +++ b/marketing-api/enum/star_info_status.go @@ -0,0 +1,21 @@ +package enum + +// StarInfoStatus 账户状态 +type StarInfoStatus string + +const ( + // StarInfoStatus_DELETED 已删除 + StarInfoStatus_DELETED StarInfoStatus = "DELETED" + // StarInfoStatus_ENABLE 有效 + StarInfoStatus_ENABLE StarInfoStatus = "ENABLE" + // StarInfoStatus_FROZEN 禁用 + StarInfoStatus_FROZEN StarInfoStatus = "FROZEN" + // StarInfoStatus_NEW_PROTOCOL 待同意新协议 + StarInfoStatus_NEW_PROTOCOL StarInfoStatus = "NEW_PROTOCOL" + // StarInfoStatus_PUNISH 惩罚 + StarInfoStatus_PUNISH StarInfoStatus = "PUNISH" + // StarInfoStatus_QUALIFICATION_VERIFICATION 资质验证 + StarInfoStatus_QUALIFICATION_VERIFICATION StarInfoStatus = "QUALIFICATION_VERIFICATION" + // StarInfoStatus_UN_PROTOCOL 未同意协议 + StarInfoStatus_UN_PROTOCOL StarInfoStatus = "UN_PROTOCOL" +) diff --git a/marketing-api/model/star/info.go b/marketing-api/model/star/info.go new file mode 100644 index 00000000..2851df9e --- /dev/null +++ b/marketing-api/model/star/info.go @@ -0,0 +1,68 @@ +package star + +import ( + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// InfoRequest 获取星图账户信息 API Request +type InfoRequest struct { + // StarIDs 星图id + StarIDs []uint64 `json:"star_ids,omitempty"` +} + +// Encode implement GetRequest interface +func (r InfoRequest) Encode() string { + values := util.GetUrlValues() + values.Set("star_ids", string(util.JSONMarshal(r.StarIDs))) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// InfoResponse 获取星图账户信息 API Response +type InfoResponse struct { + model.BaseResponse + Data struct { + // InfoList 信息列表 + InfoList []Info `json:"info_list,omitempty"` + } `json:"data,omitempty"` +} + +// Info 星图账户信息 +type Info struct { + // StarID 星图id + StarID uint64 `json:"star_id,omitempty"` + // StarName 星图名称 + StarName string `json:"star_name,omitempty"` + // Status 账户状态 + // DELETED 已删除 + // ENABLE 有效 + // FROZEN 禁用 + // NEW_PROTOCOL 待同意新协议 + // PUNISH 惩罚 + // QUALIFICATION_VERIFICATION 资质验证 + // UN_PROTOCOL 未同意协议 + Status enum.StarInfoStatus `json:"status,omitempty"` + // CompanyName 公司名称 + CompanyName string `json:"company_name,omitempty"` + // CategoryID 行业分类id + CategoryID uint64 `json:"categorty_id,omitempty"` + // CompanyID 公司id + CompanyID uint64 `json:"company_id,omitempty"` + // FirstInfo 一级行业 + FirstInfo *IndustryInfo `json:"first_info,omitempty"` + // SecondInfo 二级行业 + SecondInfo *IndustryInfo `json:"second_info,omitempty"` + // CreateTime 创建时间 + CreateTime int64 `json:"create_time,omitempty"` +} + +// IndustryInfo 行业信息 +type IndustryInfo struct { + // IndustryID 行业id + IndustryID uint64 `json:"industry_id,omitempty"` + // IndustryName 行业名称 + IndustryName string `json:"industry_name,omitempty"` +} diff --git a/marketing-api/model/tools/comment/comment.go b/marketing-api/model/tools/comment/comment.go index 20ffe3fe..0ab0065f 100644 --- a/marketing-api/model/tools/comment/comment.go +++ b/marketing-api/model/tools/comment/comment.go @@ -55,6 +55,13 @@ type Comment struct { CommentPermission enum.CommentPermission `json:"comment_permission,omitempty"` // MaterialID 评论关联的视频素材id MaterialID uint64 `json:"material_id,omitempty"` + // CommentImages 评论图片内容,返回图片url列表 + CommentImages []string `json:"comment_images,omitempty"` + // CommentType 评论内容类型 + // IMAGE_COMMENT 图片评论 + // IMAGE_TEXT_COMMENT 图文评论 + // TEXT_COMMENT 文字评论 + CommentType enum.CommentType `json:"comment_type,omitempty"` } // UserInfo 评论用户信息