feat: add /api/tag (#82)

This commit is contained in:
Steven
2022-06-21 21:58:33 +08:00
committed by GitHub
parent cc54be0d1d
commit 9f81362027
6 changed files with 108 additions and 7 deletions

View File

@@ -114,7 +114,14 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
}
tag := c.QueryParam("tag")
if tag != "" {
memoFind.Tag = &tag
contentSearch := tag + " "
memoFind.ContentSearch = &contentSearch
}
if limit, err := strconv.Atoi(c.QueryParam("limit")); err == nil {
memoFind.Limit = limit
}
if offset, err := strconv.Atoi(c.QueryParam("offset")); err == nil {
memoFind.Offset = offset
}
list, err := s.Store.FindMemoList(memoFind)