chore: initial commit of HouseholdBudgetBook (backend, frontend, desktop)

This commit is contained in:
mapleferry committed 2026-11-29 21:29:06 +08:00
commit 4a5db3f1f9
167 files changed
+21732

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
package api
import (
"github.com/gin-gonic/gin"
"household-book/service"
"net/http"
)
type BackupHandler struct{ svc *service.BackupService }
func NewBackupHandler(s *service.BackupService) *BackupHandler { return &BackupHandler{svc: s} }
func (h *BackupHandler) Status(c *gin.Context) {
v, e := h.svc.Status()
if e != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "获取备份状态失败"})
return
}
c.JSON(http.StatusOK, v)
}
func (h *BackupHandler) Create(c *gin.Context) {
v, e := h.svc.Create(c.Request.Context())
if e != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "创建备份失败"})
return
}
c.JSON(http.StatusOK, v)
}