// Code generated by go-mir. DO NOT EDIT. // versions: // - mir v4.0.0 package v1 import ( "net/http" "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Priv interface { _default_ // Chain provide handlers chain for gin Chain() gin.HandlersChain UnfollowTopic(*web.UnfollowTopicReq) mir.Error FollowTopic(*web.FollowTopicReq) mir.Error StickTopic(*web.StickTopicReq) (*web.StickTopicResp, mir.Error) ThumbsDownTweetReply(*web.TweetReplyThumbsReq) mir.Error ThumbsUpTweetReply(*web.TweetReplyThumbsReq) mir.Error ThumbsDownTweetComment(*web.TweetCommentThumbsReq) mir.Error ThumbsUpTweetComment(*web.TweetCommentThumbsReq) mir.Error DeleteCommentReply(*web.DeleteCommentReplyReq) mir.Error CreateCommentReply(*web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error) DeleteComment(*web.DeleteCommentReq) mir.Error CreateComment(*web.CreateCommentReq) (*web.CreateCommentResp, mir.Error) VisibleTweet(*web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error) StickTweet(*web.StickTweetReq) (*web.StickTweetResp, mir.Error) LockTweet(*web.LockTweetReq) (*web.LockTweetResp, mir.Error) CollectionTweet(*web.CollectionTweetReq) (*web.CollectionTweetResp, mir.Error) StarTweet(*web.StarTweetReq) (*web.StarTweetResp, mir.Error) DeleteTweet(*web.DeleteTweetReq) mir.Error CreateTweet(*web.CreateTweetReq) (*web.CreateTweetResp, mir.Error) DownloadAttachment(*web.DownloadAttachmentReq) (*web.DownloadAttachmentResp, mir.Error) DownloadAttachmentPrecheck(*web.DownloadAttachmentPrecheckReq) (*web.DownloadAttachmentPrecheckResp, mir.Error) UploadAttachment(*web.UploadAttachmentReq) (*web.UploadAttachmentResp, mir.Error) mustEmbedUnimplementedPrivServant() } // RegisterPrivServant register Priv servant to gin func RegisterPrivServant(e *gin.Engine, s Priv) { router := e.Group("v1") // use chain for router middlewares := s.Chain() router.Use(middlewares...) // register routes info to router router.Handle("POST", "/topic/unfollow", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.UnfollowTopicReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.UnfollowTopic(req)) }) router.Handle("POST", "/topic/follow", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.FollowTopicReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.FollowTopic(req)) }) router.Handle("POST", "/topic/stick", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.StickTopicReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.StickTopic(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/tweet/reply/thumbsdown", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.TweetReplyThumbsReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.ThumbsDownTweetReply(req)) }) router.Handle("POST", "/tweet/reply/thumbsup", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.TweetReplyThumbsReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.ThumbsUpTweetReply(req)) }) router.Handle("POST", "/tweet/comment/thumbsdown", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.TweetCommentThumbsReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.ThumbsDownTweetComment(req)) }) router.Handle("POST", "/tweet/comment/thumbsup", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.TweetCommentThumbsReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.ThumbsUpTweetComment(req)) }) router.Handle("DELETE", "/post/comment/reply", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.DeleteCommentReplyReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.DeleteCommentReply(req)) }) router.Handle("POST", "/post/comment/reply", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.CreateCommentReplyReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.CreateCommentReply(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("DELETE", "/post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.DeleteCommentReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.DeleteComment(req)) }) router.Handle("POST", "/post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.CreateCommentReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.CreateComment(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/post/visibility", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.VisibleTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.VisibleTweet(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/post/stick", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.StickTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.StickTweet(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/post/lock", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.LockTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.LockTweet(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/post/collection", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.CollectionTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.CollectionTweet(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/post/star", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.StarTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.StarTweet(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("DELETE", "/post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.DeleteTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } s.Render(c, nil, s.DeleteTweet(req)) }) router.Handle("POST", "/post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.CreateTweetReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.CreateTweet(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("GET", "/attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.DownloadAttachmentReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.DownloadAttachment(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("GET", "/attachment/precheck", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.DownloadAttachmentPrecheckReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.DownloadAttachmentPrecheck(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) router.Handle("POST", "/attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } var ( obj any err mir.Error ) req := new(web.UploadAttachmentReq) obj = req if bv, ok := obj.(_binding_); !ok { err = s.Bind(c, req) } else { err = bv.Bind(c) } if err != nil { s.Render(c, nil, err) return } obj, err = s.UploadAttachment(req) if err != nil { s.Render(c, nil, err) return } if rv, ok := obj.(_render_); !ok { s.Render(c, obj, nil) } else { rv.Render(c) } }) } // UnimplementedPrivServant can be embedded to have forward compatible implementations. type UnimplementedPrivServant struct{} func (UnimplementedPrivServant) Chain() gin.HandlersChain { return nil } func (UnimplementedPrivServant) UnfollowTopic(req *web.UnfollowTopicReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) FollowTopic(req *web.FollowTopicReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) StickTopic(req *web.StickTopicReq) (*web.StickTopicResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) ThumbsDownTweetReply(req *web.TweetReplyThumbsReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) ThumbsUpTweetReply(req *web.TweetReplyThumbsReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) ThumbsDownTweetComment(req *web.TweetCommentThumbsReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) ThumbsUpTweetComment(req *web.TweetCommentThumbsReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) DeleteCommentReply(req *web.DeleteCommentReplyReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) DeleteComment(req *web.DeleteCommentReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) CreateComment(req *web.CreateCommentReq) (*web.CreateCommentResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) VisibleTweet(req *web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) LockTweet(req *web.LockTweetReq) (*web.LockTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) CollectionTweet(req *web.CollectionTweetReq) (*web.CollectionTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) StarTweet(req *web.StarTweetReq) (*web.StarTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) DeleteTweet(req *web.DeleteTweetReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) CreateTweet(req *web.CreateTweetReq) (*web.CreateTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) DownloadAttachment(req *web.DownloadAttachmentReq) (*web.DownloadAttachmentResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) DownloadAttachmentPrecheck(req *web.DownloadAttachmentPrecheckReq) (*web.DownloadAttachmentPrecheckResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) UploadAttachment(req *web.UploadAttachmentReq) (*web.UploadAttachmentResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedPrivServant) mustEmbedUnimplementedPrivServant() {}