добавил ручки для фронта

This commit is contained in:
2025-11-30 02:02:11 +03:00
parent da62ea5b98
commit 714844058f
9 changed files with 99 additions and 9 deletions

View File

@@ -57,3 +57,15 @@ func (h *OCRHandler) SaveMatch(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "saved"})
}
// GetMatches возвращает список всех обученных связей
func (h *OCRHandler) GetMatches(c *gin.Context) {
matches, err := h.service.GetKnownMatches()
if err != nil {
logger.Log.Error("Ошибка получения списка матчей", zap.Error(err))
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, matches)
}