feat: paginate/search words and improve review flow

This commit is contained in:
2026-02-27 13:15:37 +08:00
parent 906c5c37ba
commit a62c2a3aa1
6 changed files with 116 additions and 28 deletions

View File

@@ -100,8 +100,9 @@ func (h *WordHandler) SubmitReview(c *gin.Context) {
func (h *WordHandler) GetWords(c *gin.Context) {
limit, _ := strconv.Atoi(c.DefaultQuery("limit", "20"))
offset, _ := strconv.Atoi(c.DefaultQuery("offset", "0"))
query := strings.TrimSpace(c.DefaultQuery("q", ""))
words, total, err := h.wordService.GetAllWords(limit, offset)
words, total, err := h.wordService.GetAllWords(limit, offset, query)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return