feat: 添加预算管理功能,包括预算的创建、查询、更新、删除及进度计算。
This commit is contained in:
@@ -3,8 +3,8 @@ package handler
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"accounting-app/pkg/api"
|
||||
"accounting-app/internal/service"
|
||||
"accounting-app/pkg/api"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -60,8 +60,6 @@ func (h *BudgetHandler) CreateBudget(c *gin.Context) {
|
||||
api.BadRequest(c, err.Error())
|
||||
case service.ErrInvalidPeriodType:
|
||||
api.BadRequest(c, err.Error())
|
||||
case service.ErrCategoryOrAccountRequired:
|
||||
api.BadRequest(c, err.Error())
|
||||
default:
|
||||
api.InternalError(c, "Failed to create budget")
|
||||
}
|
||||
@@ -150,8 +148,6 @@ func (h *BudgetHandler) UpdateBudget(c *gin.Context) {
|
||||
api.BadRequest(c, err.Error())
|
||||
case service.ErrInvalidPeriodType:
|
||||
api.BadRequest(c, err.Error())
|
||||
case service.ErrCategoryOrAccountRequired:
|
||||
api.BadRequest(c, err.Error())
|
||||
default:
|
||||
api.InternalError(c, "Failed to update budget")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user