chore: sync

This commit is contained in:
2026-03-18 22:06:17 +08:00
parent 9b04338e5f
commit 7cb7aeabcb
28 changed files with 3634 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
"mengyastore-backend/internal/storage"
)
type PublicHandler struct {
store *storage.JSONStore
}
func NewPublicHandler(store *storage.JSONStore) *PublicHandler {
return &PublicHandler{store: store}
}
func (h *PublicHandler) ListProducts(c *gin.Context) {
items, err := h.store.ListActive()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{"data": items})
}