routes change

This commit is contained in:
nquidox 2025-09-14 16:22:53 +03:00
parent 1cb033d526
commit 8f4e999e43

View file

@ -26,14 +26,14 @@ func newController(service *service, utils interfaces.Utils) *controller {
func (h *Handler) RegisterRoutes(r *gin.RouterGroup, authMW gin.HandlerFunc) {
userGroup := r.Group("/user")
userGroup.POST("/", authMW, h.controller.register)
userGroup.POST("/", h.controller.register)
userGroup.GET("/", authMW, h.controller.get)
userGroup.PUT("/", authMW, h.controller.update)
userGroup.DELETE("/", authMW, h.controller.delete)
//auth
h.controller.authPath = fmt.Sprintf("%s/user/auth", h.apiPrefix)
authGroup := userGroup.Group("/auth")
authGroup := r.Group("/user/auth")
authGroup.POST("/login", h.controller.login)
authGroup.POST("/logout", h.controller.logout)
@ -195,7 +195,6 @@ func (co *controller) login(c *gin.Context) {
// @Summary Логаут
// @Description Логаут. Для логаута надо передать refresh token, он будет инвалидирован.
// @Tags Users - auth
// @Security BearerAuth
// @Success 200
// @Failure 400 {object} responses.ErrorResponse400
// @Failure 500 {object} responses.ErrorResponse500
@ -220,9 +219,8 @@ func (co *controller) logout(c *gin.Context) {
}
// @Summary Обновление аксесс токена по рефреш токену.
// @Description Принимает рефреш токен в заголовке Authorization
// @Description Принимает рефреш токен в http only куки
// @Tags Users - auth
// @Security BearerAuth
// @Success 200 {object} LoginResponse
// @Failure 400 {object} responses.ErrorResponse400
// @Failure 500 {object} responses.ErrorResponse500