Skip to content

Commit

Permalink
Merge branch 'release/v1.7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Apr 18, 2024
2 parents d690075 + 9e20da0 commit 2bfc0f2
Show file tree
Hide file tree
Showing 28 changed files with 608 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
- 广告素材数据 [ CreativeReport(clt *core.SDKClient, accessToken string, req *report.MaterialReportRequest) (*report.ReportResponse, error) ]
- 人群分析数据 [ AudienceReport(clt *core.SDKClient, accessToken string, req *report.AudienceReportRequest) (*report.ReportResponse, error) ]
- 小店通转化数据 [ MerchantDeatailReport(clt *core.SDKClient, accessToken string, req *report.MerchantDetailReportRequest) (*report.MerchantDetailReportResponse, error) ]
- 关键词报表 [ WordInfoReport(clt *core.SDKClient, accessToken string, req *report.WordInfoReportRequest) (*report.ReportResponse, error) ]
- 搜索词报表 [ QueryWordReport(clt *core.SDKClient, accessToken string, req *report.QueryWordReportRequest) (*report.ReportResponse, error) ]
- 素材管理(api/file)
- 图片素材
- 上传图片v1接口 [ AdImageUploadV1(clt *core.SDKClient, accessToken string, req *file.AdImageUploadRequestV1) (*file.Image, error) ]
Expand Down Expand Up @@ -151,6 +153,16 @@
- 小铃铛推送 [ jingbel.Share(clt *core.SDKClient, accessToken string, req *jingbell.ShareRequest) error ]
- 原生广告投放工具 (api/dsp/native)
- 开启原生扩量开关接口 [ OpenAccountNative(clt *core.SDKClient, accessToken string, req *native.OpenAccountNativeRequest) error ]
- 评论管理 (api/comment)
- 评论列表数据查询 [ List(clt *core.SDKClient, accessToken string, req *comment.ListRequest) (*comment.ListResponse, error) ]
- 回复评论 [ Reply(clt *core.SDKClient, accessToken string, req *comment.ReplyRequest) ([]comment.ReplyResult, error) ]
- 评论树查询 [ Tree(clt *core.SDKClient, accessToken string, req *comment.TreeRequest) (*comment.TreeResponse, error) ]
- 屏蔽评论 [ Shield(clt *core.SDKClient, accessToken string, req *comment.ShieldRequest) error ]
- 增加屏蔽评论信息 [ ShieldInfoCreate(clt *core.SDKClient, accessToken string, req *comment.ShieldInfoCreateRequest) ([]uint64, error) ]
- 删除屏蔽评论信息 [ ShieldInfoDelete(clt *core.SDKClient, accessToken string, req *comment.ShieldInfoDeleteRequest) error ]
- 获取屏蔽评论信息列表 [ ShieldInfoList(clt *core.SDKClient, accessToken string, req *comment.ShieldInfoListRequest) (*comment.ShieldInfoListResponse, error) ]
- 评论置顶 [ SetTop(clt *core.SDKClient, accessToken string, req *comment.SetTopRequest) (uint64, error) ]
- 取消评论置顶 [ CancelTop(clt *core.SDKClient, accessToken string, req *comment.CancelTopRequest) (uint64, error) ]
- DMP人群管理(api/dmp)
- 人群包上传接口 [ PopulationUpload(clt *core.SDKClient, accessToken string, req *dmp.PopulationUploadRequest) (*dmp.Population, error) ]
- 人群包更新接口 [ PopulationUpdate(clt *core.SDKClient, accessToken string, req *dmp.PopulationUpdateRequest) (*dmp.Population, error) ]
Expand Down
15 changes: 15 additions & 0 deletions api/comment/cancel_top.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// CancelTop 取消置顶
func CancelTop(clt *core.SDKClient, accessToken string, req *comment.CancelTopRequest) (uint64, error) {
var resp comment.CancelTopResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.CommentID, nil
}
2 changes: 2 additions & 0 deletions api/comment/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package comment 评论管理
package comment
16 changes: 16 additions & 0 deletions api/comment/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// List 评论列表数据查询
func List(clt *core.SDKClient, accessToken string, req *comment.ListRequest) (*comment.ListResponse, error) {
var resp comment.ListResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
return nil, err
}
return &resp, nil
}
16 changes: 16 additions & 0 deletions api/comment/reply.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// Reply 回复评论
func Reply(clt *core.SDKClient, accessToken string, req *comment.ReplyRequest) ([]comment.ReplyResult, error) {
var resp comment.ReplyResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
return nil, err
}
return resp.ReplyResultList, nil
}
15 changes: 15 additions & 0 deletions api/comment/set_top.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// SetTop 评论置顶
func SetTop(clt *core.SDKClient, accessToken string, req *comment.SetTopRequest) (uint64, error) {
var resp comment.SetTopResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.CommentID, nil
}
11 changes: 11 additions & 0 deletions api/comment/shield.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// Shield 屏蔽评论
func Shield(clt *core.SDKClient, accessToken string, req *comment.ShieldRequest) error {
return clt.Post(accessToken, req, nil)
}
15 changes: 15 additions & 0 deletions api/comment/shield_info_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// ShieldInfoCreate 增加屏蔽评论信息
func ShieldInfoCreate(clt *core.SDKClient, accessToken string, req *comment.ShieldInfoCreateRequest) ([]uint64, error) {
var resp comment.ShieldInfoCreateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return resp.ShieldInfoIDList, nil
}
11 changes: 11 additions & 0 deletions api/comment/shield_info_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// ShieldInfoDelete 删除屏蔽评论信息
func ShieldInfoDelete(clt *core.SDKClient, accessToken string, req *comment.ShieldInfoDeleteRequest) error {
return clt.Post(accessToken, req, nil)
}
15 changes: 15 additions & 0 deletions api/comment/shield_info_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// ShieldInfoList 获取屏蔽评论信息列表
func ShieldInfoList(clt *core.SDKClient, accessToken string, req *comment.ShieldInfoListRequest) (*comment.ShieldInfoListResponse, error) {
var resp comment.ShieldInfoListResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
16 changes: 16 additions & 0 deletions api/comment/tree.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package comment

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/comment"
)

// Tree 评论树查询
func Tree(clt *core.SDKClient, accessToken string, req *comment.TreeRequest) (*comment.TreeResponse, error) {
var resp comment.TreeResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
return nil, err
}
return &resp, nil
}
16 changes: 16 additions & 0 deletions api/report/query_word_report.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package report

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/report"
)

// QueryWordReport 搜索词报表
func QueryWordReport(clt *core.SDKClient, accessToken string, req *report.QueryWordReportRequest) (*report.ReportResponse, error) {
var resp report.ReportResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
return nil, err
}
return &resp, nil
}
16 changes: 16 additions & 0 deletions api/report/word_info_report.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package report

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/report"
)

// WordInfoReport 关键词报表
func WordInfoReport(clt *core.SDKClient, accessToken string, req *report.WordInfoReportRequest) (*report.ReportResponse, error) {
var resp report.ReportResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
return nil, err
}
return &resp, nil
}
30 changes: 30 additions & 0 deletions model/comment/cancel_top.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package comment

import "encoding/json"

// CancelTopRequest 取消评论置顶 API Request
type CancelTopRequest struct {
// AdvertiserID 告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// CommentID 评论ID
CommentID uint64 `json:"comment_id,omitempty"`
// PhotoID 视频ID
PhotoID uint64 `json:"photo_id,omitempty"`
}

// Url implement PostRequest interface
func (r CancelTopRequest) Url() string {
return "v1/comment/cancelTop"
}

// Encode implement PostRequest interface
func (r CancelTopRequest) Encode() []byte {
bs, _ := json.Marshal(r)
return bs
}

// CancelTopResponse 取消评论置顶 API Response
type CancelTopResponse struct {
// CommentID 评论ID
CommentID uint64 `json:"comment_id,omitempty"`
}
58 changes: 58 additions & 0 deletions model/comment/comment.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package comment

// Comment 评论
type Comment struct {
// CommentID 评论 ID
CommentID uint64 `json:"comment_id,omitempty"`
// RootCommentID 一级评论 ID
RootCommentID uint64 `json:"root_comment_id,omitempty"`
// CommentAuthorID 评论发布者 UserID
CommentAuthorID uint64 `json:"comment_author_id,omitempty"`
// PhotoID 视频 ID
PhotoID uint64 `json:"photo_id,omitempty"`
// PhotoAuthorID 视频作者 UserID
PhotoAuthorID uint64 `json:"photo_author_id,omitempty"`
// CommentLevel 评论层级
// 1:一级评论,2:二级评论
CommentLevel int `json:"comment_level,omitempty"`
// CommentContent 评论内容
CommentContent string `json:"comment_content,omitempty"`
// FavNum 点赞数
FavNum int64 `json:"fav_num,omitempty"`
// PostTime 评论发布时间
// 毫秒级时间戳
PostTime int64 `json:"post_time,omitempty"`
// NickName 评论发布者昵称
NickName string `json:"nick_name,omitempty"`
// ReplyStatus 回复状态
// 1:未回复,2:已回复
ReplyStatus int `json:"reply_status,omitempty"`
// ShieldStatus 屏蔽状态
// 1:未屏蔽,2:已屏蔽
ShieldStatus int `json:"shield_status,omitempty"`
// PhotoTags 视频标签
PhotoTags []string `json:"photo_tags,omitempty"`
// IsRootCommentForbid 一级评论是否被隐藏
IsRootCommentForbid bool `json:"is_root_comment_forbid,omitempty"`
// ShieldType 屏蔽类型
// 1:评论内容关键词,3:手动屏蔽,4:社区自动屏蔽,5:用户昵称关键词,6:快手 ID
ShieldType int `json:"shield_type,omitempty"`
// EmotionURL 表情url
EmotionURL string `json:"emotion_url,omitempty"`
// IsTopComment 是否被置顶
IsTopComment bool `json:"is_top_comment,omitempty"`
}

// CommentReply 评论回复
type CommentReply struct {
// ReplyToCommentID 回复的评论 ID
ReplyToCommentID uint64 `json:"reply_to_comment_id,omitempty"`
// PhotoID 视频 ID
PhotoID uint64 `json:"photo_id,omitempty"`
// PhotoAuthorID 视频作者 UserID
PhotoAuthorID uint64 `json:"photo_author_id,omitempty"`
// ReplyToUserID 被回复的用户 UserID
ReplyToUserID uint64 `json:"reply_to_user_id,omitempty"`
// ReplyContent 回复内容
ReplyContent string `json:"reply_content,omitempty"`
}
2 changes: 2 additions & 0 deletions model/comment/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package comment 评论管理
package comment
54 changes: 54 additions & 0 deletions model/comment/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package comment

import "encoding/json"

// ListRequest 评论列表数据查询 API Request
type ListRequest struct {
// AdvertiserID 广告主 ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// CommentContent 评论内容
CommentContent string `json:"comment_content,omitempty"`
// ReplyStatus 回复状态
// 1:未回复,2:已回复
ReplyStatus int `json:"reply_status,omitempty"`
// CommentLevel 评论层级
// 1:一级评论,2:二级评论
CommentLevel int `json:"comment_level,omitempty"`
// PostStartTime 评论发布起始时间
// 与 post_time_end 同时传或同时不传;过滤筛选条件,毫秒级时间戳
PostStartTime int64 `json:"post_time_start,omitempty"`
// PostEndTime 评论发布结束时间
// 与 post_time_start 同时传或同时不传;过滤筛选条件,毫秒级时间戳
PostEndTime int64 `json:"post_time_end,omitempty"`
// ShieldStatus 隐藏状态
// 1:未隐藏,2:已隐藏
ShieldStatus int `json:"shield_status,omitempty"`
// PhotoQueryValue 视频搜索参数
// 可输入视频 ID 或视频名称进行查询
PhotoQueryValue string `json:"photo_query_value,omitempty"`
// PhotoTag 视频标签
PhotoTag string `json:"photo_tag,omitempty"`
// Page 页码
Page int `json:"page,omitempty"`
// PageSize 每页条数
PageSize int `json:"page_size,omitempty"`
}

// Url implement PostRequest interface
func (r ListRequest) Url() string {
return "v1/comment/list"
}

// Encode implement PostRequest interface
func (r ListRequest) Encode() []byte {
bs, _ := json.Marshal(r)
return bs
}

// ListResponse 评论列表数据查询 API Response
type ListResponse struct {
// Total 符合条件的记录总数
Total int `json:"total,omitempty"`
// Details 评论列表
Details []Comment `json:"details,omitempty"`
}
36 changes: 36 additions & 0 deletions model/comment/reply.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package comment

import "encoding/json"

// ReplyRequest 评论回复 API Request
type ReplyRequest struct {
// AdvertiserID 广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// ReplyList 批量回复评论参数
ReplyList []CommentReply `json:"reply_list,omitempty"`
}

// Url implement PostRequest interface
func (r ReplyRequest) Url() string {
return "v1/comment/reply"
}

// Encode implement PostRequest interface
func (r ReplyRequest) Encode() []byte {
bs, _ := json.Marshal(r)
return bs
}

// ReplyResponse 评论回复 API Response
type ReplyResponse struct {
// ReplyResultList
ReplyResultList []ReplyResult `json:"reply_result_list,omitempty"`
}

type ReplyResult struct {
// ReplyToCommentID 回复的评论 ID
ReplyToCommentID uint64 `json:"reply_to_comment_id,omitempty"`
// ReplyResult 回复结果
// 1 成功;2 失败
ReplyResult int `json:"reply_result,omitempty"`
}
Loading

0 comments on commit 2bfc0f2

Please sign in to comment.