-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.go
35 lines (29 loc) · 1.11 KB
/
init.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
package user
import (
"github.com/webx-top/echo"
_ "github.com/admpub/webx/application/handler/frontend/user/agent"
_ "github.com/admpub/webx/application/handler/frontend/user/membership"
_ "github.com/admpub/webx/application/handler/frontend/user/profile"
_ "github.com/admpub/webx/application/handler/frontend/user/wallet"
"github.com/admpub/webx/application/initialize/frontend"
xMW "github.com/admpub/webx/application/middleware"
)
func init() {
frontend.RegisterToGroup(`/user`, func(u echo.RouteRegister) {
// 用户个人
u.Route(`GET`, `/index`, Index)
u.Route(`GET,POST`, `/message/unread_count`, MessageUnreadCount)
u.Route(`GET,POST`, `/message/inbox`, MessageInbox)
u.Route(`GET,POST`, `/message/outbox`, MessageOutbox)
u.Route(`GET,POST`, `/message/system`, SystemMessage)
u.Route(`GET,POST`, `/message/view/:type/:id`, MessageView)
u.Route(`GET,POST`, `/message/send`, MessageSendHandler)
g := u.Group(`/file`)
// 上传
g.Route(`POST`, `/upload`, Upload)
// 裁剪图片
g.Route(`GET,POST`, `/crop`, Crop)
// 图片管理
g.Route(`GET,POST`, `/finder`, Finder)
}, xMW.AuthCheck)
}