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
import (
"sirlab.de/go/knyt/user"
"sirlab.de/go/knyt/users"
)
type Application struct {
Config ApplicationConfig
config ApplicationConfig
users users.Users
}
func NewApplication(config ApplicationConfig) *Application {
app := Application{
Config: config,
users: users.NewUsers(),
config: config,
}
app.users.AddUser(user.NewUser("120", "Settel", user.ROLE_ADMIN))
app.users = users.NewUsers()
return &app
}
func (app *Application) GetConfig() *ApplicationConfig {
return &app.config
}
func (app *Application) GetUsers() *users.Users {
return &app.users
}