removed old exclude method + swagger fix
This commit is contained in:
parent
f90cc4d8dd
commit
06d952c145
1 changed files with 4 additions and 13 deletions
|
|
@ -5,7 +5,6 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"merch-parser-api/internal/interfaces"
|
||||
"merch-parser-api/internal/shared"
|
||||
"merch-parser-api/pkg/responses"
|
||||
"net/http"
|
||||
"time"
|
||||
|
|
@ -41,14 +40,6 @@ func (h *Handler) RegisterRoutes(r *gin.RouterGroup, authMW gin.HandlerFunc) {
|
|||
authGroup.POST("/refresh", h.controller.refresh)
|
||||
}
|
||||
|
||||
func (h *Handler) ExcludeRoutes() []shared.ExcludeRoute {
|
||||
return []shared.ExcludeRoute{
|
||||
{Route: "/user", Method: http.MethodPost},
|
||||
{Route: "/user/auth/login", Method: http.MethodPost},
|
||||
{Route: "/user/auth/refresh", Method: http.MethodPost},
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Регистрация нового пользователя
|
||||
// @Description Регистрация нового пользователя
|
||||
// @Tags Users
|
||||
|
|
@ -171,7 +162,7 @@ func (co *controller) delete(c *gin.Context) {
|
|||
// @Success 200 {object} LoginResponse
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
// @Failure 500 {object} responses.ErrorResponse500
|
||||
// @Router /user/login [post]
|
||||
// @Router /user/auth/login [post]
|
||||
func (co *controller) login(c *gin.Context) {
|
||||
var login Login
|
||||
if err := c.ShouldBindJSON(&login); err != nil {
|
||||
|
|
@ -208,7 +199,7 @@ func (co *controller) login(c *gin.Context) {
|
|||
// @Success 200
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
// @Failure 500 {object} responses.ErrorResponse500
|
||||
// @Router /user/logout [post]
|
||||
// @Router /user/auth/logout [post]
|
||||
func (co *controller) logout(c *gin.Context) {
|
||||
cookie, err := c.Request.Cookie("refresh_uuid")
|
||||
if err != nil {
|
||||
|
|
@ -233,9 +224,9 @@ func (co *controller) logout(c *gin.Context) {
|
|||
// @Tags Users - auth
|
||||
// @Security BearerAuth
|
||||
// @Success 200 {object} LoginResponse
|
||||
// @Failure 400 {object} responses.ErrorResponse400s
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
// @Failure 500 {object} responses.ErrorResponse500
|
||||
// @Router /user/refresh [post]
|
||||
// @Router /user/auth/refresh [post]
|
||||
func (co *controller) refresh(c *gin.Context) {
|
||||
cookie, err := c.Request.Cookie("refresh_uuid")
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue