refactoring
This commit is contained in:
parent
685bf8d69c
commit
a8093dc0ad
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user