添加互动接口
This commit is contained in:
parent
aee8a427bc
commit
73464a6b6d
File diff suppressed because it is too large
Load Diff
@ -6,11 +6,10 @@ package aryshare
|
||||
import (
|
||||
fmt "fmt"
|
||||
math "math"
|
||||
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||
_ "github.com/mwitkow/go-proto-validators"
|
||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@ -41,6 +40,11 @@ func (this *PostRequest) Validate() error {
|
||||
if len(this.Platforms) < 1 {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
for _, item := range this.Platforms {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
}
|
||||
if this.InstagramOptions != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.InstagramOptions); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("InstagramOptions", err)
|
||||
@ -173,12 +177,6 @@ func (this *Email) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GenerateJWTRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`domain不能为空`))
|
||||
}
|
||||
if this.PrivateKey == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("PrivateKey", fmt.Errorf(`privateKey不能为空`))
|
||||
}
|
||||
if this.ProfileKey == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ProfileKey", fmt.Errorf(`profileKey不能为空`))
|
||||
}
|
||||
@ -192,3 +190,711 @@ func (this *GenerateJWTRequest) Validate() error {
|
||||
func (this *GenerateJWTResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *HistoryPostId) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *HistoryItem) Validate() error {
|
||||
for _, item := range this.PostIds {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("PostIds", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
if this.ScheduleDate != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ScheduleDate); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ScheduleDate", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetHistoryRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetHistoryResponse) Validate() error {
|
||||
for _, item := range this.History {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("History", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetHistoryByIdRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`帖子ID不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetHistoryByIdResponse) Validate() error {
|
||||
for _, item := range this.PostIds {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("PostIds", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
if this.ScheduleDate != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ScheduleDate); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ScheduleDate", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *PlatformPost) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetHistoryByPlatformRequest) Validate() error {
|
||||
if this.Platform == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`平台名称不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetHistoryByPlatformResponse) Validate() error {
|
||||
for _, item := range this.Posts {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Posts", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *SendMessageRequest) Validate() error {
|
||||
if this.Platform == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`平台不能为空`))
|
||||
}
|
||||
if this.RecipientId == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("RecipientId", fmt.Errorf(`接收者ID不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *MessageItem) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SendMessageResponse) Validate() error {
|
||||
for _, item := range this.Messages {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Messages", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetMessagesRequest) Validate() error {
|
||||
if this.Platform == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`平台不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *MessageAttachment) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *MessageSenderDetails) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *MessageRecipientDetails) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *MessageReaction) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetMessagesItem) Validate() error {
|
||||
if this.SenderDetails != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SenderDetails); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("SenderDetails", err)
|
||||
}
|
||||
}
|
||||
if this.RecipientDetails != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.RecipientDetails); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("RecipientDetails", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.Attachments {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Attachments", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, item := range this.Reactions {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Reactions", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ConversationParticipant) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ConversationDetail) Validate() error {
|
||||
if this.Participant != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Participant); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Participant", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetMessagesResponse) Validate() error {
|
||||
for _, item := range this.Messages {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Messages", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, item := range this.ConversationsDetails {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ConversationsDetails", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *PostCommentRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||
}
|
||||
if this.Comment == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Comment", fmt.Errorf(`comment不能为空`))
|
||||
}
|
||||
if len(this.Platforms) < 1 {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
for _, item := range this.Platforms {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InstagramCommentResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TikTokCommentResponse) Validate() error {
|
||||
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 {
|
||||
return nil
|
||||
}
|
||||
func (this *PostCommentResponse) Validate() error {
|
||||
if this.Instagram != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Instagram); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Instagram", err)
|
||||
}
|
||||
}
|
||||
if this.Tiktok != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Tiktok); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.Errors {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Errors", 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
|
||||
}
|
||||
func (this *GetCommentRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InstagramUser) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *InstagramUserInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *InstagramComment) 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.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)
|
||||
}
|
||||
}
|
||||
}
|
||||
if this.User != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.User); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("User", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *TikTokComment) 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 *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 {
|
||||
for _, item := range this.Instagram {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Instagram", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, item := range this.Tiktok {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
func (this *DeleteCommentRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InstagramDeleteResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TikTokDeleteResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *DeleteCommentResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ReplyCommentRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||
}
|
||||
if this.Comment == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Comment", fmt.Errorf(`comment不能为空`))
|
||||
}
|
||||
if len(this.Platforms) < 1 {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
for _, item := range this.Platforms {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InstagramReplyResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TikTokReplyResponse) Validate() error {
|
||||
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 {
|
||||
if this.Instagram != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Instagram); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Instagram", err)
|
||||
}
|
||||
}
|
||||
if this.Tiktok != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Tiktok); err != nil {
|
||||
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
|
||||
}
|
||||
func (this *GetPostAnalyticsRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`帖子ID不能为空`))
|
||||
}
|
||||
if len(this.Platforms) < 1 {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
for _, item := range this.Platforms {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetPostAnalyticsBySocialIDRequest) Validate() error {
|
||||
if this.Id == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`Social Post ID不能为空`))
|
||||
}
|
||||
if len(this.Platforms) < 1 {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
for _, item := range this.Platforms {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetPostAnalyticsResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetSocialAnalyticsRequest) Validate() error {
|
||||
if len(this.Platforms) < 1 {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
for _, item := range this.Platforms {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetSocialAnalyticsResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *AutoHashtagsRequest) Validate() error {
|
||||
if this.Post == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Post", fmt.Errorf(`post内容不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *AutoHashtagsResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CheckBannedHashtagRequest) Validate() error {
|
||||
if this.Hashtag == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Hashtag", fmt.Errorf(`hashtag不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *CheckBannedHashtagResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *HashtagRecommendation) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *RecommendHashtagsRequest) Validate() error {
|
||||
if this.Keyword == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Keyword", fmt.Errorf(`keyword不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *RecommendHashtagsResponse) Validate() error {
|
||||
for _, item := range this.Recommendations {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Recommendations", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *SearchHashtagsRequest) Validate() error {
|
||||
if this.Keyword == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Keyword", fmt.Errorf(`keyword不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *SearchHashtagInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SearchHashtagChild) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SearchHashtagChildren) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *SearchHashtagMedia) Validate() error {
|
||||
if this.Children != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Children); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Children", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *SearchHashtagsResponse) Validate() error {
|
||||
if this.Hashtag != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Hashtag); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Hashtag", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.SearchResults {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("SearchResults", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -37,6 +37,27 @@ type AyrshareClient interface {
|
||||
CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc_go.CallOption) (*CreateProfileResponse, common.ErrorWithAttachment)
|
||||
GetProfiles(ctx context.Context, in *GetProfilesRequest, opts ...grpc_go.CallOption) (*GetProfilesResponse, common.ErrorWithAttachment)
|
||||
GenerateJWT(ctx context.Context, in *GenerateJWTRequest, opts ...grpc_go.CallOption) (*GenerateJWTResponse, common.ErrorWithAttachment)
|
||||
// 历史记录相关 api
|
||||
GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment)
|
||||
GetHistoryById(ctx context.Context, in *GetHistoryByIdRequest, opts ...grpc_go.CallOption) (*GetHistoryByIdResponse, common.ErrorWithAttachment)
|
||||
GetHistoryByPlatform(ctx context.Context, in *GetHistoryByPlatformRequest, opts ...grpc_go.CallOption) (*GetHistoryByPlatformResponse, common.ErrorWithAttachment)
|
||||
// 消息相关 api
|
||||
SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc_go.CallOption) (*SendMessageResponse, common.ErrorWithAttachment)
|
||||
GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc_go.CallOption) (*GetMessagesResponse, common.ErrorWithAttachment)
|
||||
// 评论相关 api
|
||||
PostComment(ctx context.Context, in *PostCommentRequest, opts ...grpc_go.CallOption) (*PostCommentResponse, common.ErrorWithAttachment)
|
||||
GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc_go.CallOption) (*GetCommentResponse, common.ErrorWithAttachment)
|
||||
DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc_go.CallOption) (*DeleteCommentResponse, common.ErrorWithAttachment)
|
||||
ReplyComment(ctx context.Context, in *ReplyCommentRequest, opts ...grpc_go.CallOption) (*ReplyCommentResponse, common.ErrorWithAttachment)
|
||||
// 分析相关 api
|
||||
GetPostAnalytics(ctx context.Context, in *GetPostAnalyticsRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment)
|
||||
GetPostAnalyticsBySocialID(ctx context.Context, in *GetPostAnalyticsBySocialIDRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment)
|
||||
GetSocialAnalytics(ctx context.Context, in *GetSocialAnalyticsRequest, opts ...grpc_go.CallOption) (*GetSocialAnalyticsResponse, common.ErrorWithAttachment)
|
||||
// Hashtags 相关 api
|
||||
AutoHashtags(ctx context.Context, in *AutoHashtagsRequest, opts ...grpc_go.CallOption) (*AutoHashtagsResponse, common.ErrorWithAttachment)
|
||||
CheckBannedHashtag(ctx context.Context, in *CheckBannedHashtagRequest, opts ...grpc_go.CallOption) (*CheckBannedHashtagResponse, common.ErrorWithAttachment)
|
||||
RecommendHashtags(ctx context.Context, in *RecommendHashtagsRequest, opts ...grpc_go.CallOption) (*RecommendHashtagsResponse, common.ErrorWithAttachment)
|
||||
SearchHashtags(ctx context.Context, in *SearchHashtagsRequest, opts ...grpc_go.CallOption) (*SearchHashtagsResponse, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type ayrshareClient struct {
|
||||
@ -44,12 +65,28 @@ type ayrshareClient struct {
|
||||
}
|
||||
|
||||
type AyrshareClientImpl struct {
|
||||
Post func(ctx context.Context, in *PostRequest) (*PostResponse, error)
|
||||
GetPost func(ctx context.Context, in *GetPostRequest) (*GetPostResponse, error)
|
||||
GetUser func(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error)
|
||||
CreateProfile func(ctx context.Context, in *CreateProfileRequest) (*CreateProfileResponse, error)
|
||||
GetProfiles func(ctx context.Context, in *GetProfilesRequest) (*GetProfilesResponse, error)
|
||||
GenerateJWT func(ctx context.Context, in *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
||||
Post func(ctx context.Context, in *PostRequest) (*PostResponse, error)
|
||||
GetPost func(ctx context.Context, in *GetPostRequest) (*GetPostResponse, error)
|
||||
GetUser func(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error)
|
||||
CreateProfile func(ctx context.Context, in *CreateProfileRequest) (*CreateProfileResponse, error)
|
||||
GetProfiles func(ctx context.Context, in *GetProfilesRequest) (*GetProfilesResponse, error)
|
||||
GenerateJWT func(ctx context.Context, in *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
||||
GetHistory func(ctx context.Context, in *GetHistoryRequest) (*GetHistoryResponse, error)
|
||||
GetHistoryById func(ctx context.Context, in *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error)
|
||||
GetHistoryByPlatform func(ctx context.Context, in *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error)
|
||||
SendMessage func(ctx context.Context, in *SendMessageRequest) (*SendMessageResponse, error)
|
||||
GetMessages func(ctx context.Context, in *GetMessagesRequest) (*GetMessagesResponse, error)
|
||||
PostComment func(ctx context.Context, in *PostCommentRequest) (*PostCommentResponse, error)
|
||||
GetComment func(ctx context.Context, in *GetCommentRequest) (*GetCommentResponse, error)
|
||||
DeleteComment func(ctx context.Context, in *DeleteCommentRequest) (*DeleteCommentResponse, error)
|
||||
ReplyComment func(ctx context.Context, in *ReplyCommentRequest) (*ReplyCommentResponse, error)
|
||||
GetPostAnalytics func(ctx context.Context, in *GetPostAnalyticsRequest) (*GetPostAnalyticsResponse, error)
|
||||
GetPostAnalyticsBySocialID func(ctx context.Context, in *GetPostAnalyticsBySocialIDRequest) (*GetPostAnalyticsResponse, error)
|
||||
GetSocialAnalytics func(ctx context.Context, in *GetSocialAnalyticsRequest) (*GetSocialAnalyticsResponse, error)
|
||||
AutoHashtags func(ctx context.Context, in *AutoHashtagsRequest) (*AutoHashtagsResponse, error)
|
||||
CheckBannedHashtag func(ctx context.Context, in *CheckBannedHashtagRequest) (*CheckBannedHashtagResponse, error)
|
||||
RecommendHashtags func(ctx context.Context, in *RecommendHashtagsRequest) (*RecommendHashtagsResponse, error)
|
||||
SearchHashtags func(ctx context.Context, in *SearchHashtagsRequest) (*SearchHashtagsResponse, error)
|
||||
}
|
||||
|
||||
func (c *AyrshareClientImpl) GetDubboStub(cc *triple.TripleConn) AyrshareClient {
|
||||
@ -100,6 +137,102 @@ func (c *ayrshareClient) GenerateJWT(ctx context.Context, in *GenerateJWTRequest
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GenerateJWT", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetHistoryResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetHistory", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetHistoryById(ctx context.Context, in *GetHistoryByIdRequest, opts ...grpc_go.CallOption) (*GetHistoryByIdResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetHistoryByIdResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetHistoryById", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetHistoryByPlatform(ctx context.Context, in *GetHistoryByPlatformRequest, opts ...grpc_go.CallOption) (*GetHistoryByPlatformResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetHistoryByPlatformResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetHistoryByPlatform", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc_go.CallOption) (*SendMessageResponse, common.ErrorWithAttachment) {
|
||||
out := new(SendMessageResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendMessage", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc_go.CallOption) (*GetMessagesResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetMessagesResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetMessages", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) PostComment(ctx context.Context, in *PostCommentRequest, opts ...grpc_go.CallOption) (*PostCommentResponse, common.ErrorWithAttachment) {
|
||||
out := new(PostCommentResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PostComment", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc_go.CallOption) (*GetCommentResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetCommentResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetComment", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc_go.CallOption) (*DeleteCommentResponse, common.ErrorWithAttachment) {
|
||||
out := new(DeleteCommentResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteComment", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) ReplyComment(ctx context.Context, in *ReplyCommentRequest, opts ...grpc_go.CallOption) (*ReplyCommentResponse, common.ErrorWithAttachment) {
|
||||
out := new(ReplyCommentResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ReplyComment", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetPostAnalytics(ctx context.Context, in *GetPostAnalyticsRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetPostAnalyticsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPostAnalytics", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetPostAnalyticsBySocialID(ctx context.Context, in *GetPostAnalyticsBySocialIDRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetPostAnalyticsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPostAnalyticsBySocialID", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) GetSocialAnalytics(ctx context.Context, in *GetSocialAnalyticsRequest, opts ...grpc_go.CallOption) (*GetSocialAnalyticsResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetSocialAnalyticsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetSocialAnalytics", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) AutoHashtags(ctx context.Context, in *AutoHashtagsRequest, opts ...grpc_go.CallOption) (*AutoHashtagsResponse, common.ErrorWithAttachment) {
|
||||
out := new(AutoHashtagsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AutoHashtags", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) CheckBannedHashtag(ctx context.Context, in *CheckBannedHashtagRequest, opts ...grpc_go.CallOption) (*CheckBannedHashtagResponse, common.ErrorWithAttachment) {
|
||||
out := new(CheckBannedHashtagResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CheckBannedHashtag", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) RecommendHashtags(ctx context.Context, in *RecommendHashtagsRequest, opts ...grpc_go.CallOption) (*RecommendHashtagsResponse, common.ErrorWithAttachment) {
|
||||
out := new(RecommendHashtagsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RecommendHashtags", in, out)
|
||||
}
|
||||
|
||||
func (c *ayrshareClient) SearchHashtags(ctx context.Context, in *SearchHashtagsRequest, opts ...grpc_go.CallOption) (*SearchHashtagsResponse, common.ErrorWithAttachment) {
|
||||
out := new(SearchHashtagsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SearchHashtags", in, out)
|
||||
}
|
||||
|
||||
// AyrshareServer is the server API for Ayrshare service.
|
||||
// All implementations must embed UnimplementedAyrshareServer
|
||||
// for forward compatibility
|
||||
@ -113,6 +246,27 @@ type AyrshareServer interface {
|
||||
CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error)
|
||||
GetProfiles(context.Context, *GetProfilesRequest) (*GetProfilesResponse, error)
|
||||
GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
||||
// 历史记录相关 api
|
||||
GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error)
|
||||
GetHistoryById(context.Context, *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error)
|
||||
GetHistoryByPlatform(context.Context, *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error)
|
||||
// 消息相关 api
|
||||
SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
|
||||
GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error)
|
||||
// 评论相关 api
|
||||
PostComment(context.Context, *PostCommentRequest) (*PostCommentResponse, error)
|
||||
GetComment(context.Context, *GetCommentRequest) (*GetCommentResponse, error)
|
||||
DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error)
|
||||
ReplyComment(context.Context, *ReplyCommentRequest) (*ReplyCommentResponse, error)
|
||||
// 分析相关 api
|
||||
GetPostAnalytics(context.Context, *GetPostAnalyticsRequest) (*GetPostAnalyticsResponse, error)
|
||||
GetPostAnalyticsBySocialID(context.Context, *GetPostAnalyticsBySocialIDRequest) (*GetPostAnalyticsResponse, error)
|
||||
GetSocialAnalytics(context.Context, *GetSocialAnalyticsRequest) (*GetSocialAnalyticsResponse, error)
|
||||
// Hashtags 相关 api
|
||||
AutoHashtags(context.Context, *AutoHashtagsRequest) (*AutoHashtagsResponse, error)
|
||||
CheckBannedHashtag(context.Context, *CheckBannedHashtagRequest) (*CheckBannedHashtagResponse, error)
|
||||
RecommendHashtags(context.Context, *RecommendHashtagsRequest) (*RecommendHashtagsResponse, error)
|
||||
SearchHashtags(context.Context, *SearchHashtagsRequest) (*SearchHashtagsResponse, error)
|
||||
mustEmbedUnimplementedAyrshareServer()
|
||||
}
|
||||
|
||||
@ -139,6 +293,54 @@ func (UnimplementedAyrshareServer) GetProfiles(context.Context, *GetProfilesRequ
|
||||
func (UnimplementedAyrshareServer) GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GenerateJWT not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHistory not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetHistoryById(context.Context, *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHistoryById not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetHistoryByPlatform(context.Context, *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHistoryByPlatform not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SendMessage not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMessages not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) PostComment(context.Context, *PostCommentRequest) (*PostCommentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PostComment not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetComment(context.Context, *GetCommentRequest) (*GetCommentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetComment not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) ReplyComment(context.Context, *ReplyCommentRequest) (*ReplyCommentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ReplyComment not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetPostAnalytics(context.Context, *GetPostAnalyticsRequest) (*GetPostAnalyticsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPostAnalytics not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetPostAnalyticsBySocialID(context.Context, *GetPostAnalyticsBySocialIDRequest) (*GetPostAnalyticsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPostAnalyticsBySocialID not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) GetSocialAnalytics(context.Context, *GetSocialAnalyticsRequest) (*GetSocialAnalyticsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSocialAnalytics not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) AutoHashtags(context.Context, *AutoHashtagsRequest) (*AutoHashtagsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AutoHashtags not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) CheckBannedHashtag(context.Context, *CheckBannedHashtagRequest) (*CheckBannedHashtagResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CheckBannedHashtag not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) RecommendHashtags(context.Context, *RecommendHashtagsRequest) (*RecommendHashtagsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RecommendHashtags not implemented")
|
||||
}
|
||||
func (UnimplementedAyrshareServer) SearchHashtags(context.Context, *SearchHashtagsRequest) (*SearchHashtagsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SearchHashtags not implemented")
|
||||
}
|
||||
func (s *UnimplementedAyrshareServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
@ -341,6 +543,470 @@ func _Ayrshare_GenerateJWT_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHistoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetHistory", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetHistoryById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHistoryByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetHistoryById", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetHistoryByPlatform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHistoryByPlatformRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetHistoryByPlatform", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendMessageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("SendMessage", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMessagesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetMessages", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_PostComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostCommentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("PostComment", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCommentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetComment", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_DeleteComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteCommentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("DeleteComment", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_ReplyComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReplyCommentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("ReplyComment", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetPostAnalytics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPostAnalyticsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetPostAnalytics", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetPostAnalyticsBySocialID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPostAnalyticsBySocialIDRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetPostAnalyticsBySocialID", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_GetSocialAnalytics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSocialAnalyticsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetSocialAnalytics", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_AutoHashtags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AutoHashtagsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("AutoHashtags", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_CheckBannedHashtag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckBannedHashtagRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("CheckBannedHashtag", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_RecommendHashtags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecommendHashtagsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("RecommendHashtags", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Ayrshare_SearchHashtags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SearchHashtagsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("SearchHashtags", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Ayrshare_ServiceDesc is the grpc_go.ServiceDesc for Ayrshare service.
|
||||
// It's only intended for direct use with grpc_go.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -372,6 +1038,70 @@ var Ayrshare_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "GenerateJWT",
|
||||
Handler: _Ayrshare_GenerateJWT_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetHistory",
|
||||
Handler: _Ayrshare_GetHistory_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetHistoryById",
|
||||
Handler: _Ayrshare_GetHistoryById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetHistoryByPlatform",
|
||||
Handler: _Ayrshare_GetHistoryByPlatform_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendMessage",
|
||||
Handler: _Ayrshare_SendMessage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMessages",
|
||||
Handler: _Ayrshare_GetMessages_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PostComment",
|
||||
Handler: _Ayrshare_PostComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetComment",
|
||||
Handler: _Ayrshare_GetComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteComment",
|
||||
Handler: _Ayrshare_DeleteComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ReplyComment",
|
||||
Handler: _Ayrshare_ReplyComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPostAnalytics",
|
||||
Handler: _Ayrshare_GetPostAnalytics_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPostAnalyticsBySocialID",
|
||||
Handler: _Ayrshare_GetPostAnalyticsBySocialID_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSocialAnalytics",
|
||||
Handler: _Ayrshare_GetSocialAnalytics_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AutoHashtags",
|
||||
Handler: _Ayrshare_AutoHashtags_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckBannedHashtag",
|
||||
Handler: _Ayrshare_CheckBannedHashtag_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecommendHashtags",
|
||||
Handler: _Ayrshare_RecommendHashtags_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SearchHashtags",
|
||||
Handler: _Ayrshare_SearchHashtags_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/ayrshare.proto",
|
||||
|
||||
1819
api/cast/cast.pb.go
1819
api/cast/cast.pb.go
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,108 @@ var (
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on AsInfo with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *AsInfo) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on AsInfo with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the result is
|
||||
// a list of violation errors wrapped in AsInfoMultiError, or nil if none found.
|
||||
func (m *AsInfo) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *AsInfo) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ProfileKey
|
||||
|
||||
// no validation rules for AsID
|
||||
|
||||
if len(errors) > 0 {
|
||||
return AsInfoMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// AsInfoMultiError is an error wrapping multiple validation errors returned by
|
||||
// AsInfo.ValidateAll() if the designated constraints aren't met.
|
||||
type AsInfoMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m AsInfoMultiError) Error() string {
|
||||
msgs := make([]string, 0, len(m))
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m AsInfoMultiError) AllErrors() []error { return m }
|
||||
|
||||
// AsInfoValidationError is the validation error returned by AsInfo.Validate if
|
||||
// the designated constraints aren't met.
|
||||
type AsInfoValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e AsInfoValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e AsInfoValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e AsInfoValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e AsInfoValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e AsInfoValidationError) ErrorName() string { return "AsInfoValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e AsInfoValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sAsInfo.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = AsInfoValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = AsInfoValidationError{}
|
||||
|
||||
// Validate checks the field values on MediaUserListReq with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
@ -81,6 +183,8 @@ func (m *MediaUserListReq) validate(all bool) error {
|
||||
|
||||
// no validation rules for NeedStats
|
||||
|
||||
// no validation rules for NeedAsInfo
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MediaUserListReqMultiError(errors)
|
||||
}
|
||||
@ -213,6 +317,35 @@ func (m *MediaUserInfo) validate(all bool) error {
|
||||
|
||||
// no validation rules for ReleasedPostTotal
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetAsInfo()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, MediaUserInfoValidationError{
|
||||
field: "AsInfo",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, MediaUserInfoValidationError{
|
||||
field: "AsInfo",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetAsInfo()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return MediaUserInfoValidationError{
|
||||
field: "AsInfo",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MediaUserInfoMultiError(errors)
|
||||
}
|
||||
@ -2017,6 +2150,243 @@ var _ interface {
|
||||
ErrorName() string
|
||||
} = MediaInfoRespValidationError{}
|
||||
|
||||
// Validate checks the field values on MediaInfoByPlatformReq with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *MediaInfoByPlatformReq) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on MediaInfoByPlatformReq with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// MediaInfoByPlatformReqMultiError, or nil if none found.
|
||||
func (m *MediaInfoByPlatformReq) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *MediaInfoByPlatformReq) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ArtistUuid
|
||||
|
||||
// no validation rules for PlatformID
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MediaInfoByPlatformReqMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MediaInfoByPlatformReqMultiError is an error wrapping multiple validation
|
||||
// errors returned by MediaInfoByPlatformReq.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type MediaInfoByPlatformReqMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m MediaInfoByPlatformReqMultiError) Error() string {
|
||||
msgs := make([]string, 0, len(m))
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m MediaInfoByPlatformReqMultiError) AllErrors() []error { return m }
|
||||
|
||||
// MediaInfoByPlatformReqValidationError is the validation error returned by
|
||||
// MediaInfoByPlatformReq.Validate if the designated constraints aren't met.
|
||||
type MediaInfoByPlatformReqValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e MediaInfoByPlatformReqValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e MediaInfoByPlatformReqValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e MediaInfoByPlatformReqValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e MediaInfoByPlatformReqValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e MediaInfoByPlatformReqValidationError) ErrorName() string {
|
||||
return "MediaInfoByPlatformReqValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e MediaInfoByPlatformReqValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sMediaInfoByPlatformReq.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = MediaInfoByPlatformReqValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = MediaInfoByPlatformReqValidationError{}
|
||||
|
||||
// Validate checks the field values on MediaInfoByPlatformResp with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *MediaInfoByPlatformResp) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on MediaInfoByPlatformResp with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// MediaInfoByPlatformRespMultiError, or nil if none found.
|
||||
func (m *MediaInfoByPlatformResp) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *MediaInfoByPlatformResp) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetInfo()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, MediaInfoByPlatformRespValidationError{
|
||||
field: "Info",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, MediaInfoByPlatformRespValidationError{
|
||||
field: "Info",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetInfo()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return MediaInfoByPlatformRespValidationError{
|
||||
field: "Info",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MediaInfoByPlatformRespMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MediaInfoByPlatformRespMultiError is an error wrapping multiple validation
|
||||
// errors returned by MediaInfoByPlatformResp.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type MediaInfoByPlatformRespMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m MediaInfoByPlatformRespMultiError) Error() string {
|
||||
msgs := make([]string, 0, len(m))
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m MediaInfoByPlatformRespMultiError) AllErrors() []error { return m }
|
||||
|
||||
// MediaInfoByPlatformRespValidationError is the validation error returned by
|
||||
// MediaInfoByPlatformResp.Validate if the designated constraints aren't met.
|
||||
type MediaInfoByPlatformRespValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e MediaInfoByPlatformRespValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e MediaInfoByPlatformRespValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e MediaInfoByPlatformRespValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e MediaInfoByPlatformRespValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e MediaInfoByPlatformRespValidationError) ErrorName() string {
|
||||
return "MediaInfoByPlatformRespValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e MediaInfoByPlatformRespValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sMediaInfoByPlatformResp.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = MediaInfoByPlatformRespValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = MediaInfoByPlatformRespValidationError{}
|
||||
|
||||
// Validate checks the field values on WorkListReq with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
@ -4304,6 +4674,10 @@ func (m *ArtistInfoResp) validate(all bool) error {
|
||||
|
||||
// no validation rules for DMEffectiveCount
|
||||
|
||||
// no validation rules for ProfileKey
|
||||
|
||||
// no validation rules for SubNum
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ArtistInfoRespMultiError(errors)
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ type CastClient interface {
|
||||
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
||||
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
||||
MediaInfo(ctx context.Context, in *MediaInfoReq, opts ...grpc_go.CallOption) (*MediaInfoResp, common.ErrorWithAttachment)
|
||||
MediaInfoByPlatform(ctx context.Context, in *MediaInfoByPlatformReq, opts ...grpc_go.CallOption) (*MediaInfoByPlatformResp, common.ErrorWithAttachment)
|
||||
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
||||
WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment)
|
||||
UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||
@ -114,6 +115,7 @@ type CastClientImpl struct {
|
||||
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||
MediaInfo func(ctx context.Context, in *MediaInfoReq) (*MediaInfoResp, error)
|
||||
MediaInfoByPlatform func(ctx context.Context, in *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error)
|
||||
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
||||
WorkDetail func(ctx context.Context, in *WorkDetailReq) (*WorkDetailResp, error)
|
||||
UpdateStatus func(ctx context.Context, in *UpdateStatusReq) (*emptypb.Empty, error)
|
||||
@ -224,6 +226,12 @@ func (c *castClient) MediaInfo(ctx context.Context, in *MediaInfoReq, opts ...gr
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaInfo", in, out)
|
||||
}
|
||||
|
||||
func (c *castClient) MediaInfoByPlatform(ctx context.Context, in *MediaInfoByPlatformReq, opts ...grpc_go.CallOption) (*MediaInfoByPlatformResp, common.ErrorWithAttachment) {
|
||||
out := new(MediaInfoByPlatformResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaInfoByPlatform", in, out)
|
||||
}
|
||||
|
||||
func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment) {
|
||||
out := new(WorkListResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -559,6 +567,7 @@ type CastServer interface {
|
||||
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||
MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error)
|
||||
MediaInfoByPlatform(context.Context, *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error)
|
||||
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
||||
WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error)
|
||||
UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error)
|
||||
@ -652,6 +661,9 @@ func (UnimplementedCastServer) UpdateWorkVideo(context.Context, *UpdateWorkVideo
|
||||
func (UnimplementedCastServer) MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method MediaInfo not implemented")
|
||||
}
|
||||
func (UnimplementedCastServer) MediaInfoByPlatform(context.Context, *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method MediaInfoByPlatform not implemented")
|
||||
}
|
||||
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
||||
}
|
||||
@ -1045,6 +1057,35 @@ func _Cast_MediaInfo_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Cast_MediaInfoByPlatform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MediaInfoByPlatformReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("MediaInfoByPlatform", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Cast_WorkList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(WorkListReq)
|
||||
if err := dec(in); err != nil {
|
||||
@ -2646,6 +2687,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "MediaInfo",
|
||||
Handler: _Cast_MediaInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "MediaInfoByPlatform",
|
||||
Handler: _Cast_MediaInfoByPlatform_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "WorkList",
|
||||
Handler: _Cast_WorkList_Handler,
|
||||
|
||||
@ -1 +1,28 @@
|
||||
package cast
|
||||
|
||||
type SendMessageReq struct {
|
||||
MediaUserID string `json:"mediaUserId"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type PostCommentReq struct {
|
||||
PublishMediaID string `json:"publishMediaID"`
|
||||
Comment string `json:"comment"`
|
||||
PlatformID int `json:"platformID"`
|
||||
ArtistUuid string `json:"artistUuid"`
|
||||
}
|
||||
type GetCommentReq struct {
|
||||
ArtistUuid string `json:"artistUuid"`
|
||||
PublishMediaID string `json:"publishMediaID"`
|
||||
}
|
||||
type DeleteCommentReq struct {
|
||||
ArtistUuid string `json:"artistUuid"`
|
||||
CommentId string `json:"commentId"`
|
||||
PlatformID int `json:"platformID"`
|
||||
}
|
||||
type ReplyCommentReq struct {
|
||||
ArtistUuid string `json:"artistUuid"`
|
||||
CommentId string `json:"commentId"`
|
||||
Comment string `json:"comment"`
|
||||
PlatformID int `json:"platformID"`
|
||||
}
|
||||
|
||||
@ -89,4 +89,13 @@ func MediaRouter(r *gin.RouterGroup) {
|
||||
{
|
||||
social.GET("tiktok-redirect", serviceCast.TikTokRedirect)
|
||||
}
|
||||
interact := auth.Group("interact")
|
||||
{
|
||||
interact.POST("send-message", serviceCast.SendMessage)
|
||||
interact.POST("get-message", serviceCast.GetMessage)
|
||||
interact.POST("post-comment", serviceCast.PostComment)
|
||||
interact.POST("get-comment", serviceCast.GetComment)
|
||||
interact.POST("delete-comment", serviceCast.DeleteComment)
|
||||
interact.POST("replay-comment", serviceCast.ReplyComment)
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,10 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fonchain-fiee/api/aryshare"
|
||||
"fonchain-fiee/api/cast"
|
||||
modelCast "fonchain-fiee/pkg/model/cast"
|
||||
"fonchain-fiee/pkg/service"
|
||||
"fonchain-fiee/pkg/utils"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
@ -14,6 +18,7 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -313,3 +318,210 @@ func VerifyMediaURL(ctx context.Context, mediaURL string) (bool, error) {
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func SendMessage(ctx *gin.Context) {
|
||||
var req modelCast.SendMessageReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
mediaUserInfo, err := GetMediaInfo(req.MediaUserID)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
var platformName = modelCast.PlatformNameKv[mediaUserInfo.PlatformID]
|
||||
if platformName != "facebook" && platformName != "instagram" && platformName != "twitter" {
|
||||
service.Error(ctx, errors.New("不支持的媒体"))
|
||||
return
|
||||
}
|
||||
sendResp, err := service.AyrshareProvider.SendMessage(context.Background(), &aryshare.SendMessageRequest{
|
||||
Platform: platformName,
|
||||
RecipientId: mediaUserInfo.AsInfo.AsID,
|
||||
Message: req.Message,
|
||||
MediaUrls: []string{},
|
||||
ProfileKey: mediaUserInfo.AsInfo.ProfileKey,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("发送消息失败", zap.Error(err), zap.Any("mediaInfo", mediaUserInfo))
|
||||
service.Error(ctx, errors.New("发送消息异常"))
|
||||
return
|
||||
}
|
||||
if sendResp.Status != "success" {
|
||||
zap.L().Error("发送消息失败", zap.Any("sendResp", sendResp))
|
||||
service.Error(ctx, errors.New("发送消息失败"))
|
||||
return
|
||||
}
|
||||
service.Success(ctx, sendResp)
|
||||
return
|
||||
}
|
||||
|
||||
func GetMessage(ctx *gin.Context) {
|
||||
var req modelCast.SendMessageReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
mediaUserInfo, err := GetMediaInfo(req.MediaUserID)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
var platformName = modelCast.PlatformNameKv[mediaUserInfo.PlatformID]
|
||||
messageResp, err := service.AyrshareProvider.GetMessages(context.Background(), &aryshare.GetMessagesRequest{
|
||||
Platform: platformName,
|
||||
Status: "active", // active 主动 archived 已存档
|
||||
ConversationId: "",
|
||||
ConversationsOnly: false,
|
||||
ProfileKey: mediaUserInfo.AsInfo.ProfileKey,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("获取消息失败", zap.Error(err), zap.Any("mediaInfo", mediaUserInfo))
|
||||
service.Error(ctx, errors.New("获取消息异常"))
|
||||
return
|
||||
}
|
||||
if messageResp.Status != "success" {
|
||||
zap.L().Error("获取消息失败", zap.Any("messageResp", messageResp))
|
||||
service.Error(ctx, errors.New("获取消息失败"))
|
||||
return
|
||||
}
|
||||
service.Success(ctx, messageResp)
|
||||
return
|
||||
}
|
||||
|
||||
// GetMediaInfo 根据自媒体ID查询信息
|
||||
func GetMediaInfo(mediaUserID string) (*cast.MediaUserInfo, error) {
|
||||
userListResp, err := service.CastProvider.MediaUserList(context.Background(), &cast.MediaUserListReq{
|
||||
MediaUserID: mediaUserID,
|
||||
NeedAsInfo: true,
|
||||
PageSize: 1,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if userListResp == nil || len(userListResp.Data) == 0 {
|
||||
return nil, errors.New("未找到该自媒体")
|
||||
}
|
||||
return userListResp.Data[0], nil
|
||||
}
|
||||
|
||||
func PostComment(ctx *gin.Context) {
|
||||
var req modelCast.PostCommentReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||
ArtistUuid: req.ArtistUuid,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
commentResp, err := service.AyrshareProvider.PostComment(context.Background(), &aryshare.PostCommentRequest{
|
||||
Id: req.PublishMediaID,
|
||||
Comment: req.Comment,
|
||||
Platforms: []string{modelCast.PlatformNameKv[uint32(req.PlatformID)]},
|
||||
SearchPlatformId: true,
|
||||
MediaUrls: nil,
|
||||
ProfileKey: artistInfo.ProfileKey,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("发布评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||
service.Error(ctx, errors.New("发布评论异常"))
|
||||
return
|
||||
}
|
||||
if commentResp.Status != "success" {
|
||||
service.Error(ctx, errors.New("发布评论失败"))
|
||||
return
|
||||
}
|
||||
service.Success(ctx, commentResp)
|
||||
return
|
||||
}
|
||||
|
||||
func GetComment(ctx *gin.Context) {
|
||||
var req modelCast.GetCommentReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||
ArtistUuid: req.ArtistUuid,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
commentResp, err := service.AyrshareProvider.GetComment(context.Background(), &aryshare.GetCommentRequest{
|
||||
Id: req.PublishMediaID,
|
||||
ProfileKey: artistInfo.ProfileKey,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
service.Success(ctx, commentResp)
|
||||
return
|
||||
}
|
||||
|
||||
func DeleteComment(ctx *gin.Context) {
|
||||
var req modelCast.DeleteCommentReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||
ArtistUuid: req.ArtistUuid,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
commentResp, err := service.AyrshareProvider.DeleteComment(context.Background(), &aryshare.DeleteCommentRequest{
|
||||
Id: req.CommentId,
|
||||
Platforms: nil,
|
||||
Platform: modelCast.PlatformNameKv[uint32(req.PlatformID)],
|
||||
SearchPlatformId: true,
|
||||
ProfileKey: artistInfo.ProfileKey,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("删除评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||
service.Error(ctx, errors.New("删除评论异常"))
|
||||
return
|
||||
}
|
||||
if commentResp.Status != "success" {
|
||||
service.Error(ctx, errors.New("删除评论失败"))
|
||||
return
|
||||
}
|
||||
service.Success(ctx, commentResp)
|
||||
return
|
||||
}
|
||||
|
||||
func ReplyComment(ctx *gin.Context) {
|
||||
var req modelCast.ReplyCommentReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||
ArtistUuid: req.ArtistUuid,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
commentResp, err := service.AyrshareProvider.ReplyComment(context.Background(), &aryshare.ReplyCommentRequest{
|
||||
Id: req.CommentId,
|
||||
Comment: req.Comment,
|
||||
Platforms: []string{modelCast.PlatformNameKv[uint32(req.PlatformID)]},
|
||||
ProfileKey: artistInfo.ProfileKey,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("回复评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||
service.Error(ctx, errors.New("回复评论异常"))
|
||||
return
|
||||
}
|
||||
service.Success(ctx, commentResp)
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user