-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.go
52 lines (42 loc) · 1.23 KB
/
index.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
package server
import (
consts "github.com/easysoft/zendata/internal/pkg/const"
"github.com/easysoft/zendata/internal/server/core/module"
"github.com/easysoft/zendata/internal/server/index"
"github.com/kataras/iris/v12"
)
type IndexModule struct {
CommModule *index.CommModule `inject:""`
DefModule *index.DefModule `inject:""`
AdminModule *index.AdminModule `inject:""`
DataModule *index.DataModule `inject:""`
MockModule *index.MockModule `inject:""`
}
func NewIndexModule() *IndexModule {
return &IndexModule{}
}
func (m *IndexModule) Party() module.WebModule {
handler := func(v1 iris.Party) {}
modules := []module.WebModule{
m.DefModule.Party(),
m.CommModule.Party(),
m.AdminModule.Party(),
m.MockModule.Party(),
m.MockModule.PartyData(),
}
return module.NewModule(consts.ApiPath, handler, modules...)
}
func (m *IndexModule) PartyData() module.WebModule {
handler := func(v1 iris.Party) {}
modules := []module.WebModule{
m.DataModule.Party(),
}
return module.NewModule("/data", handler, modules...)
}
func (m *IndexModule) PartyMock() module.WebModule {
handler := func(v1 iris.Party) {}
modules := []module.WebModule{
m.MockModule.Party(),
}
return module.NewModule("/mock", handler, modules...)
}