-
Notifications
You must be signed in to change notification settings - Fork 3
/
routes.go
55 lines (46 loc) · 1.46 KB
/
routes.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 routes
import (
"Lottery-go/bootstrap"
"Lottery-go/services"
"Lottery-go/web/controllers"
"github.com/kataras/iris/mvc"
)
func Configure(b *bootstrap.Bootstrapper) {
userService := services.NewUserService()
giftService := services.NewGiftService()
codeService := services.NewCodeService()
resultService := services.NewResultService()
userDayService := services.NewUserdayService()
blackIpService := services.NewBlackIpService()
index := mvc.New(b.Party("/"))
index.Register(userService,
giftService,
codeService,
resultService,
userDayService,
blackIpService)
index.Handle(new(controllers.IndexController))
admin := mvc.New(b.Party("/admin"))
admin.Register(userService,
giftService,
codeService,
resultService,
userDayService,
blackIpService)
admin.Handle(new(controllers.AdminController))
adminGift := admin.Party("/gift")
adminGift.Register(giftService)
adminGift.Handle(new(controllers.AdminGiftController))
adminResult := admin.Party("/result")
adminResult.Register(resultService)
adminResult.Handle(new(controllers.AdminResultController))
adminUser := admin.Party("/user")
adminUser.Register(userService)
adminUser.Handle(new(controllers.AdminUserController))
adminCode := admin.Party("/code")
adminCode.Register(codeService)
adminCode.Handle(new(controllers.AdminCodeController))
adminBlackIp := admin.Party("/blackip")
adminBlackIp.Register(blackIpService)
adminBlackIp.Handle(new(controllers.AdminBlackIpController))
}