|
|
@ -58,22 +58,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.UnfollowTopicReq)
|
|
|
|
req := new(web.UnfollowTopicReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.UnfollowTopic(req))
|
|
|
|
s.Render(c, nil, s.UnfollowTopic(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/topic/follow", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/topic/follow", func(c *gin.Context) {
|
|
|
@ -83,22 +72,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.FollowTopicReq)
|
|
|
|
req := new(web.FollowTopicReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.FollowTopic(req))
|
|
|
|
s.Render(c, nil, s.FollowTopic(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/topic/stick", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/topic/stick", func(c *gin.Context) {
|
|
|
@ -108,31 +86,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.StickTopicReq)
|
|
|
|
req := new(web.StickTopicReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj, err = s.StickTopic(req)
|
|
|
|
resp, err := s.StickTopic(req)
|
|
|
|
if err != nil {
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
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) {
|
|
|
|
router.Handle("POST", "/tweet/reply/thumbsdown", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -141,22 +101,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.TweetReplyThumbsReq)
|
|
|
|
req := new(web.TweetReplyThumbsReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.ThumbsDownTweetReply(req))
|
|
|
|
s.Render(c, nil, s.ThumbsDownTweetReply(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/tweet/reply/thumbsup", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/tweet/reply/thumbsup", func(c *gin.Context) {
|
|
|
@ -166,22 +115,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.TweetReplyThumbsReq)
|
|
|
|
req := new(web.TweetReplyThumbsReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.ThumbsUpTweetReply(req))
|
|
|
|
s.Render(c, nil, s.ThumbsUpTweetReply(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/tweet/comment/thumbsdown", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/tweet/comment/thumbsdown", func(c *gin.Context) {
|
|
|
@ -191,22 +129,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.TweetCommentThumbsReq)
|
|
|
|
req := new(web.TweetCommentThumbsReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.ThumbsDownTweetComment(req))
|
|
|
|
s.Render(c, nil, s.ThumbsDownTweetComment(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/tweet/comment/thumbsup", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/tweet/comment/thumbsup", func(c *gin.Context) {
|
|
|
@ -216,22 +143,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.TweetCommentThumbsReq)
|
|
|
|
req := new(web.TweetCommentThumbsReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.ThumbsUpTweetComment(req))
|
|
|
|
s.Render(c, nil, s.ThumbsUpTweetComment(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("DELETE", "/post/comment/reply", func(c *gin.Context) {
|
|
|
|
router.Handle("DELETE", "/post/comment/reply", func(c *gin.Context) {
|
|
|
@ -241,22 +157,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.DeleteCommentReplyReq)
|
|
|
|
req := new(web.DeleteCommentReplyReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.DeleteCommentReply(req))
|
|
|
|
s.Render(c, nil, s.DeleteCommentReply(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/comment/reply", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/comment/reply", func(c *gin.Context) {
|
|
|
@ -266,31 +171,14 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.CreateCommentReplyReq)
|
|
|
|
req := new(web.CreateCommentReplyReq)
|
|
|
|
obj = req
|
|
|
|
var bv _binding_ = req
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
if err := bv.Bind(c); err != nil {
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj, err = s.CreateCommentReply(req)
|
|
|
|
resp, err := s.CreateCommentReply(req)
|
|
|
|
if err != nil {
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
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) {
|
|
|
|
router.Handle("DELETE", "/post/comment", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -299,22 +187,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.DeleteCommentReq)
|
|
|
|
req := new(web.DeleteCommentReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.DeleteComment(req))
|
|
|
|
s.Render(c, nil, s.DeleteComment(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/comment", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/comment", func(c *gin.Context) {
|
|
|
@ -324,31 +201,14 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.CreateCommentReq)
|
|
|
|
req := new(web.CreateCommentReq)
|
|
|
|
obj = req
|
|
|
|
var bv _binding_ = req
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
if err := bv.Bind(c); err != nil {
|
|
|
|
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)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
resp, err := s.CreateComment(req)
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/visibility", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/visibility", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -357,31 +217,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.VisibleTweetReq)
|
|
|
|
req := new(web.VisibleTweetReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
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)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
resp, err := s.VisibleTweet(req)
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/stick", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/stick", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -390,31 +232,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.StickTweetReq)
|
|
|
|
req := new(web.StickTweetReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
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)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
resp, err := s.StickTweet(req)
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/lock", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/lock", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -423,31 +247,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.LockTweetReq)
|
|
|
|
req := new(web.LockTweetReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
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)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
resp, err := s.LockTweet(req)
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/collection", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/collection", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -456,31 +262,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.CollectionTweetReq)
|
|
|
|
req := new(web.CollectionTweetReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
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)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
resp, err := s.CollectionTweet(req)
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post/star", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post/star", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -489,31 +277,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.StarTweetReq)
|
|
|
|
req := new(web.StarTweetReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
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)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
resp, err := s.StarTweet(req)
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("DELETE", "/post", func(c *gin.Context) {
|
|
|
|
router.Handle("DELETE", "/post", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -522,22 +292,11 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.DeleteTweetReq)
|
|
|
|
req := new(web.DeleteTweetReq)
|
|
|
|
obj = req
|
|
|
|
if err := s.Bind(c, req); err != nil {
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s.Render(c, nil, s.DeleteTweet(req))
|
|
|
|
s.Render(c, nil, s.DeleteTweet(req))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
router.Handle("POST", "/post", func(c *gin.Context) {
|
|
|
|
router.Handle("POST", "/post", func(c *gin.Context) {
|
|
|
@ -547,31 +306,14 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.CreateTweetReq)
|
|
|
|
req := new(web.CreateTweetReq)
|
|
|
|
obj = req
|
|
|
|
var bv _binding_ = req
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
if err := bv.Bind(c); err != nil {
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj, err = s.CreateTweet(req)
|
|
|
|
resp, err := s.CreateTweet(req)
|
|
|
|
if err != nil {
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
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) {
|
|
|
|
router.Handle("GET", "/attachment", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -580,31 +322,14 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.DownloadAttachmentReq)
|
|
|
|
req := new(web.DownloadAttachmentReq)
|
|
|
|
obj = req
|
|
|
|
var bv _binding_ = req
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
if err := bv.Bind(c); err != nil {
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj, err = s.DownloadAttachment(req)
|
|
|
|
resp, err := s.DownloadAttachment(req)
|
|
|
|
if err != nil {
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
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) {
|
|
|
|
router.Handle("GET", "/attachment/precheck", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -613,31 +338,14 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.DownloadAttachmentPrecheckReq)
|
|
|
|
req := new(web.DownloadAttachmentPrecheckReq)
|
|
|
|
obj = req
|
|
|
|
var bv _binding_ = req
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
if err := bv.Bind(c); err != nil {
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj, err = s.DownloadAttachmentPrecheck(req)
|
|
|
|
resp, err := s.DownloadAttachmentPrecheck(req)
|
|
|
|
if err != nil {
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
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) {
|
|
|
|
router.Handle("POST", "/attachment", func(c *gin.Context) {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -646,31 +354,14 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
obj any
|
|
|
|
|
|
|
|
err mir.Error
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
req := new(web.UploadAttachmentReq)
|
|
|
|
req := new(web.UploadAttachmentReq)
|
|
|
|
obj = req
|
|
|
|
var bv _binding_ = req
|
|
|
|
if bv, ok := obj.(_binding_); !ok {
|
|
|
|
if err := bv.Bind(c); err != nil {
|
|
|
|
err = s.Bind(c, req)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
err = bv.Bind(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj, err = s.UploadAttachment(req)
|
|
|
|
resp, err := s.UploadAttachment(req)
|
|
|
|
if err != nil {
|
|
|
|
s.Render(c, resp, err)
|
|
|
|
s.Render(c, nil, err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if rv, ok := obj.(_render_); !ok {
|
|
|
|
|
|
|
|
s.Render(c, obj, nil)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rv.Render(c)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|