-
Notifications
You must be signed in to change notification settings - Fork 23
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
28 changed files
with
608 additions
and
0 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,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 | ||
} |
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 comment 评论管理 | ||
package comment |
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 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 | ||
} |
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 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 | ||
} |
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 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 | ||
} |
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 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) | ||
} |
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 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 | ||
} |
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 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) | ||
} |
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 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 | ||
} |
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 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 | ||
} |
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 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 | ||
} |
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 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 | ||
} |
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,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"` | ||
} |
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,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"` | ||
} |
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 comment 评论管理 | ||
package comment |
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,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"` | ||
} |
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,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"` | ||
} |
Oops, something went wrong.