refactoring

This commit is contained in:
Settel 2021-08-01 19:11:21 +02:00
parent 685bf8d69c
commit a8093dc0ad

View File

@ -1,26 +1,28 @@
package application package application
import ( import (
"sirlab.de/go/knyt/user"
"sirlab.de/go/knyt/users" "sirlab.de/go/knyt/users"
) )
type Application struct { type Application struct {
Config ApplicationConfig config ApplicationConfig
users users.Users users users.Users
} }
func NewApplication(config ApplicationConfig) *Application { func NewApplication(config ApplicationConfig) *Application {
app := Application{ app := Application{
Config: config, config: config,
users: users.NewUsers(),
} }
app.users.AddUser(user.NewUser("120", "Settel", user.ROLE_ADMIN)) app.users = users.NewUsers()
return &app return &app
} }
func (app *Application) GetConfig() *ApplicationConfig {
return &app.config
}
func (app *Application) GetUsers() *users.Users { func (app *Application) GetUsers() *users.Users {
return &app.users return &app.users
} }