-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.go
69 lines (59 loc) · 1.87 KB
/
server.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import (
"pool-backend/dao"
"pool-backend/handlers/admin"
"pool-backend/handlers/key"
"pool-backend/handlers/token"
"github.com/Viva-con-Agua/vcago"
)
func main() {
e := vcago.NewServer()
dao.InitialDatabase()
dao.InitialNats()
dao.InitialIDjango()
dao.InitialTestLogin()
dao.FixDatabase()
dao.UpdateDatabase()
dao.UpdateTicker()
//dao.ReloadDatabase()
//login routes
api := e.Group("/v1")
token.Assets.Routes(api.Group("/assets"))
token.Login.Routes(api.Group("/auth"))
//user routes
tokenUser := api.Group("/users")
token.User.Routes(tokenUser)
token.Profile.Routes(tokenUser.Group("/profile"))
token.UserCrew.Routes(tokenUser.Group("/crew"))
token.Role.Routes(tokenUser.Group("/role"))
token.RoleHistory.Routes(tokenUser.Group("/role_history"))
token.Active.Routes(tokenUser.Group("/active"))
token.NVM.Routes(tokenUser.Group("/nvm"))
token.Address.Routes(tokenUser.Group("/address"))
token.Avatar.Routes(tokenUser.Group("/avatar"))
token.Newsletter.Routes(tokenUser.Group("/newsletter"))
token.User.Routes(tokenUser)
//crew routes
crews := api.Group("/crews")
token.Crew.Routes(crews)
mails := api.Group("/mails")
token.Mailbox.Routes(mails.Group("/mailbox"))
token.Message.Routes(mails.Group("/message"))
events := api.Group("/events")
token.Event.Routes(events.Group("/event"))
token.Artist.Routes(events.Group("/artist"))
token.Organizer.Routes(events.Group("/organizer"))
token.Participation.Routes(events.Group("/participation"))
finances := api.Group("/finances")
token.Source.Routes(finances.Group("/source"))
token.Taking.Routes(finances.Group("/taking"))
token.Deposit.Routes(finances.Group("/deposit"))
key.Import.Routes(api.Group("/import"))
if dao.TestLogin {
admin.Crew.Routes(e.Group("/admin/crews"))
admin.Role.Routes(e.Group("/admin/users/role"))
admin.User.Routes(e.Group("/admin/users"))
}
//server
e.Run()
}