This commit is contained in:
parent
59c8349aba
commit
f923429b96
@ -3,6 +3,7 @@ package controller
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"micro-ayrshare/internal/dto"
|
"micro-ayrshare/internal/dto"
|
||||||
"micro-ayrshare/pb/aryshare"
|
"micro-ayrshare/pb/aryshare"
|
||||||
)
|
)
|
||||||
@ -39,6 +40,28 @@ func (a *AyrshareProvider) PostComment(_ context.Context, req *aryshare.PostComm
|
|||||||
res.Message = dtoRes.Message
|
res.Message = dtoRes.Message
|
||||||
res.Platform = dtoRes.Platform
|
res.Platform = dtoRes.Platform
|
||||||
|
|
||||||
|
// 转换 Bluesky 响应
|
||||||
|
if dtoRes.Bluesky != nil {
|
||||||
|
res.Bluesky = &aryshare.BlueskyCommentResponse{
|
||||||
|
Status: dtoRes.Bluesky.Status,
|
||||||
|
CommentId: dtoRes.Bluesky.CommentId,
|
||||||
|
Cid: dtoRes.Bluesky.Cid,
|
||||||
|
Comment: dtoRes.Bluesky.Comment,
|
||||||
|
Platform: dtoRes.Bluesky.Platform,
|
||||||
|
PostUrl: dtoRes.Bluesky.PostUrl,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Facebook 响应
|
||||||
|
if dtoRes.Facebook != nil {
|
||||||
|
res.Facebook = &aryshare.FacebookCommentResponse{
|
||||||
|
Status: dtoRes.Facebook.Status,
|
||||||
|
CommentId: dtoRes.Facebook.CommentId,
|
||||||
|
Comment: dtoRes.Facebook.Comment,
|
||||||
|
Platform: dtoRes.Facebook.Platform,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转换 Instagram 响应
|
// 转换 Instagram 响应
|
||||||
if dtoRes.Instagram != nil {
|
if dtoRes.Instagram != nil {
|
||||||
res.Instagram = &aryshare.InstagramCommentResponse{
|
res.Instagram = &aryshare.InstagramCommentResponse{
|
||||||
@ -49,6 +72,17 @@ func (a *AyrshareProvider) PostComment(_ context.Context, req *aryshare.PostComm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转换 LinkedIn 响应
|
||||||
|
if dtoRes.LinkedIn != nil {
|
||||||
|
res.Linkedin = &aryshare.LinkedInCommentResponse{
|
||||||
|
Status: dtoRes.LinkedIn.Status,
|
||||||
|
CommentId: dtoRes.LinkedIn.CommentId,
|
||||||
|
Comment: dtoRes.LinkedIn.Comment,
|
||||||
|
CommentUrn: dtoRes.LinkedIn.CommentUrn,
|
||||||
|
Platform: dtoRes.LinkedIn.Platform,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转换 TikTok 响应
|
// 转换 TikTok 响应
|
||||||
if dtoRes.TikTok != nil {
|
if dtoRes.TikTok != nil {
|
||||||
res.Tiktok = &aryshare.TikTokCommentResponse{
|
res.Tiktok = &aryshare.TikTokCommentResponse{
|
||||||
@ -60,6 +94,26 @@ func (a *AyrshareProvider) PostComment(_ context.Context, req *aryshare.PostComm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转换 Twitter 响应
|
||||||
|
if dtoRes.Twitter != nil {
|
||||||
|
res.Twitter = &aryshare.TwitterCommentResponse{
|
||||||
|
Status: dtoRes.Twitter.Status,
|
||||||
|
CommentId: dtoRes.Twitter.CommentId,
|
||||||
|
Comment: dtoRes.Twitter.Comment,
|
||||||
|
PostUrl: dtoRes.Twitter.PostUrl,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 YouTube 响应
|
||||||
|
if dtoRes.YouTube != nil {
|
||||||
|
res.Youtube = &aryshare.YouTubeCommentResponse{
|
||||||
|
Status: dtoRes.YouTube.Status,
|
||||||
|
CommentId: dtoRes.YouTube.CommentId,
|
||||||
|
Comment: dtoRes.YouTube.Comment,
|
||||||
|
Platform: dtoRes.YouTube.Platform,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转换 Errors
|
// 转换 Errors
|
||||||
if len(dtoRes.Errors) > 0 {
|
if len(dtoRes.Errors) > 0 {
|
||||||
res.Errors = make([]*aryshare.PlatformError, 0, len(dtoRes.Errors))
|
res.Errors = make([]*aryshare.PlatformError, 0, len(dtoRes.Errors))
|
||||||
@ -102,6 +156,22 @@ func (a *AyrshareProvider) GetComment(_ context.Context, req *aryshare.GetCommen
|
|||||||
res.Code = int32(dtoRes.Code)
|
res.Code = int32(dtoRes.Code)
|
||||||
res.Message = dtoRes.Message
|
res.Message = dtoRes.Message
|
||||||
|
|
||||||
|
// 转换 Bluesky 评论列表
|
||||||
|
if len(dtoRes.Bluesky) > 0 {
|
||||||
|
res.Bluesky = make([]*aryshare.BlueskyComment, 0, len(dtoRes.Bluesky))
|
||||||
|
for _, c := range dtoRes.Bluesky {
|
||||||
|
res.Bluesky = append(res.Bluesky, convertBlueskyComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Facebook 评论列表
|
||||||
|
if len(dtoRes.Facebook) > 0 {
|
||||||
|
res.Facebook = make([]*aryshare.FacebookComment, 0, len(dtoRes.Facebook))
|
||||||
|
for _, c := range dtoRes.Facebook {
|
||||||
|
res.Facebook = append(res.Facebook, convertFacebookComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转换 Instagram 评论列表
|
// 转换 Instagram 评论列表
|
||||||
if len(dtoRes.Instagram) > 0 {
|
if len(dtoRes.Instagram) > 0 {
|
||||||
res.Instagram = make([]*aryshare.InstagramComment, 0, len(dtoRes.Instagram))
|
res.Instagram = make([]*aryshare.InstagramComment, 0, len(dtoRes.Instagram))
|
||||||
@ -111,6 +181,30 @@ func (a *AyrshareProvider) GetComment(_ context.Context, req *aryshare.GetCommen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转换 LinkedIn 评论列表
|
||||||
|
if len(dtoRes.LinkedIn) > 0 {
|
||||||
|
res.Linkedin = make([]*aryshare.LinkedInComment, 0, len(dtoRes.LinkedIn))
|
||||||
|
for _, c := range dtoRes.LinkedIn {
|
||||||
|
res.Linkedin = append(res.Linkedin, convertLinkedInComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Reddit 评论列表
|
||||||
|
if len(dtoRes.Reddit) > 0 {
|
||||||
|
res.Reddit = make([]*aryshare.RedditComment, 0, len(dtoRes.Reddit))
|
||||||
|
for _, c := range dtoRes.Reddit {
|
||||||
|
res.Reddit = append(res.Reddit, convertRedditComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Threads 评论列表
|
||||||
|
if len(dtoRes.Threads) > 0 {
|
||||||
|
res.Threads = make([]*aryshare.ThreadsComment, 0, len(dtoRes.Threads))
|
||||||
|
for _, c := range dtoRes.Threads {
|
||||||
|
res.Threads = append(res.Threads, convertThreadsComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转换 TikTok 评论列表
|
// 转换 TikTok 评论列表
|
||||||
if len(dtoRes.TikTok) > 0 {
|
if len(dtoRes.TikTok) > 0 {
|
||||||
res.Tiktok = make([]*aryshare.TikTokComment, 0, len(dtoRes.TikTok))
|
res.Tiktok = make([]*aryshare.TikTokComment, 0, len(dtoRes.TikTok))
|
||||||
@ -120,6 +214,22 @@ func (a *AyrshareProvider) GetComment(_ context.Context, req *aryshare.GetCommen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转换 Twitter 评论列表
|
||||||
|
if len(dtoRes.Twitter) > 0 {
|
||||||
|
res.Twitter = make([]*aryshare.TwitterComment, 0, len(dtoRes.Twitter))
|
||||||
|
for _, c := range dtoRes.Twitter {
|
||||||
|
res.Twitter = append(res.Twitter, convertTwitterComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 YouTube 评论列表
|
||||||
|
if len(dtoRes.YouTube) > 0 {
|
||||||
|
res.Youtube = make([]*aryshare.YouTubeComment, 0, len(dtoRes.YouTube))
|
||||||
|
for _, c := range dtoRes.YouTube {
|
||||||
|
res.Youtube = append(res.Youtube, convertYouTubeComment(&c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,17 +261,45 @@ func (a *AyrshareProvider) DeleteComment(_ context.Context, req *aryshare.Delete
|
|||||||
res.Code = int32(dtoRes.Code)
|
res.Code = int32(dtoRes.Code)
|
||||||
res.Message = dtoRes.Message
|
res.Message = dtoRes.Message
|
||||||
|
|
||||||
// Instagram 和 TikTok 字段可能是单个对象或数组,转换为 JSON 字符串
|
// 各平台删除结果字段可能是单个对象或数组,统一转换为 JSON 字符串,方便前端直接解析
|
||||||
|
if dtoRes.Bluesky != nil {
|
||||||
|
if b, err := json.Marshal(dtoRes.Bluesky); err == nil {
|
||||||
|
res.Bluesky = string(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if dtoRes.Facebook != nil {
|
||||||
|
if b, err := json.Marshal(dtoRes.Facebook); err == nil {
|
||||||
|
res.Facebook = string(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
if dtoRes.Instagram != nil {
|
if dtoRes.Instagram != nil {
|
||||||
instagramBytes, err := json.Marshal(dtoRes.Instagram)
|
if b, err := json.Marshal(dtoRes.Instagram); err == nil {
|
||||||
if err == nil {
|
res.Instagram = string(b)
|
||||||
res.Instagram = string(instagramBytes)
|
}
|
||||||
|
}
|
||||||
|
if dtoRes.LinkedIn != nil {
|
||||||
|
if b, err := json.Marshal(dtoRes.LinkedIn); err == nil {
|
||||||
|
res.Linkedin = string(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if dtoRes.Threads != nil {
|
||||||
|
if b, err := json.Marshal(dtoRes.Threads); err == nil {
|
||||||
|
res.Threads = string(b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dtoRes.TikTok != nil {
|
if dtoRes.TikTok != nil {
|
||||||
tiktokBytes, err := json.Marshal(dtoRes.TikTok)
|
if b, err := json.Marshal(dtoRes.TikTok); err == nil {
|
||||||
if err == nil {
|
res.Tiktok = string(b)
|
||||||
res.Tiktok = string(tiktokBytes)
|
}
|
||||||
|
}
|
||||||
|
if dtoRes.Twitter != nil {
|
||||||
|
if b, err := json.Marshal(dtoRes.Twitter); err == nil {
|
||||||
|
res.Twitter = string(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if dtoRes.YouTube != nil {
|
||||||
|
if b, err := json.Marshal(dtoRes.YouTube); err == nil {
|
||||||
|
res.Youtube = string(b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +355,64 @@ func (a *AyrshareProvider) ReplyComment(_ context.Context, req *aryshare.ReplyCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转换 Bluesky 响应
|
||||||
|
if dtoRes.Bluesky != nil {
|
||||||
|
res.Bluesky = &aryshare.BlueskyReplyResponse{
|
||||||
|
Status: dtoRes.Bluesky.Status,
|
||||||
|
CommentId: dtoRes.Bluesky.CommentId,
|
||||||
|
SourceCommentId: dtoRes.Bluesky.SourceCommentId,
|
||||||
|
Comment: dtoRes.Bluesky.Comment,
|
||||||
|
Platform: dtoRes.Bluesky.Platform,
|
||||||
|
Cid: dtoRes.Bluesky.Cid,
|
||||||
|
PostUrl: dtoRes.Bluesky.PostUrl,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Facebook 响应
|
||||||
|
if dtoRes.Facebook != nil {
|
||||||
|
res.Facebook = &aryshare.FacebookReplyResponse{
|
||||||
|
Status: dtoRes.Facebook.Status,
|
||||||
|
CommentId: dtoRes.Facebook.CommentId,
|
||||||
|
SourceCommentId: dtoRes.Facebook.SourceCommentId,
|
||||||
|
Comment: dtoRes.Facebook.Comment,
|
||||||
|
Platform: dtoRes.Facebook.Platform,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 LinkedIn 响应
|
||||||
|
if dtoRes.LinkedIn != nil {
|
||||||
|
res.Linkedin = &aryshare.LinkedInReplyResponse{
|
||||||
|
Status: dtoRes.LinkedIn.Status,
|
||||||
|
CommentId: dtoRes.LinkedIn.CommentId,
|
||||||
|
SourceCommentId: dtoRes.LinkedIn.SourceCommentId,
|
||||||
|
Comment: dtoRes.LinkedIn.Comment,
|
||||||
|
Platform: dtoRes.LinkedIn.Platform,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Twitter 响应
|
||||||
|
if dtoRes.Twitter != nil {
|
||||||
|
res.Twitter = &aryshare.TwitterReplyResponse{
|
||||||
|
Status: dtoRes.Twitter.Status,
|
||||||
|
CommentId: dtoRes.Twitter.CommentId,
|
||||||
|
SourceCommentId: dtoRes.Twitter.SourceCommentId,
|
||||||
|
Comment: dtoRes.Twitter.Comment,
|
||||||
|
Platform: dtoRes.Twitter.Platform,
|
||||||
|
PostUrl: dtoRes.Twitter.PostUrl,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 YouTube 响应
|
||||||
|
if dtoRes.YouTube != nil {
|
||||||
|
res.Youtube = &aryshare.YouTubeReplyResponse{
|
||||||
|
Status: dtoRes.YouTube.Status,
|
||||||
|
CommentId: dtoRes.YouTube.CommentId,
|
||||||
|
SourceCommentId: dtoRes.YouTube.SourceCommentId,
|
||||||
|
Comment: dtoRes.YouTube.Comment,
|
||||||
|
Platform: dtoRes.YouTube.Platform,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,3 +492,278 @@ func convertTikTokComment(comment *dto.TikTokComment) *aryshare.TikTokComment {
|
|||||||
|
|
||||||
return protoComment
|
return protoComment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// convertBlueskyComment 转换 Bluesky 评论
|
||||||
|
func convertBlueskyComment(comment *dto.BlueskyComment) *aryshare.BlueskyComment {
|
||||||
|
protoComment := &aryshare.BlueskyComment{
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
Created: comment.Created,
|
||||||
|
DisplayName: comment.DisplayName,
|
||||||
|
LikeCount: int32(comment.LikeCount),
|
||||||
|
Platform: comment.Platform,
|
||||||
|
ProfileImageUrl: comment.ProfileImageUrl,
|
||||||
|
QuoteCount: int32(comment.QuoteCount),
|
||||||
|
ReplyCount: int32(comment.ReplyCount),
|
||||||
|
ReplyTo: comment.ReplyTo,
|
||||||
|
RepostCount: int32(comment.RepostCount),
|
||||||
|
UserName: comment.UserName,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Replies
|
||||||
|
if len(comment.Replies) > 0 {
|
||||||
|
protoComment.Replies = make([]*aryshare.BlueskyComment, 0, len(comment.Replies))
|
||||||
|
for _, reply := range comment.Replies {
|
||||||
|
protoComment.Replies = append(protoComment.Replies, convertBlueskyComment(&reply))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|
||||||
|
// convertFacebookComment 转换 Facebook 评论
|
||||||
|
func convertFacebookComment(comment *dto.FacebookComment) *aryshare.FacebookComment {
|
||||||
|
protoComment := &aryshare.FacebookComment{
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
CommentCount: int32(comment.CommentCount),
|
||||||
|
CommentUrl: comment.CommentUrl,
|
||||||
|
Company: comment.Company,
|
||||||
|
Created: comment.Created,
|
||||||
|
LikeCount: int32(comment.LikeCount),
|
||||||
|
Platform: comment.Platform,
|
||||||
|
UserLikes: comment.UserLikes,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 From
|
||||||
|
if comment.From != nil {
|
||||||
|
protoComment.From = &aryshare.FacebookUser{
|
||||||
|
Name: comment.From.Name,
|
||||||
|
Id: comment.From.Id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Parent
|
||||||
|
if comment.Parent != nil {
|
||||||
|
protoComment.Parent = &aryshare.FacebookParent{
|
||||||
|
CreatedTime: comment.Parent.CreatedTime,
|
||||||
|
Message: comment.Parent.Message,
|
||||||
|
Id: comment.Parent.Id,
|
||||||
|
}
|
||||||
|
if comment.Parent.From != nil {
|
||||||
|
protoComment.Parent.From = &aryshare.FacebookUser{
|
||||||
|
Name: comment.Parent.From.Name,
|
||||||
|
Id: comment.Parent.From.Id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Replies
|
||||||
|
if len(comment.Replies) > 0 {
|
||||||
|
protoComment.Replies = make([]*aryshare.FacebookComment, 0, len(comment.Replies))
|
||||||
|
for _, reply := range comment.Replies {
|
||||||
|
protoComment.Replies = append(protoComment.Replies, convertFacebookComment(&reply))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|
||||||
|
// convertLinkedInComment 转换 LinkedIn 评论
|
||||||
|
func convertLinkedInComment(comment *dto.LinkedInComment) *aryshare.LinkedInComment {
|
||||||
|
protoComment := &aryshare.LinkedInComment{
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
CommentUrn: comment.CommentUrn,
|
||||||
|
Created: comment.Created,
|
||||||
|
LikeCount: int32(comment.LikeCount),
|
||||||
|
Platform: comment.Platform,
|
||||||
|
ProfileImageUrl: comment.ProfileImageUrl,
|
||||||
|
UserName: comment.UserName,
|
||||||
|
Founded: int32(comment.Founded),
|
||||||
|
OrganizationType: comment.OrganizationType,
|
||||||
|
Website: comment.Website,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 From
|
||||||
|
if comment.From != nil {
|
||||||
|
protoComment.From = &aryshare.LinkedInFrom{
|
||||||
|
Name: comment.From.Name,
|
||||||
|
Id: fmt.Sprintf("%v", comment.From.Id),
|
||||||
|
Url: comment.From.Url,
|
||||||
|
Description: comment.From.Description,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Media
|
||||||
|
if len(comment.Media) > 0 {
|
||||||
|
protoComment.Media = make([]*aryshare.LinkedInMedia, 0, len(comment.Media))
|
||||||
|
for _, m := range comment.Media {
|
||||||
|
protoComment.Media = append(protoComment.Media, &aryshare.LinkedInMedia{
|
||||||
|
Type: m.Type,
|
||||||
|
Url: m.Url,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|
||||||
|
// convertRedditComment 转换 Reddit 评论
|
||||||
|
func convertRedditComment(comment *dto.RedditComment) *aryshare.RedditComment {
|
||||||
|
protoComment := &aryshare.RedditComment{
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
Created: comment.Created,
|
||||||
|
CommentUrl: comment.CommentUrl,
|
||||||
|
Subreddit: comment.Subreddit,
|
||||||
|
Ups: int32(comment.Ups),
|
||||||
|
IsSubmitter: comment.IsSubmitter,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 From
|
||||||
|
if comment.From != nil {
|
||||||
|
protoComment.From = &aryshare.RedditUser{
|
||||||
|
Name: comment.From.Name,
|
||||||
|
Id: comment.From.Id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|
||||||
|
// convertThreadsComment 转换 Threads 评论
|
||||||
|
func convertThreadsComment(comment *dto.ThreadsComment) *aryshare.ThreadsComment {
|
||||||
|
protoComment := &aryshare.ThreadsComment{
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
CommentUrl: comment.CommentUrl,
|
||||||
|
Created: comment.Created,
|
||||||
|
HasReplies: comment.HasReplies,
|
||||||
|
IsQuotePost: comment.IsQuotePost,
|
||||||
|
IsReply: comment.IsReply,
|
||||||
|
IsReplyOwnedByMe: comment.IsReplyOwnedByMe,
|
||||||
|
MediaType: comment.MediaType,
|
||||||
|
ParentId: comment.ParentId,
|
||||||
|
Platform: comment.Platform,
|
||||||
|
PostId: comment.PostId,
|
||||||
|
ReplyAudience: comment.ReplyAudience,
|
||||||
|
Shortcode: comment.Shortcode,
|
||||||
|
UserName: comment.UserName,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Replies
|
||||||
|
if len(comment.Replies) > 0 {
|
||||||
|
protoComment.Replies = make([]*aryshare.ThreadsComment, 0, len(comment.Replies))
|
||||||
|
for _, reply := range comment.Replies {
|
||||||
|
protoComment.Replies = append(protoComment.Replies, convertThreadsComment(&reply))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|
||||||
|
// convertTwitterComment 转换 Twitter/X 评论
|
||||||
|
func convertTwitterComment(comment *dto.TwitterComment) *aryshare.TwitterComment {
|
||||||
|
protoComment := &aryshare.TwitterComment{
|
||||||
|
BookmarkCount: int32(comment.BookmarkCount),
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
Created: comment.Created,
|
||||||
|
Description: comment.Description,
|
||||||
|
Id: comment.Id,
|
||||||
|
ImpressionCount: int32(comment.ImpressionCount),
|
||||||
|
LikeCount: int32(comment.LikeCount),
|
||||||
|
Name: comment.Name,
|
||||||
|
Platform: comment.Platform,
|
||||||
|
ProfileImageUrl: comment.ProfileImageUrl,
|
||||||
|
QuoteCount: int32(comment.QuoteCount),
|
||||||
|
ReplyCount: int32(comment.ReplyCount),
|
||||||
|
ThreadNumber: int32(comment.ThreadNumber),
|
||||||
|
UserName: comment.UserName,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 PublicMetrics
|
||||||
|
if comment.PublicMetrics != nil {
|
||||||
|
protoComment.PublicMetrics = &aryshare.TwitterPublicMetrics{
|
||||||
|
FollowersCount: int32(comment.PublicMetrics.FollowersCount),
|
||||||
|
FollowingCount: int32(comment.PublicMetrics.FollowingCount),
|
||||||
|
TweetCount: int32(comment.PublicMetrics.TweetCount),
|
||||||
|
ListedCount: int32(comment.PublicMetrics.ListedCount),
|
||||||
|
LikeCount: int32(comment.PublicMetrics.LikeCount),
|
||||||
|
MediaCount: int32(comment.PublicMetrics.MediaCount),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 ReferencedTweets
|
||||||
|
if len(comment.ReferencedTweets) > 0 {
|
||||||
|
protoComment.ReferencedTweets = make([]*aryshare.TwitterReferencedTweet, 0, len(comment.ReferencedTweets))
|
||||||
|
for _, r := range comment.ReferencedTweets {
|
||||||
|
protoComment.ReferencedTweets = append(protoComment.ReferencedTweets, &aryshare.TwitterReferencedTweet{
|
||||||
|
Type: r.Type,
|
||||||
|
Id: r.Id,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 ReplyTo
|
||||||
|
if comment.ReplyTo != nil {
|
||||||
|
protoComment.ReplyTo = &aryshare.TwitterReplyTo{
|
||||||
|
CreatedAt: comment.ReplyTo.CreatedAt,
|
||||||
|
Description: comment.ReplyTo.Description,
|
||||||
|
Id: comment.ReplyTo.Id,
|
||||||
|
Location: comment.ReplyTo.Location,
|
||||||
|
Name: comment.ReplyTo.Name,
|
||||||
|
ProfileImageUrl: comment.ReplyTo.ProfileImageUrl,
|
||||||
|
Url: comment.ReplyTo.Url,
|
||||||
|
Username: comment.ReplyTo.Username,
|
||||||
|
}
|
||||||
|
if comment.ReplyTo.PublicMetrics != nil {
|
||||||
|
protoComment.ReplyTo.PublicMetrics = &aryshare.TwitterPublicMetrics{
|
||||||
|
FollowersCount: int32(comment.ReplyTo.PublicMetrics.FollowersCount),
|
||||||
|
FollowingCount: int32(comment.ReplyTo.PublicMetrics.FollowingCount),
|
||||||
|
TweetCount: int32(comment.ReplyTo.PublicMetrics.TweetCount),
|
||||||
|
ListedCount: int32(comment.ReplyTo.PublicMetrics.ListedCount),
|
||||||
|
LikeCount: int32(comment.ReplyTo.PublicMetrics.LikeCount),
|
||||||
|
MediaCount: int32(comment.ReplyTo.PublicMetrics.MediaCount),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|
||||||
|
// convertYouTubeComment 转换 YouTube 评论
|
||||||
|
func convertYouTubeComment(comment *dto.YouTubeComment) *aryshare.YouTubeComment {
|
||||||
|
protoComment := &aryshare.YouTubeComment{
|
||||||
|
ChannelUrl: comment.ChannelUrl,
|
||||||
|
Comment: comment.Comment,
|
||||||
|
CommentId: comment.CommentId,
|
||||||
|
Created: comment.Created,
|
||||||
|
IsPublic: comment.IsPublic,
|
||||||
|
LikeCount: int32(comment.LikeCount),
|
||||||
|
Platform: comment.Platform,
|
||||||
|
ProfileImageUrl: comment.ProfileImageUrl,
|
||||||
|
UserName: comment.UserName,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 Replies
|
||||||
|
if len(comment.Replies) > 0 {
|
||||||
|
protoComment.Replies = make([]*aryshare.YouTubeReply, 0, len(comment.Replies))
|
||||||
|
for _, r := range comment.Replies {
|
||||||
|
protoComment.Replies = append(protoComment.Replies, &aryshare.YouTubeReply{
|
||||||
|
ChannelUrl: r.ChannelUrl,
|
||||||
|
Comment: r.Comment,
|
||||||
|
CommentId: r.CommentId,
|
||||||
|
Created: r.Created,
|
||||||
|
LikeCount: int32(r.LikeCount),
|
||||||
|
Platform: r.Platform,
|
||||||
|
ProfileImageUrl: r.ProfileImageUrl,
|
||||||
|
UserName: r.UserName,
|
||||||
|
ParentId: r.ParentId,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return protoComment
|
||||||
|
}
|
||||||
|
|||||||
@ -4,12 +4,30 @@ package dto
|
|||||||
type PostCommentRequest struct {
|
type PostCommentRequest struct {
|
||||||
ID string `json:"id"` // Ayrshare Post ID or Social Post ID
|
ID string `json:"id"` // Ayrshare Post ID or Social Post ID
|
||||||
Comment string `json:"comment"` // 评论内容
|
Comment string `json:"comment"` // 评论内容
|
||||||
Platforms []string `json:"platforms"` // 平台列表,只支持 ["instagram", "tiktok"]
|
Platforms []string `json:"platforms"` // 平台列表,支持 Ayrshare 评论接口支持的平台,例如 ["instagram", "tiktok", "facebook", "linkedin", "twitter", "youtube", "bluesky"]
|
||||||
SearchPlatformId *bool `json:"searchPlatformId,omitempty"` // 是否使用 Social Post ID
|
SearchPlatformId *bool `json:"searchPlatformId,omitempty"` // 是否使用 Social Post ID
|
||||||
MediaUrls []string `json:"mediaUrls,omitempty"` // 媒体URL(仅支持 Facebook, LinkedIn, X/Twitter)
|
MediaUrls []string `json:"mediaUrls,omitempty"` // 媒体URL(仅支持 Facebook, LinkedIn, X/Twitter)
|
||||||
ProfileKey string `json:"-"` // Profile Key,不序列化
|
ProfileKey string `json:"-"` // Profile Key,不序列化
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BlueskyCommentResponse Bluesky 平台评论响应
|
||||||
|
type BlueskyCommentResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // Bluesky Social Comment ID
|
||||||
|
Cid string `json:"cid,omitempty"` // Bluesky Comment CID
|
||||||
|
Comment string `json:"comment"` // 评论内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "bluesky"
|
||||||
|
PostUrl string `json:"postUrl,omitempty"` // 评论对应的访问 URL
|
||||||
|
}
|
||||||
|
|
||||||
|
// FacebookCommentResponse Facebook 平台评论响应
|
||||||
|
type FacebookCommentResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // Facebook Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 评论内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "facebook"
|
||||||
|
}
|
||||||
|
|
||||||
// InstagramCommentResponse Instagram 平台评论响应
|
// InstagramCommentResponse Instagram 平台评论响应
|
||||||
type InstagramCommentResponse struct {
|
type InstagramCommentResponse struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@ -18,6 +36,15 @@ type InstagramCommentResponse struct {
|
|||||||
Platform string `json:"platform"`
|
Platform string `json:"platform"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LinkedInCommentResponse LinkedIn 平台评论响应
|
||||||
|
type LinkedInCommentResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // LinkedIn Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 评论内容
|
||||||
|
CommentUrn string `json:"commentUrn,omitempty"` // LinkedIn Comment URN
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "linkedin"
|
||||||
|
}
|
||||||
|
|
||||||
// TikTokCommentResponse TikTok 平台评论响应
|
// TikTokCommentResponse TikTok 平台评论响应
|
||||||
type TikTokCommentResponse struct {
|
type TikTokCommentResponse struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@ -42,8 +69,14 @@ type PostCommentResponse struct {
|
|||||||
CommentID string `json:"commentID,omitempty"` // Ayrshare Comment ID
|
CommentID string `json:"commentID,omitempty"` // Ayrshare Comment ID
|
||||||
CommentId string `json:"commentId,omitempty"` // Ayrshare Comment ID (错误响应中可能使用此字段)
|
CommentId string `json:"commentId,omitempty"` // Ayrshare Comment ID (错误响应中可能使用此字段)
|
||||||
ID string `json:"id,omitempty"` // Ayrshare Post ID
|
ID string `json:"id,omitempty"` // Ayrshare Post ID
|
||||||
|
// 各平台成功响应信息(字段命名与 Ayrshare 文档示例对应)
|
||||||
|
Bluesky *BlueskyCommentResponse `json:"bluesky,omitempty"`
|
||||||
|
Facebook *FacebookCommentResponse `json:"facebook,omitempty"`
|
||||||
Instagram *InstagramCommentResponse `json:"instagram,omitempty"`
|
Instagram *InstagramCommentResponse `json:"instagram,omitempty"`
|
||||||
|
LinkedIn *LinkedInCommentResponse `json:"linkedin,omitempty"`
|
||||||
TikTok *TikTokCommentResponse `json:"tiktok,omitempty"`
|
TikTok *TikTokCommentResponse `json:"tiktok,omitempty"`
|
||||||
|
Twitter *TwitterCommentResponse `json:"twitter,omitempty"`
|
||||||
|
YouTube *YouTubeCommentResponse `json:"youtube,omitempty"`
|
||||||
// 错误相关字段
|
// 错误相关字段
|
||||||
Action string `json:"action,omitempty"`
|
Action string `json:"action,omitempty"`
|
||||||
Code int `json:"code,omitempty"`
|
Code int `json:"code,omitempty"`
|
||||||
@ -52,12 +85,75 @@ type PostCommentResponse struct {
|
|||||||
Errors []PlatformError `json:"errors,omitempty"`
|
Errors []PlatformError `json:"errors,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TwitterCommentResponse Twitter/X 平台评论响应
|
||||||
|
type TwitterCommentResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // Twitter Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 评论内容
|
||||||
|
PostUrl string `json:"postUrl,omitempty"` // 评论对应的访问 URL
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTubeCommentResponse YouTube 平台评论响应
|
||||||
|
type YouTubeCommentResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // YouTube Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 评论内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "youtube"
|
||||||
|
}
|
||||||
|
|
||||||
// GetCommentRequest 获取评论请求
|
// GetCommentRequest 获取评论请求
|
||||||
type GetCommentRequest struct {
|
type GetCommentRequest struct {
|
||||||
ID string `json:"id"` // Ayrshare Post ID or Social Post ID
|
ID string `json:"id"` // Ayrshare Post ID or Social Post ID
|
||||||
ProfileKey string `json:"-"` // Profile Key,不序列化
|
ProfileKey string `json:"-"` // Profile Key,不序列化
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BlueskyComment Bluesky 评论详情
|
||||||
|
type BlueskyComment struct {
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"` // Bluesky Social Comment ID
|
||||||
|
Created string `json:"created"`
|
||||||
|
DisplayName string `json:"displayName,omitempty"`
|
||||||
|
LikeCount int `json:"likeCount"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
ProfileImageUrl string `json:"profileImageUrl,omitempty"`
|
||||||
|
QuoteCount int `json:"quoteCount,omitempty"`
|
||||||
|
Replies []BlueskyComment `json:"replies,omitempty"`
|
||||||
|
ReplyCount int `json:"replyCount,omitempty"`
|
||||||
|
ReplyTo string `json:"replyTo,omitempty"`
|
||||||
|
RepostCount int `json:"repostCount,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FacebookUser Facebook 用户信息
|
||||||
|
type FacebookUser struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FacebookParent Facebook 父级评论/帖子信息
|
||||||
|
type FacebookParent struct {
|
||||||
|
CreatedTime string `json:"createdTime,omitempty"`
|
||||||
|
From *FacebookUser `json:"from,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Id string `json:"id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FacebookComment Facebook 评论详情(用于主评论和回复)
|
||||||
|
type FacebookComment struct {
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"` // Facebook Social Comment ID
|
||||||
|
CommentCount int `json:"commentCount,omitempty"` // 回复数量
|
||||||
|
CommentUrl string `json:"commentUrl,omitempty"`
|
||||||
|
Company bool `json:"company,omitempty"`
|
||||||
|
Created string `json:"created"`
|
||||||
|
From *FacebookUser `json:"from,omitempty"`
|
||||||
|
LikeCount int `json:"likeCount"`
|
||||||
|
Parent *FacebookParent `json:"parent,omitempty"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
UserLikes bool `json:"userLikes"`
|
||||||
|
Replies []FacebookComment `json:"replies,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// InstagramComment Instagram 评论详情
|
// InstagramComment Instagram 评论详情
|
||||||
type InstagramComment struct {
|
type InstagramComment struct {
|
||||||
Comment string `json:"comment"`
|
Comment string `json:"comment"`
|
||||||
@ -88,6 +184,75 @@ type InstagramUserInfo struct {
|
|||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LinkedInMedia LinkedIn 评论中的媒体信息
|
||||||
|
type LinkedInMedia struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Url string `json:"url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedInFrom LinkedIn 评论发布者信息
|
||||||
|
type LinkedInFrom struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Id interface{} `json:"id"`
|
||||||
|
Url string `json:"url,omitempty"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedInComment LinkedIn 评论详情
|
||||||
|
type LinkedInComment struct {
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"` // LinkedIn Social Comment ID
|
||||||
|
CommentUrn string `json:"commentUrn,omitempty"` // Social comment id from LinkedIn
|
||||||
|
Created string `json:"created"`
|
||||||
|
From *LinkedInFrom `json:"from,omitempty"`
|
||||||
|
LikeCount int `json:"likeCount"`
|
||||||
|
Media []LinkedInMedia `json:"media,omitempty"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
ProfileImageUrl string `json:"profileImageUrl,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
Founded int `json:"founded,omitempty"`
|
||||||
|
OrganizationType string `json:"organizationType,omitempty"`
|
||||||
|
Website string `json:"website,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RedditUser Reddit 用户信息
|
||||||
|
type RedditUser struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RedditComment Reddit 评论详情
|
||||||
|
type RedditComment struct {
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"`
|
||||||
|
Created string `json:"created"`
|
||||||
|
From *RedditUser `json:"from,omitempty"`
|
||||||
|
CommentUrl string `json:"commentUrl,omitempty"`
|
||||||
|
Subreddit string `json:"subreddit,omitempty"`
|
||||||
|
Ups int `json:"ups,omitempty"`
|
||||||
|
IsSubmitter bool `json:"isSubmitter"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ThreadsComment Threads 评论详情(用于主评论和回复)
|
||||||
|
type ThreadsComment struct {
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"`
|
||||||
|
CommentUrl string `json:"commentUrl,omitempty"`
|
||||||
|
Created string `json:"created"`
|
||||||
|
HasReplies bool `json:"hasReplies"`
|
||||||
|
IsQuotePost bool `json:"isQuotePost"`
|
||||||
|
IsReply bool `json:"isReply"`
|
||||||
|
IsReplyOwnedByMe bool `json:"isReplyOwnedByMe"`
|
||||||
|
MediaType string `json:"mediaType,omitempty"`
|
||||||
|
ParentId string `json:"parentId,omitempty"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
PostId string `json:"postId"`
|
||||||
|
Replies []ThreadsComment `json:"replies,omitempty"`
|
||||||
|
ReplyAudience string `json:"replyAudience,omitempty"`
|
||||||
|
Shortcode string `json:"shortcode,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// TikTokComment TikTok 评论详情
|
// TikTokComment TikTok 评论详情
|
||||||
type TikTokComment struct {
|
type TikTokComment struct {
|
||||||
Comment string `json:"comment"`
|
Comment string `json:"comment"`
|
||||||
@ -111,10 +276,95 @@ type TikTokComment struct {
|
|||||||
Visibility string `json:"visibility,omitempty"`
|
Visibility string `json:"visibility,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TwitterUserPublicMetrics Twitter/X 用户公共指标(用户维度,用于 Get Comments 返回)
|
||||||
|
type TwitterUserPublicMetrics struct {
|
||||||
|
FollowersCount int `json:"followersCount,omitempty"`
|
||||||
|
FollowingCount int `json:"followingCount,omitempty"`
|
||||||
|
TweetCount int `json:"tweetCount,omitempty"`
|
||||||
|
ListedCount int `json:"listedCount,omitempty"`
|
||||||
|
LikeCount int `json:"likeCount,omitempty"`
|
||||||
|
MediaCount int `json:"mediaCount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TwitterReferencedTweet 被引用或回复的 Tweet 信息
|
||||||
|
type TwitterReferencedTweet struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TwitterReplyTo 被回复的用户信息
|
||||||
|
type TwitterReplyTo struct {
|
||||||
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Id string `json:"id,omitempty"`
|
||||||
|
Location string `json:"location,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
ProfileImageUrl string `json:"profileImageUrl,omitempty"`
|
||||||
|
PublicMetrics *TwitterUserPublicMetrics `json:"publicMetrics,omitempty"`
|
||||||
|
Url string `json:"url,omitempty"`
|
||||||
|
Username string `json:"username,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TwitterComment Twitter/X 评论详情
|
||||||
|
type TwitterComment struct {
|
||||||
|
BookmarkCount int `json:"bookmarkCount,omitempty"`
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"` // Twitter Social Comment ID
|
||||||
|
Created string `json:"created"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Id string `json:"id"` // Twitter Social Post ID
|
||||||
|
ImpressionCount int `json:"impressionCount,omitempty"`
|
||||||
|
LikeCount int `json:"likeCount,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
ProfileImageUrl string `json:"profileImageUrl,omitempty"`
|
||||||
|
PublicMetrics *TwitterUserPublicMetrics `json:"publicMetrics,omitempty"`
|
||||||
|
QuoteCount int `json:"quoteCount,omitempty"`
|
||||||
|
ReferencedTweets []TwitterReferencedTweet `json:"referencedTweets,omitempty"`
|
||||||
|
ReplyCount int `json:"replyCount,omitempty"`
|
||||||
|
ReplyTo *TwitterReplyTo `json:"replyTo,omitempty"`
|
||||||
|
ThreadNumber int `json:"threadNumber,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTubeReply YouTube 回复评论详情
|
||||||
|
type YouTubeReply struct {
|
||||||
|
ChannelUrl string `json:"channelUrl,omitempty"`
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"`
|
||||||
|
Created string `json:"created"`
|
||||||
|
LikeCount int `json:"likeCount"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
ProfileImageUrl string `json:"profileImageUrl,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
ParentId string `json:"parentId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTubeComment YouTube 评论详情
|
||||||
|
type YouTubeComment struct {
|
||||||
|
ChannelUrl string `json:"channelUrl,omitempty"`
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
CommentId string `json:"commentId"` // YouTube Social Comment ID
|
||||||
|
Created string `json:"created"`
|
||||||
|
IsPublic bool `json:"isPublic"`
|
||||||
|
LikeCount int `json:"likeCount"`
|
||||||
|
Platform string `json:"platform"`
|
||||||
|
ProfileImageUrl string `json:"profileImageUrl,omitempty"`
|
||||||
|
Replies []YouTubeReply `json:"replies,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// GetCommentResponse 获取评论响应
|
// GetCommentResponse 获取评论响应
|
||||||
type GetCommentResponse struct {
|
type GetCommentResponse struct {
|
||||||
|
Bluesky []BlueskyComment `json:"bluesky,omitempty"`
|
||||||
|
Facebook []FacebookComment `json:"facebook,omitempty"`
|
||||||
Instagram []InstagramComment `json:"instagram,omitempty"`
|
Instagram []InstagramComment `json:"instagram,omitempty"`
|
||||||
|
LinkedIn []LinkedInComment `json:"linkedin,omitempty"`
|
||||||
|
Reddit []RedditComment `json:"reddit,omitempty"`
|
||||||
|
Threads []ThreadsComment `json:"threads,omitempty"`
|
||||||
TikTok []TikTokComment `json:"tiktok,omitempty"`
|
TikTok []TikTokComment `json:"tiktok,omitempty"`
|
||||||
|
Twitter []TwitterComment `json:"twitter,omitempty"`
|
||||||
|
YouTube []YouTubeComment `json:"youtube,omitempty"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
LastUpdated string `json:"lastUpdated,omitempty"`
|
LastUpdated string `json:"lastUpdated,omitempty"`
|
||||||
@ -151,11 +401,73 @@ type TikTokDeleteResponse struct {
|
|||||||
Comment string `json:"comment"`
|
Comment string `json:"comment"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BlueskyDeleteResponse Bluesky 删除评论响应(单条)
|
||||||
|
type BlueskyDeleteResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Id string `json:"id"` // Bluesky Social Comment ID
|
||||||
|
Comment string `json:"comment,omitempty"` // 删除的评论内容
|
||||||
|
}
|
||||||
|
|
||||||
|
// FacebookDeleteResponse Facebook 删除评论响应(单条)
|
||||||
|
type FacebookDeleteResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Id string `json:"id"` // Facebook Social Comment ID
|
||||||
|
Comment string `json:"comment,omitempty"` // 删除的评论内容
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedInDeleteResponse LinkedIn 删除评论响应(单条)
|
||||||
|
type LinkedInDeleteResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Id string `json:"id"` // LinkedIn Social Comment ID
|
||||||
|
Comment string `json:"comment,omitempty"` // 删除的评论内容
|
||||||
|
}
|
||||||
|
|
||||||
|
// ThreadsDeleteResponse Threads 删除评论响应(单条)
|
||||||
|
type ThreadsDeleteResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Id string `json:"id"` // Threads Social Comment ID
|
||||||
|
}
|
||||||
|
|
||||||
|
// TwitterDeletePostResponse Twitter 删除的单条评论信息
|
||||||
|
type TwitterDeletePostResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Id string `json:"id"` // Twitter Social Comment ID
|
||||||
|
Comment string `json:"comment,omitempty"` // 删除的评论内容
|
||||||
|
}
|
||||||
|
|
||||||
|
// TwitterDeleteResponse Twitter 删除评论响应(单条或批量中的元素)
|
||||||
|
type TwitterDeleteResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
Id string `json:"id,omitempty"` // Twitter Social Comment ID(单条删除时返回)
|
||||||
|
Comment string `json:"comment,omitempty"` // 删除的评论内容(单条删除时返回)
|
||||||
|
Posts []TwitterDeletePostResponse `json:"posts,omitempty"` // 批量删除时返回的评论列表
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTubeDeleteResponse YouTube 删除评论响应(单条)
|
||||||
|
type YouTubeDeleteResponse struct {
|
||||||
|
Action string `json:"action"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Id string `json:"id"` // YouTube Social Comment ID
|
||||||
|
Comment string `json:"comment,omitempty"` // 删除的评论内容
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteCommentResponse 删除评论响应
|
// DeleteCommentResponse 删除评论响应
|
||||||
type DeleteCommentResponse struct {
|
type DeleteCommentResponse struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
Bluesky interface{} `json:"bluesky,omitempty"` // 可能是 BlueskyDeleteResponse 或 []BlueskyDeleteResponse
|
||||||
|
Facebook interface{} `json:"facebook,omitempty"` // 可能是 FacebookDeleteResponse 或 []FacebookDeleteResponse
|
||||||
Instagram interface{} `json:"instagram,omitempty"` // 可能是 InstagramDeleteResponse 或 []InstagramDeleteResponse
|
Instagram interface{} `json:"instagram,omitempty"` // 可能是 InstagramDeleteResponse 或 []InstagramDeleteResponse
|
||||||
|
LinkedIn interface{} `json:"linkedin,omitempty"` // 可能是 LinkedInDeleteResponse 或 []LinkedInDeleteResponse
|
||||||
|
Threads interface{} `json:"threads,omitempty"` // 可能是 ThreadsDeleteResponse 或 []ThreadsDeleteResponse
|
||||||
TikTok interface{} `json:"tiktok,omitempty"` // 可能是 TikTokDeleteResponse 或 []TikTokDeleteResponse
|
TikTok interface{} `json:"tiktok,omitempty"` // 可能是 TikTokDeleteResponse 或 []TikTokDeleteResponse
|
||||||
|
Twitter interface{} `json:"twitter,omitempty"` // 可能是 TwitterDeleteResponse 或 []TwitterDeleteResponse
|
||||||
|
YouTube interface{} `json:"youtube,omitempty"` // 可能是 YouTubeDeleteResponse 或 []YouTubeDeleteResponse
|
||||||
// 错误相关字段
|
// 错误相关字段
|
||||||
Action string `json:"action,omitempty"`
|
Action string `json:"action,omitempty"`
|
||||||
Code int `json:"code,omitempty"`
|
Code int `json:"code,omitempty"`
|
||||||
@ -166,10 +478,30 @@ type DeleteCommentResponse struct {
|
|||||||
type ReplyCommentRequest struct {
|
type ReplyCommentRequest struct {
|
||||||
ID string `json:"-"` // Ayrshare Comment ID (路径参数)
|
ID string `json:"-"` // Ayrshare Comment ID (路径参数)
|
||||||
Comment string `json:"comment"` // 回复内容
|
Comment string `json:"comment"` // 回复内容
|
||||||
Platforms []string `json:"platforms"` // 平台列表,只支持 ["instagram", "tiktok"]
|
Platforms []string `json:"platforms"` // 平台列表,支持 Ayrshare 回复评论接口支持的平台,例如 ["instagram", "tiktok", "facebook", "linkedin", "twitter", "youtube", "bluesky"]
|
||||||
ProfileKey string `json:"-"` // Profile Key,不序列化
|
ProfileKey string `json:"-"` // Profile Key,不序列化
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BlueskyReplyResponse Bluesky 回复评论响应
|
||||||
|
type BlueskyReplyResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // Bluesky Social Comment ID
|
||||||
|
Cid string `json:"cid,omitempty"` // Bluesky Comment CID
|
||||||
|
Comment string `json:"comment"` // 回复内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "bluesky"
|
||||||
|
PostUrl string `json:"postUrl,omitempty"` // 回复评论的访问 URL
|
||||||
|
SourceCommentId string `json:"sourceCommentId"` // 原始评论的 Bluesky Social Comment ID
|
||||||
|
}
|
||||||
|
|
||||||
|
// FacebookReplyResponse Facebook 回复评论响应
|
||||||
|
type FacebookReplyResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // Facebook Social Comment ID
|
||||||
|
SourceCommentId string `json:"sourceCommentId"` // 原始评论的 Facebook Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 回复内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "facebook"
|
||||||
|
}
|
||||||
|
|
||||||
// InstagramReplyResponse Instagram 回复评论响应
|
// InstagramReplyResponse Instagram 回复评论响应
|
||||||
type InstagramReplyResponse struct {
|
type InstagramReplyResponse struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@ -189,15 +521,49 @@ type TikTokReplyResponse struct {
|
|||||||
VideoId string `json:"videoId,omitempty"` // TikTok Social Post ID
|
VideoId string `json:"videoId,omitempty"` // TikTok Social Post ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LinkedInReplyResponse LinkedIn 回复评论响应
|
||||||
|
type LinkedInReplyResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // LinkedIn Social Comment ID
|
||||||
|
SourceCommentId string `json:"sourceCommentId"` // 原始评论的 LinkedIn Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 回复内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "linkedin"
|
||||||
|
}
|
||||||
|
|
||||||
|
// TwitterReplyResponse Twitter/X 回复评论响应
|
||||||
|
type TwitterReplyResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // Twitter Social Comment ID
|
||||||
|
SourceCommentId string `json:"sourceCommentId"` // 原始评论的 Twitter Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 回复内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "twitter"
|
||||||
|
PostUrl string `json:"postUrl,omitempty"` // 回复评论的访问 URL
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTubeReplyResponse YouTube 回复评论响应
|
||||||
|
type YouTubeReplyResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
CommentId string `json:"commentId"` // YouTube Social Comment ID
|
||||||
|
SourceCommentId string `json:"sourceCommentId"` // 原始评论的 YouTube Social Comment ID
|
||||||
|
Comment string `json:"comment"` // 回复内容
|
||||||
|
Platform string `json:"platform"` // 平台标识,一般为 "youtube"
|
||||||
|
}
|
||||||
|
|
||||||
// ReplyCommentResponse 回复评论响应
|
// ReplyCommentResponse 回复评论响应
|
||||||
type ReplyCommentResponse struct {
|
type ReplyCommentResponse struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
CommentId string `json:"commentId,omitempty"` // Ayrshare Comment ID
|
CommentId string `json:"commentId,omitempty"` // Ayrshare Comment ID,用于后续再次回复
|
||||||
ID string `json:"id,omitempty"` // Ayrshare Comment ID
|
ID string `json:"id,omitempty"` // Ayrshare Comment ID
|
||||||
|
Bluesky *BlueskyReplyResponse `json:"bluesky,omitempty"`
|
||||||
|
Facebook *FacebookReplyResponse `json:"facebook,omitempty"`
|
||||||
Instagram *InstagramReplyResponse `json:"instagram,omitempty"`
|
Instagram *InstagramReplyResponse `json:"instagram,omitempty"`
|
||||||
|
LinkedIn *LinkedInReplyResponse `json:"linkedin,omitempty"`
|
||||||
TikTok *TikTokReplyResponse `json:"tiktok,omitempty"`
|
TikTok *TikTokReplyResponse `json:"tiktok,omitempty"`
|
||||||
|
Twitter *TwitterReplyResponse `json:"twitter,omitempty"`
|
||||||
|
YouTube *YouTubeReplyResponse `json:"youtube,omitempty"`
|
||||||
// 错误相关字段
|
// 错误相关字段
|
||||||
Action string `json:"action,omitempty"`
|
Action string `json:"action,omitempty"`
|
||||||
Code int `json:"code,omitempty"`
|
Code int `json:"code,omitempty"`
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
|
Errors []PlatformError `json:"errors,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ func (a *AyrshareComment) PostComment(req *dto.PostCommentRequest) (res *dto.Pos
|
|||||||
|
|
||||||
res = new(dto.PostCommentResponse)
|
res = new(dto.PostCommentResponse)
|
||||||
|
|
||||||
// 验证必填参数
|
// 验证必填参数(这里只校验是否为空,平台合法性交由 Ayrshare 接口本身校验,方便支持更多平台)
|
||||||
if req.ID == "" {
|
if req.ID == "" {
|
||||||
return nil, errCommon.ReturnError(fmt.Errorf("id不能为空"), "id不能为空", "发布评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("id不能为空"), "id不能为空", "发布评论 失败: ")
|
||||||
}
|
}
|
||||||
@ -40,21 +40,6 @@ func (a *AyrshareComment) PostComment(req *dto.PostCommentRequest) (res *dto.Pos
|
|||||||
return nil, errCommon.ReturnError(fmt.Errorf("platforms不能为空"), "platforms不能为空", "发布评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("platforms不能为空"), "platforms不能为空", "发布评论 失败: ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证平台是否只包含 instagram 和 tiktok
|
|
||||||
validPlatforms := map[string]bool{
|
|
||||||
"instagram": true,
|
|
||||||
"tiktok": true,
|
|
||||||
}
|
|
||||||
for _, platform := range req.Platforms {
|
|
||||||
if !validPlatforms[platform] {
|
|
||||||
return nil, errCommon.ReturnError(
|
|
||||||
fmt.Errorf("不支持的平台: %s,只支持 instagram 和 tiktok", platform),
|
|
||||||
fmt.Sprintf("不支持的平台: %s,只支持 instagram 和 tiktok", platform),
|
|
||||||
"发布评论 失败: ",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建请求URL
|
// 构建请求URL
|
||||||
url := fmt.Sprintf("%s/api/comments", app.ModuleClients.AryshareClient.Config.Endpoint)
|
url := fmt.Sprintf("%s/api/comments", app.ModuleClients.AryshareClient.Config.Endpoint)
|
||||||
|
|
||||||
@ -217,7 +202,7 @@ func (a *AyrshareComment) DeleteComment(req *dto.DeleteCommentRequest) (res *dto
|
|||||||
|
|
||||||
res = new(dto.DeleteCommentResponse)
|
res = new(dto.DeleteCommentResponse)
|
||||||
|
|
||||||
// 验证必填参数
|
// 验证必填参数(这里只校验是否为空,平台合法性交由 Ayrshare 接口本身校验,方便支持更多平台)
|
||||||
if req.ID == "" {
|
if req.ID == "" {
|
||||||
return nil, errCommon.ReturnError(fmt.Errorf("id不能为空"), "id不能为空", "删除评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("id不能为空"), "id不能为空", "删除评论 失败: ")
|
||||||
}
|
}
|
||||||
@ -229,36 +214,12 @@ func (a *AyrshareComment) DeleteComment(req *dto.DeleteCommentRequest) (res *dto
|
|||||||
if req.Platform == "" {
|
if req.Platform == "" {
|
||||||
return nil, errCommon.ReturnError(fmt.Errorf("使用 Social Comment ID 时 platform 不能为空"), "使用 Social Comment ID 时 platform 不能为空", "删除评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("使用 Social Comment ID 时 platform 不能为空"), "使用 Social Comment ID 时 platform 不能为空", "删除评论 失败: ")
|
||||||
}
|
}
|
||||||
// 验证平台是否只包含 instagram 和 tiktok
|
// 不在本地限制 platform 的具体取值,交由 Ayrshare 接口本身校验,便于支持更多平台
|
||||||
validPlatforms := map[string]bool{
|
|
||||||
"instagram": true,
|
|
||||||
"tiktok": true,
|
|
||||||
}
|
|
||||||
if !validPlatforms[req.Platform] {
|
|
||||||
return nil, errCommon.ReturnError(
|
|
||||||
fmt.Errorf("不支持的平台: %s,只支持 instagram 和 tiktok", req.Platform),
|
|
||||||
fmt.Sprintf("不支持的平台: %s,只支持 instagram 和 tiktok", req.Platform),
|
|
||||||
"删除评论 失败: ",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if len(req.Platforms) == 0 {
|
if len(req.Platforms) == 0 {
|
||||||
return nil, errCommon.ReturnError(fmt.Errorf("platforms不能为空"), "platforms不能为空", "删除评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("platforms不能为空"), "platforms不能为空", "删除评论 失败: ")
|
||||||
}
|
}
|
||||||
// 验证平台是否只包含 instagram 和 tiktok
|
// 不在本地限制 platforms 的具体取值,交由 Ayrshare 接口本身校验,便于支持更多平台
|
||||||
validPlatforms := map[string]bool{
|
|
||||||
"instagram": true,
|
|
||||||
"tiktok": true,
|
|
||||||
}
|
|
||||||
for _, platform := range req.Platforms {
|
|
||||||
if !validPlatforms[platform] {
|
|
||||||
return nil, errCommon.ReturnError(
|
|
||||||
fmt.Errorf("不支持的平台: %s,只支持 instagram 和 tiktok", platform),
|
|
||||||
fmt.Sprintf("不支持的平台: %s,只支持 instagram 和 tiktok", platform),
|
|
||||||
"删除评论 失败: ",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建请求URL
|
// 构建请求URL
|
||||||
@ -351,7 +312,7 @@ func (a *AyrshareComment) ReplyComment(req *dto.ReplyCommentRequest) (res *dto.R
|
|||||||
|
|
||||||
res = new(dto.ReplyCommentResponse)
|
res = new(dto.ReplyCommentResponse)
|
||||||
|
|
||||||
// 验证必填参数
|
// 验证必填参数(这里只校验是否为空,平台合法性交由 Ayrshare 接口本身校验,方便支持更多平台)
|
||||||
if req.ID == "" {
|
if req.ID == "" {
|
||||||
return nil, errCommon.ReturnError(fmt.Errorf("id不能为空"), "id不能为空", "回复评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("id不能为空"), "id不能为空", "回复评论 失败: ")
|
||||||
}
|
}
|
||||||
@ -362,21 +323,6 @@ func (a *AyrshareComment) ReplyComment(req *dto.ReplyCommentRequest) (res *dto.R
|
|||||||
return nil, errCommon.ReturnError(fmt.Errorf("platforms不能为空"), "platforms不能为空", "回复评论 失败: ")
|
return nil, errCommon.ReturnError(fmt.Errorf("platforms不能为空"), "platforms不能为空", "回复评论 失败: ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证平台是否只包含 instagram 和 tiktok
|
|
||||||
validPlatforms := map[string]bool{
|
|
||||||
"instagram": true,
|
|
||||||
"tiktok": true,
|
|
||||||
}
|
|
||||||
for _, platform := range req.Platforms {
|
|
||||||
if !validPlatforms[platform] {
|
|
||||||
return nil, errCommon.ReturnError(
|
|
||||||
fmt.Errorf("不支持的平台: %s,只支持 instagram 和 tiktok", platform),
|
|
||||||
fmt.Sprintf("不支持的平台: %s,只支持 instagram 和 tiktok", platform),
|
|
||||||
"回复评论 失败: ",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建请求URL
|
// 构建请求URL
|
||||||
url := fmt.Sprintf("%s/api/comments/reply/%s", app.ModuleClients.AryshareClient.Config.Endpoint, req.ID)
|
url := fmt.Sprintf("%s/api/comments/reply/%s", app.ModuleClients.AryshareClient.Config.Endpoint, req.ID)
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -379,6 +379,21 @@ func (this *InstagramCommentResponse) Validate() error {
|
|||||||
func (this *TikTokCommentResponse) Validate() error {
|
func (this *TikTokCommentResponse) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *BlueskyCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *PlatformError) Validate() error {
|
func (this *PlatformError) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -400,6 +415,31 @@ func (this *PostCommentResponse) Validate() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if this.Bluesky != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bluesky); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Bluesky", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Facebook != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Facebook); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Facebook", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Linkedin != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Linkedin); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Linkedin", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Twitter != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Twitter); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Twitter", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Youtube != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Youtube); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Youtube", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *GetCommentRequest) Validate() error {
|
func (this *GetCommentRequest) Validate() error {
|
||||||
@ -444,6 +484,136 @@ func (this *TikTokComment) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *BlueskyComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookUser) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookParent) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Parent != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Parent); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Parent", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInMedia) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInFrom) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Media {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Media", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RedditUser) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RedditComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ThreadsComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterPublicMetrics) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterReferencedTweet) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterReplyTo) Validate() error {
|
||||||
|
if this.PublicMetrics != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PublicMetrics); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("PublicMetrics", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterComment) Validate() error {
|
||||||
|
if this.PublicMetrics != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PublicMetrics); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("PublicMetrics", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.ReferencedTweets {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ReferencedTweets", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.ReplyTo != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ReplyTo); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ReplyTo", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeReply) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *GetCommentResponse) Validate() error {
|
func (this *GetCommentResponse) Validate() error {
|
||||||
for _, item := range this.Instagram {
|
for _, item := range this.Instagram {
|
||||||
if item != nil {
|
if item != nil {
|
||||||
@ -459,6 +629,55 @@ func (this *GetCommentResponse) Validate() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for _, item := range this.Bluesky {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Bluesky", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Facebook {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Facebook", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Linkedin {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Linkedin", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Reddit {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Reddit", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Threads {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Threads", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Twitter {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Twitter", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Youtube {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Youtube", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *DeleteCommentRequest) Validate() error {
|
func (this *DeleteCommentRequest) Validate() error {
|
||||||
@ -499,6 +718,21 @@ func (this *InstagramReplyResponse) Validate() error {
|
|||||||
func (this *TikTokReplyResponse) Validate() error {
|
func (this *TikTokReplyResponse) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *BlueskyReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *ReplyCommentResponse) Validate() error {
|
func (this *ReplyCommentResponse) Validate() error {
|
||||||
if this.Instagram != nil {
|
if this.Instagram != nil {
|
||||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Instagram); err != nil {
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Instagram); err != nil {
|
||||||
@ -510,6 +744,31 @@ func (this *ReplyCommentResponse) Validate() error {
|
|||||||
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if this.Bluesky != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bluesky); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Bluesky", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Facebook != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Facebook); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Facebook", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Linkedin != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Linkedin); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Linkedin", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Twitter != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Twitter); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Twitter", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Youtube != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Youtube); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Youtube", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *GetPostAnalyticsRequest) Validate() error {
|
func (this *GetPostAnalyticsRequest) Validate() error {
|
||||||
|
|||||||
@ -564,6 +564,49 @@ message TikTokCommentResponse {
|
|||||||
string videoId = 5 [json_name = "videoId"];
|
string videoId = 5 [json_name = "videoId"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bluesky 平台评论响应
|
||||||
|
message BlueskyCommentResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string cid = 3 [json_name = "cid"];
|
||||||
|
string comment = 4 [json_name = "comment"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
string postUrl = 6 [json_name = "postUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Facebook 平台评论响应
|
||||||
|
message FacebookCommentResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string comment = 3 [json_name = "comment"];
|
||||||
|
string platform = 4 [json_name = "platform"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedIn 平台评论响应
|
||||||
|
message LinkedInCommentResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string comment = 3 [json_name = "comment"];
|
||||||
|
string commentUrn = 4 [json_name = "commentUrn"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitter/X 平台评论响应
|
||||||
|
message TwitterCommentResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string comment = 3 [json_name = "comment"];
|
||||||
|
string postUrl = 4 [json_name = "postUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTube 平台评论响应
|
||||||
|
message YouTubeCommentResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string comment = 3 [json_name = "comment"];
|
||||||
|
string platform = 4 [json_name = "platform"];
|
||||||
|
}
|
||||||
|
|
||||||
// 平台错误信息
|
// 平台错误信息
|
||||||
message PlatformError {
|
message PlatformError {
|
||||||
string action = 1 [json_name = "action"];
|
string action = 1 [json_name = "action"];
|
||||||
@ -586,6 +629,12 @@ message PostCommentResponse {
|
|||||||
string message = 9 [json_name = "message"];
|
string message = 9 [json_name = "message"];
|
||||||
string platform = 10 [json_name = "platform"];
|
string platform = 10 [json_name = "platform"];
|
||||||
repeated PlatformError errors = 11 [json_name = "errors"];
|
repeated PlatformError errors = 11 [json_name = "errors"];
|
||||||
|
// 其它平台的发布评论结果
|
||||||
|
BlueskyCommentResponse bluesky = 12 [json_name = "bluesky"];
|
||||||
|
FacebookCommentResponse facebook = 13 [json_name = "facebook"];
|
||||||
|
LinkedInCommentResponse linkedin = 14 [json_name = "linkedin"];
|
||||||
|
TwitterCommentResponse twitter = 15 [json_name = "twitter"];
|
||||||
|
YouTubeCommentResponse youtube = 16 [json_name = "youtube"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取评论请求
|
// 获取评论请求
|
||||||
@ -647,6 +696,200 @@ message TikTokComment {
|
|||||||
string visibility = 19 [json_name = "visibility"];
|
string visibility = 19 [json_name = "visibility"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bluesky 评论详情
|
||||||
|
message BlueskyComment {
|
||||||
|
string comment = 1 [json_name = "comment"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string created = 3 [json_name = "created"];
|
||||||
|
string displayName = 4 [json_name = "displayName"];
|
||||||
|
int32 likeCount = 5 [json_name = "likeCount"];
|
||||||
|
string platform = 6 [json_name = "platform"];
|
||||||
|
string profileImageUrl = 7 [json_name = "profileImageUrl"];
|
||||||
|
int32 quoteCount = 8 [json_name = "quoteCount"];
|
||||||
|
repeated BlueskyComment replies = 9 [json_name = "replies"];
|
||||||
|
int32 replyCount = 10 [json_name = "replyCount"];
|
||||||
|
string replyTo = 11 [json_name = "replyTo"];
|
||||||
|
int32 repostCount = 12 [json_name = "repostCount"];
|
||||||
|
string userName = 13 [json_name = "userName"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Facebook 用户信息
|
||||||
|
message FacebookUser {
|
||||||
|
string name = 1 [json_name = "name"];
|
||||||
|
string id = 2 [json_name = "id"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Facebook 父级评论/帖子信息
|
||||||
|
message FacebookParent {
|
||||||
|
string createdTime = 1 [json_name = "createdTime"];
|
||||||
|
FacebookUser from = 2 [json_name = "from"];
|
||||||
|
string message = 3 [json_name = "message"];
|
||||||
|
string id = 4 [json_name = "id"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Facebook 评论详情(用于主评论和回复)
|
||||||
|
message FacebookComment {
|
||||||
|
string comment = 1 [json_name = "comment"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
int32 commentCount = 3 [json_name = "commentCount"];
|
||||||
|
string commentUrl = 4 [json_name = "commentUrl"];
|
||||||
|
bool company = 5 [json_name = "company"];
|
||||||
|
string created = 6 [json_name = "created"];
|
||||||
|
FacebookUser from = 7 [json_name = "from"];
|
||||||
|
int32 likeCount = 8 [json_name = "likeCount"];
|
||||||
|
FacebookParent parent = 9 [json_name = "parent"];
|
||||||
|
string platform = 10 [json_name = "platform"];
|
||||||
|
bool userLikes = 11 [json_name = "userLikes"];
|
||||||
|
repeated FacebookComment replies = 12 [json_name = "replies"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedIn 评论中的媒体信息
|
||||||
|
message LinkedInMedia {
|
||||||
|
string type = 1 [json_name = "type"];
|
||||||
|
string url = 2 [json_name = "url"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedIn 评论发布者信息
|
||||||
|
message LinkedInFrom {
|
||||||
|
string name = 1 [json_name = "name"];
|
||||||
|
string id = 2 [json_name = "id"];
|
||||||
|
string url = 3 [json_name = "url"];
|
||||||
|
string description = 4 [json_name = "description"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedIn 评论详情
|
||||||
|
message LinkedInComment {
|
||||||
|
string comment = 1 [json_name = "comment"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string commentUrn = 3 [json_name = "commentUrn"];
|
||||||
|
string created = 4 [json_name = "created"];
|
||||||
|
LinkedInFrom from = 5 [json_name = "from"];
|
||||||
|
int32 likeCount = 6 [json_name = "likeCount"];
|
||||||
|
repeated LinkedInMedia media = 7 [json_name = "media"];
|
||||||
|
string platform = 8 [json_name = "platform"];
|
||||||
|
string profileImageUrl = 9 [json_name = "profileImageUrl"];
|
||||||
|
string userName = 10 [json_name = "userName"];
|
||||||
|
int32 founded = 11 [json_name = "founded"];
|
||||||
|
string organizationType = 12 [json_name = "organizationType"];
|
||||||
|
string website = 13 [json_name = "website"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reddit 用户信息
|
||||||
|
message RedditUser {
|
||||||
|
string name = 1 [json_name = "name"];
|
||||||
|
string id = 2 [json_name = "id"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reddit 评论详情
|
||||||
|
message RedditComment {
|
||||||
|
string comment = 1 [json_name = "comment"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string created = 3 [json_name = "created"];
|
||||||
|
RedditUser from = 4 [json_name = "from"];
|
||||||
|
string commentUrl = 5 [json_name = "commentUrl"];
|
||||||
|
string subreddit = 6 [json_name = "subreddit"];
|
||||||
|
int32 ups = 7 [json_name = "ups"];
|
||||||
|
bool isSubmitter = 8 [json_name = "isSubmitter"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Threads 评论详情(用于主评论和回复)
|
||||||
|
message ThreadsComment {
|
||||||
|
string comment = 1 [json_name = "comment"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string commentUrl = 3 [json_name = "commentUrl"];
|
||||||
|
string created = 4 [json_name = "created"];
|
||||||
|
bool hasReplies = 5 [json_name = "hasReplies"];
|
||||||
|
bool isQuotePost = 6 [json_name = "isQuotePost"];
|
||||||
|
bool isReply = 7 [json_name = "isReply"];
|
||||||
|
bool isReplyOwnedByMe = 8 [json_name = "isReplyOwnedByMe"];
|
||||||
|
string mediaType = 9 [json_name = "mediaType"];
|
||||||
|
string parentId = 10 [json_name = "parentId"];
|
||||||
|
string platform = 11 [json_name = "platform"];
|
||||||
|
string postId = 12 [json_name = "postId"];
|
||||||
|
repeated ThreadsComment replies = 13 [json_name = "replies"];
|
||||||
|
string replyAudience = 14 [json_name = "replyAudience"];
|
||||||
|
string shortcode = 15 [json_name = "shortcode"];
|
||||||
|
string userName = 16 [json_name = "userName"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitter/X 用户公共指标(用户维度,用于 Get Comments 返回)
|
||||||
|
message TwitterPublicMetrics {
|
||||||
|
int32 followersCount = 1 [json_name = "followersCount"];
|
||||||
|
int32 followingCount = 2 [json_name = "followingCount"];
|
||||||
|
int32 tweetCount = 3 [json_name = "tweetCount"];
|
||||||
|
int32 listedCount = 4 [json_name = "listedCount"];
|
||||||
|
int32 likeCount = 5 [json_name = "likeCount"];
|
||||||
|
int32 mediaCount = 6 [json_name = "mediaCount"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitter/X 被引用或回复的 Tweet 信息
|
||||||
|
message TwitterReferencedTweet {
|
||||||
|
string type = 1 [json_name = "type"];
|
||||||
|
string id = 2 [json_name = "id"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitter/X 被回复的用户信息
|
||||||
|
message TwitterReplyTo {
|
||||||
|
string createdAt = 1 [json_name = "createdAt"];
|
||||||
|
string description = 2 [json_name = "description"];
|
||||||
|
string id = 3 [json_name = "id"];
|
||||||
|
string location = 4 [json_name = "location"];
|
||||||
|
string name = 5 [json_name = "name"];
|
||||||
|
string profileImageUrl = 6 [json_name = "profileImageUrl"];
|
||||||
|
TwitterPublicMetrics publicMetrics = 7 [json_name = "publicMetrics"];
|
||||||
|
string url = 8 [json_name = "url"];
|
||||||
|
string username = 9 [json_name = "username"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitter/X 评论详情
|
||||||
|
message TwitterComment {
|
||||||
|
int32 bookmarkCount = 1 [json_name = "bookmarkCount"];
|
||||||
|
string comment = 2 [json_name = "comment"];
|
||||||
|
string commentId = 3 [json_name = "commentId"];
|
||||||
|
string created = 4 [json_name = "created"];
|
||||||
|
string description = 5 [json_name = "description"];
|
||||||
|
string id = 6 [json_name = "id"];
|
||||||
|
int32 impressionCount = 7 [json_name = "impressionCount"];
|
||||||
|
int32 likeCount = 8 [json_name = "likeCount"];
|
||||||
|
string name = 9 [json_name = "name"];
|
||||||
|
string platform = 10 [json_name = "platform"];
|
||||||
|
string profileImageUrl = 11 [json_name = "profileImageUrl"];
|
||||||
|
TwitterPublicMetrics publicMetrics = 12 [json_name = "publicMetrics"];
|
||||||
|
int32 quoteCount = 13 [json_name = "quoteCount"];
|
||||||
|
repeated TwitterReferencedTweet referencedTweets = 14 [json_name = "referencedTweets"];
|
||||||
|
int32 replyCount = 15 [json_name = "replyCount"];
|
||||||
|
TwitterReplyTo replyTo = 16 [json_name = "replyTo"];
|
||||||
|
int32 threadNumber = 17 [json_name = "threadNumber"];
|
||||||
|
string userName = 18 [json_name = "userName"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTube 回复评论详情
|
||||||
|
message YouTubeReply {
|
||||||
|
string channelUrl = 1 [json_name = "channelUrl"];
|
||||||
|
string comment = 2 [json_name = "comment"];
|
||||||
|
string commentId = 3 [json_name = "commentId"];
|
||||||
|
string created = 4 [json_name = "created"];
|
||||||
|
int32 likeCount = 5 [json_name = "likeCount"];
|
||||||
|
string platform = 6 [json_name = "platform"];
|
||||||
|
string profileImageUrl = 7 [json_name = "profileImageUrl"];
|
||||||
|
string userName = 8 [json_name = "userName"];
|
||||||
|
string parentId = 9 [json_name = "parentId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTube 评论详情
|
||||||
|
message YouTubeComment {
|
||||||
|
string channelUrl = 1 [json_name = "channelUrl"];
|
||||||
|
string comment = 2 [json_name = "comment"];
|
||||||
|
string commentId = 3 [json_name = "commentId"];
|
||||||
|
string created = 4 [json_name = "created"];
|
||||||
|
bool isPublic = 5 [json_name = "isPublic"];
|
||||||
|
int32 likeCount = 6 [json_name = "likeCount"];
|
||||||
|
string platform = 7 [json_name = "platform"];
|
||||||
|
string profileImageUrl = 8 [json_name = "profileImageUrl"];
|
||||||
|
repeated YouTubeReply replies = 9 [json_name = "replies"];
|
||||||
|
string userName = 10 [json_name = "userName"];
|
||||||
|
}
|
||||||
|
|
||||||
// 获取评论响应
|
// 获取评论响应
|
||||||
message GetCommentResponse {
|
message GetCommentResponse {
|
||||||
repeated InstagramComment instagram = 1 [json_name = "instagram"];
|
repeated InstagramComment instagram = 1 [json_name = "instagram"];
|
||||||
@ -658,6 +901,14 @@ message GetCommentResponse {
|
|||||||
string action = 7 [json_name = "action"];
|
string action = 7 [json_name = "action"];
|
||||||
int32 code = 8 [json_name = "code"];
|
int32 code = 8 [json_name = "code"];
|
||||||
string message = 9 [json_name = "message"];
|
string message = 9 [json_name = "message"];
|
||||||
|
// 其它平台的评论列表
|
||||||
|
repeated BlueskyComment bluesky = 10 [json_name = "bluesky"];
|
||||||
|
repeated FacebookComment facebook = 11 [json_name = "facebook"];
|
||||||
|
repeated LinkedInComment linkedin = 12 [json_name = "linkedin"];
|
||||||
|
repeated RedditComment reddit = 13 [json_name = "reddit"];
|
||||||
|
repeated ThreadsComment threads = 14 [json_name = "threads"];
|
||||||
|
repeated TwitterComment twitter = 15 [json_name = "twitter"];
|
||||||
|
repeated YouTubeComment youtube = 16 [json_name = "youtube"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除评论请求
|
// 删除评论请求
|
||||||
@ -695,6 +946,13 @@ message DeleteCommentResponse {
|
|||||||
string action = 4 [json_name = "action"];
|
string action = 4 [json_name = "action"];
|
||||||
int32 code = 5 [json_name = "code"];
|
int32 code = 5 [json_name = "code"];
|
||||||
string message = 6 [json_name = "message"];
|
string message = 6 [json_name = "message"];
|
||||||
|
// 其它平台删除结果,同样使用 JSON 字符串存储,兼容单条或多条返回
|
||||||
|
string bluesky = 7 [json_name = "bluesky"];
|
||||||
|
string facebook = 8 [json_name = "facebook"];
|
||||||
|
string linkedin = 9 [json_name = "linkedin"];
|
||||||
|
string threads = 10 [json_name = "threads"];
|
||||||
|
string twitter = 11 [json_name = "twitter"];
|
||||||
|
string youtube = 12 [json_name = "youtube"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回复评论请求
|
// 回复评论请求
|
||||||
@ -724,6 +982,54 @@ message TikTokReplyResponse {
|
|||||||
string videoId = 6 [json_name = "videoId"];
|
string videoId = 6 [json_name = "videoId"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bluesky 回复评论响应
|
||||||
|
message BlueskyReplyResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string sourceCommentId = 3 [json_name = "sourceCommentId"];
|
||||||
|
string comment = 4 [json_name = "comment"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
string cid = 6 [json_name = "cid"];
|
||||||
|
string postUrl = 7 [json_name = "postUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Facebook 回复评论响应
|
||||||
|
message FacebookReplyResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string sourceCommentId = 3 [json_name = "sourceCommentId"];
|
||||||
|
string comment = 4 [json_name = "comment"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkedIn 回复评论响应
|
||||||
|
message LinkedInReplyResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string sourceCommentId = 3 [json_name = "sourceCommentId"];
|
||||||
|
string comment = 4 [json_name = "comment"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitter/X 回复评论响应
|
||||||
|
message TwitterReplyResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string sourceCommentId = 3 [json_name = "sourceCommentId"];
|
||||||
|
string comment = 4 [json_name = "comment"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
string postUrl = 6 [json_name = "postUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// YouTube 回复评论响应
|
||||||
|
message YouTubeReplyResponse {
|
||||||
|
string status = 1 [json_name = "status"];
|
||||||
|
string commentId = 2 [json_name = "commentId"];
|
||||||
|
string sourceCommentId = 3 [json_name = "sourceCommentId"];
|
||||||
|
string comment = 4 [json_name = "comment"];
|
||||||
|
string platform = 5 [json_name = "platform"];
|
||||||
|
}
|
||||||
|
|
||||||
// 回复评论响应
|
// 回复评论响应
|
||||||
message ReplyCommentResponse {
|
message ReplyCommentResponse {
|
||||||
string status = 1 [json_name = "status"];
|
string status = 1 [json_name = "status"];
|
||||||
@ -734,6 +1040,12 @@ message ReplyCommentResponse {
|
|||||||
string action = 6 [json_name = "action"];
|
string action = 6 [json_name = "action"];
|
||||||
int32 code = 7 [json_name = "code"];
|
int32 code = 7 [json_name = "code"];
|
||||||
string message = 8 [json_name = "message"];
|
string message = 8 [json_name = "message"];
|
||||||
|
// 其它平台的回复结果
|
||||||
|
BlueskyReplyResponse bluesky = 9 [json_name = "bluesky"];
|
||||||
|
FacebookReplyResponse facebook = 10 [json_name = "facebook"];
|
||||||
|
LinkedInReplyResponse linkedin = 11 [json_name = "linkedin"];
|
||||||
|
TwitterReplyResponse twitter = 12 [json_name = "twitter"];
|
||||||
|
YouTubeReplyResponse youtube = 13 [json_name = "youtube"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 分析相关消息定义 ==========
|
// ========== 分析相关消息定义 ==========
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user