-
Notifications
You must be signed in to change notification settings - Fork 82
/
system.go
55 lines (43 loc) · 1.12 KB
/
system.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package v1
import (
"github.com/noovertime7/kubemanage/dao"
"github.com/noovertime7/kubemanage/pkg/core/kubemanage/v1/sys"
)
type SystemGetter interface {
System() SystemInterface
}
// SystemInterface 顶层抽象 包括系统相关接口
type SystemInterface interface {
sys.UserServiceGetter
sys.MenuGetter
sys.CasbinServiceGetter
sys.AuthorityGetter
sys.OperationServiceGetter
sys.APIServiceGetter
}
var _ SystemInterface = &system{}
func NewSystem(app *KubeManage) SystemInterface {
return &system{app: app, factory: app.Factory}
}
type system struct {
app *KubeManage
factory dao.ShareDaoFactory
}
func (s *system) User() sys.UserService {
return sys.NewUserService(s.factory)
}
func (s *system) Menu() sys.MenuService {
return sys.NewMenuService(s.factory)
}
func (s *system) CasbinService() sys.CasbinService {
return sys.NewCasbinService(s.factory)
}
func (s *system) Authority() sys.Authority {
return sys.NewAuthority(s.factory)
}
func (s *system) Operation() sys.OperationService {
return sys.NewOperationService(s.factory)
}
func (s *system) Api() sys.APIService {
return sys.NewApiService(s.factory)
}