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:
13
models/registry.go
Normal file
13
models/registry.go
Normal 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
15
models/user.go
Normal 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{})
|
||||
}
|
||||
Reference in New Issue
Block a user