From a9569a2a97b3afb9f260bae5409cb8fb3bcb68df Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 3 Jul 2023 14:26:45 +0800 Subject: [PATCH] refactor: router change --- internal/api/route.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/api/route.go b/internal/api/route.go index 84df97bb0..fb8c2d9a0 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -34,15 +34,16 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive r.GET("/metrics", prome.PrometheusHandler()) } ParseToken := mw.GinParseToken(rdb) - userRouterGroup := r.Group("/user", ParseToken) + userRouterGroup := r.Group("/user") { - userRouterGroup.POST("/update_user_info", u.UpdateUserInfo) - userRouterGroup.POST("/set_global_msg_recv_opt", u.SetGlobalRecvMessageOpt) - userRouterGroup.POST("/get_users_info", u.GetUsersPublicInfo) - userRouterGroup.POST("/get_all_users_uid", u.GetAllUsersID) - userRouterGroup.POST("/account_check", u.AccountCheck) - userRouterGroup.POST("/get_users", u.GetUsers) - userRouterGroup.POST("/get_users_online_status", u.GetUsersOnlineStatus) + userRouterGroup.POST("/user_register", u.UserRegister) + userRouterGroup.POST("/update_user_info", ParseToken, u.UpdateUserInfo) + userRouterGroup.POST("/set_global_msg_recv_opt", ParseToken, u.SetGlobalRecvMessageOpt) + userRouterGroup.POST("/get_users_info", ParseToken, u.GetUsersPublicInfo) + userRouterGroup.POST("/get_all_users_uid", ParseToken, u.GetAllUsersID) + userRouterGroup.POST("/account_check", ParseToken, u.AccountCheck) + userRouterGroup.POST("/get_users", ParseToken, u.GetUsers) + userRouterGroup.POST("/get_users_online_status", ParseToken, u.GetUsersOnlineStatus) } //friend routing group friendRouterGroup := r.Group("/friend", ParseToken)