feat: basic auth shit + db init

This commit is contained in:
hexlocation 2025-05-05 19:34:28 +02:00
parent db49da5fd9
commit d8caef7e5d
10 changed files with 261 additions and 69 deletions

View file

@ -1,10 +1,9 @@
package types
import (
"time"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"stereo.cat/backend/internal/auth/client"
)
type Route struct {
@ -14,23 +13,8 @@ type Route struct {
}
type StereoConfig struct {
Router *gin.Engine
ImagePath string
}
type User struct {
gorm.Model
ID uint
Username string
RegistrationDate time.Time
Blacklisted bool
Email string
}
func RegisterRoutes(groupName string, routes []Route, cfg *StereoConfig) {
group := cfg.Router.Group(groupName)
for _, route := range routes {
group.Handle(route.Method, route.Path, route.Exec(cfg))
}
Router *gin.Engine
Client client.Client
Database *gorm.DB
}