-
Notifications
You must be signed in to change notification settings - Fork 2
/
router.go
37 lines (31 loc) · 1.19 KB
/
router.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
package main
import (
"douyin-server/controller"
"github.com/gin-gonic/gin"
)
func initRouter(r *gin.Engine) {
apiRouter := r.Group("/douyin")
apiRouter.GET("")
// basic apis
{
apiRouter.GET("/feed/", controller.Feed)
apiRouter.GET("/user/", controller.VerifyToken, controller.UserInfo)
apiRouter.POST("/user/register/", controller.LoginLimit, controller.Register)
apiRouter.POST("/user/login/", controller.LoginLimit, controller.Login)
apiRouter.POST("/publish/action/", controller.VerifyToken, controller.Publish)
apiRouter.GET("/publish/list/", controller.PublishList)
}
// extra apis - I
{
apiRouter.POST("/favorite/action/", controller.VerifyToken, controller.FavoriteAction)
apiRouter.GET("/favorite/list/", controller.FavoriteList)
apiRouter.POST("/comment/action/", controller.VerifyToken, controller.CommentAction)
apiRouter.GET("/comment/list/", controller.CommentList)
}
// extra apis - II
{
apiRouter.POST("/relation/action/", controller.VerifyToken, controller.RelationAction)
apiRouter.GET("/relation/follow/list/", controller.VerifyToken, controller.FollowList)
apiRouter.GET("/relation/follower/list/", controller.VerifyToken, controller.FollowerList)
}
}