feat(05-01): restructure fonoteka plugins into Winter directories

- Move models, classes, controllers, middleware, and updates into subpackages
- Add self-registering models/updates/classes registries so later plans add files
- Keep the genres route and shipped migration SQL unchanged
This commit is contained in:
Jakub Zych
2026-09-18 18:43:31 +02:00
parent 5530fa4ebf
commit 2d4245681e
7 changed files with 100 additions and 26 deletions

13
models/registry.go Normal file
View File

@@ -0,0 +1,13 @@
package models
var all []any
// Register appends GORM models so later plans add files without editing plugin.go.
func Register(models ...any) {
all = append(all, models...)
}
// All returns every model registered by this plugin's models package.
func All() []any {
return all
}

15
models/user.go Normal file
View File

@@ -0,0 +1,15 @@
package models
// User is the minimal users row the JWT guard loads.
type User struct {
ID uint `gorm:"column:id;primaryKey"`
Email string `gorm:"column:email"`
Password string `gorm:"column:password"`
MustChangePassword bool `gorm:"column:must_change_password"`
}
func (User) TableName() string { return "users" }
func init() {
Register(User{})
}