-
Notifications
You must be signed in to change notification settings - Fork 234
/
routes.go
77 lines (61 loc) · 2.76 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package gopher
import (
"gitea.com/lunny/tango"
"github.com/jimmykuu/gopher/actions"
"github.com/jimmykuu/gopher/apis"
"github.com/jimmykuu/gopher/middlewares"
)
func SetRoutes(t *tango.Tango) {
t.Get("/signin", new(actions.Signin))
t.Get("/signup", new(actions.Signup))
t.Get("/forgot_password", new(actions.ForgotPassword))
t.Get("/reset/:code", new(actions.ResetPassword))
t.Get("/topic/new", new(actions.NewTopic))
t.Get("/t/:topicID/edit", new(actions.EditTopic))
t.Get("/t/:topicID", new(actions.ShowTopic))
t.Get("/t/:topicID/collect", new(actions.CollectTopic))
t.Get("/", new(actions.Index))
t.Get("/go/:node", new(actions.NodeTopics))
t.Get("/search", new(actions.SearchTopic))
t.Get("/member/:username", new(actions.AccountIndex))
t.Get("/member/:username/comments", new(actions.AccountComments))
t.Get("/member/:username/collections", new(actions.AccountCollections))
t.Get("/member/:username/activate", new(actions.AccountActivate))
t.Get("/member/:username/block", new(actions.AccountBlock))
t.Get("/members", new(actions.LatestUsers))
t.Get("/members/all", new(actions.AllUsers))
t.Get("/link", new(actions.Link))
t.Get("/user_center", new(actions.UserCenter))
t.Get("/user_center/profile", new(actions.UserProfile))
t.Get("/user_center/avatar", new(actions.ChangeAvatar))
t.Get("/user_center/change_password", new(actions.ChangePassword))
t.Post("/api/signin", new(apis.Signin))
t.Post("/api/signup", new(apis.Signup))
t.Get("/api/captcha", new(apis.Captcha))
t.Group("/api", func(g *tango.Group) {
g.Use(middlewares.ApiAuthHandler())
g.Post("/forgot_password", new(apis.ForgotPassword))
g.Post("/reset_password", new(apis.ResetPassword))
g.Get("/nodes", new(apis.NodeList))
g.Post("/topics", new(apis.Topic))
g.Put("/topics/:topicID", new(apis.Topic))
g.Get("/topics/:topicID", new(apis.Topic))
g.Delete("/topic/:topicID", new(apis.Topic))
g.Get("/topic/:topicID/collect", new(apis.CollectTopic))
g.Get("/topic/:topicID/cancel_collect", new(apis.CancelCollectTopic))
g.Post("/upload/image", new(apis.UploadImage))
g.Post("/comments", new(apis.Comment))
g.Delete("/comments/:commentID", new(apis.Comment))
g.Get("/comments/:commentID", new(apis.Comment))
g.Put("/comments/:commentID", new(apis.Comment))
g.Get("/user_center/default_avatars", new(apis.DefaultAvatars))
g.Get("/user_center/user_info", new(apis.UserInfo))
g.Put("/user_center/basic_info", new(apis.BasicInfo))
g.Put("/user_center/profile", new(apis.UserProfile))
g.Put("/user_center/change_password", new(apis.ChangePassword))
g.Post("/user_center/upload_avatar", new(apis.UploadAvatarImage))
g.Put("/user_center/set_avatar", new(apis.SetAvatar))
g.Get("/user_center/from_gravatar", new(apis.FromGravatar))
})
t.Get("/:slug", new(actions.Announcement))
}