mirror of
https://github.com/go-shiori/shiori.git
synced 2025-01-15 12:27:43 +08:00
chore: comment unused functions
This commit is contained in:
parent
f16dd42e10
commit
1d58455b53
1 changed files with 29 additions and 29 deletions
|
@ -27,42 +27,42 @@ func (r *BookmarkRoutes) Setup(group *gin.RouterGroup) model.Routes {
|
|||
return r
|
||||
}
|
||||
|
||||
func (r *BookmarkRoutes) bookmarkContentHandler(c *gin.Context) {
|
||||
ctx := context.NewContextFromGin(c)
|
||||
// func (r *BookmarkRoutes) bookmarkContentHandler(c *gin.Context) {
|
||||
// ctx := context.NewContextFromGin(c)
|
||||
|
||||
bookmarkIDParam, present := c.Params.Get("id")
|
||||
if !present {
|
||||
response.SendError(c, 400, "Invalid bookmark ID")
|
||||
return
|
||||
}
|
||||
// bookmarkIDParam, present := c.Params.Get("id")
|
||||
// if !present {
|
||||
// response.SendError(c, 400, "Invalid bookmark ID")
|
||||
// return
|
||||
// }
|
||||
|
||||
bookmarkID, err := strconv.Atoi(bookmarkIDParam)
|
||||
if err != nil {
|
||||
r.logger.WithError(err).Error("error parsing bookmark ID parameter")
|
||||
response.SendInternalServerError(c)
|
||||
return
|
||||
}
|
||||
// bookmarkID, err := strconv.Atoi(bookmarkIDParam)
|
||||
// if err != nil {
|
||||
// r.logger.WithError(err).Error("error parsing bookmark ID parameter")
|
||||
// response.SendInternalServerError(c)
|
||||
// return
|
||||
// }
|
||||
|
||||
if bookmarkID == 0 {
|
||||
response.SendError(c, 404, nil)
|
||||
return
|
||||
}
|
||||
// if bookmarkID == 0 {
|
||||
// response.SendError(c, 404, nil)
|
||||
// return
|
||||
// }
|
||||
|
||||
bookmark, found, err := r.deps.Database.GetBookmark(c, bookmarkID, "")
|
||||
if err != nil || !found {
|
||||
response.SendError(c, 404, nil)
|
||||
return
|
||||
}
|
||||
// bookmark, found, err := r.deps.Database.GetBookmark(c, bookmarkID, "")
|
||||
// if err != nil || !found {
|
||||
// response.SendError(c, 404, nil)
|
||||
// return
|
||||
// }
|
||||
|
||||
if bookmark.Public != 1 && !ctx.UserIsLogged() {
|
||||
response.SendError(c, http.StatusForbidden, nil)
|
||||
return
|
||||
}
|
||||
// if bookmark.Public != 1 && !ctx.UserIsLogged() {
|
||||
// response.SendError(c, http.StatusForbidden, nil)
|
||||
// return
|
||||
// }
|
||||
|
||||
response.Send(c, 200, bookmark.Content)
|
||||
}
|
||||
// response.Send(c, 200, bookmark.Content)
|
||||
// }
|
||||
|
||||
func (r *BookmarkRoutes) bookmarkArchiveHandler(c *gin.Context) {}
|
||||
// func (r *BookmarkRoutes) bookmarkArchiveHandler(c *gin.Context) {}
|
||||
|
||||
func NewBookmarkRoutes(logger *logrus.Logger, deps *config.Dependencies) *BookmarkRoutes {
|
||||
return &BookmarkRoutes{
|
||||
|
|
Loading…
Reference in a new issue