chore: migrate to gitea
Some checks failed
golangci-lint / lint (push) Successful in 1m33s
Test / test (push) Failing after 2m16s

This commit is contained in:
2026-01-27 00:12:32 +01:00
parent 79d9f55fdc
commit f81c902ca6
3170 changed files with 1216494 additions and 1586 deletions

View File

@@ -1,10 +1,11 @@
package ginserver
import (
"budget/internal/utils"
"math/rand"
"time"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/utils"
"github.com/gin-gonic/gin"
)

View File

@@ -1,16 +1,16 @@
package ginserver
import (
"budget/handler"
"budget/internal/account"
"budget/internal/expense"
"budget/internal/jointaccount"
"budget/internal/storage/dao/postgresql"
"budget/internal/user"
"budget/middleware"
"net/http"
"time"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/handler"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/account"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/expense"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/storage/dao/postgresql"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/user"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/middleware"
"github.com/gin-gonic/gin"
"github.com/gin-contrib/cors"
@@ -38,7 +38,6 @@ func NewRouter(config *handler.Config) *gin.Engine {
hc := handler.NewContext()
uh := user.NewHandler(hc, db)
ah := account.NewHandler(hc, db)
jah := jointaccount.NewHandler(hc, db)
eh := expense.NewHandler(hc, db)
mv := middleware.NewValidator(hc, db)
public := router.Group("/")
@@ -71,17 +70,5 @@ func NewRouter(config *handler.Config) *gin.Engine {
securedExistingExpenses := securedValidAccount.Group("/expenses/:expenseId")
securedExistingExpenses.Handle(http.MethodGet, "", eh.GetAnExpenses)
securedExistingExpenses.Handle(http.MethodDelete, "", eh.DeleteExpense)
//account route
securedMatchingToken.Handle(http.MethodGet, "/jointaccounts", jah.GetAllJointaccountOfUser)
securedMatchingToken.Handle(http.MethodPost, "/jointaccounts", jah.CreateJointaccountOfUser)
securedValidJointAccount := securedMatchingToken.Group("/jointaccounts/:jointaccountId")
securedValidJointAccount.Use(mv.HasValidJointAccountId)
securedValidJointAccount.Use(mv.JointAccountExists)
securedValidJointAccount.Handle(http.MethodDelete, "", jah.DeleteJointaccountOfUser)
securedValidJointAccount.Handle(http.MethodGet, "", jah.GetSpecificJointaccountOfUser)
securedValidJointAccount.Handle(http.MethodPost, "/expenses", eh.CreateAnExpense)
securedValidJointAccount.Handle(http.MethodGet, "/expenses", eh.GetAllExpenses)
return router
}