Documentation ¶
Index ¶
- func Activate(c *fiber.Ctx) error
- func AdminCreateUser(c *fiber.Ctx) error
- func AdminDeleteUser(c *fiber.Ctx) error
- func AdminGetUser(c *fiber.Ctx) error
- func AdminGetUsers(c *fiber.Ctx) error
- func AdminUpdateUser(c *fiber.Ctx) error
- func ChangePassword(c *fiber.Ctx) error
- func CheckoutOrder(c *fiber.Ctx) error
- func CreateMovie(c *fiber.Ctx) error
- func CreateOrder(c *fiber.Ctx) error
- func CreatePromo(c *fiber.Ctx) error
- func CreateShow(c *fiber.Ctx) error
- func DeleteMovie(c *fiber.Ctx) error
- func DeleteShow(c *fiber.Ctx) error
- func ForgotPassword(c *fiber.Ctx) error
- func GenerateNewAccessToken(userID uuid.UUID, isAdmin bool, timeToExpire int64) (string, error)
- func GeneratePasswordHash(password []byte) (string, error)
- func GetCard(c *fiber.Ctx) error
- func GetDBInstance(newDB *gorm.DB) *gorm.DB
- func GetJWTUser(c *fiber.Ctx) (user model.User, err error)
- func GetMovie(c *fiber.Ctx) error
- func GetMovieShows(c *fiber.Ctx) error
- func GetMovies(c *fiber.Ctx) error
- func GetOrder(c *fiber.Ctx) error
- func GetPagination(c *fiber.Ctx) schema.Pagination
- func GetPromos(c *fiber.Ctx) error
- func GetShow(c *fiber.Ctx) error
- func GetTicket(c *fiber.Ctx) error
- func GetUserMe(c *fiber.Ctx) error
- func GetUserOrders(c *fiber.Ctx) error
- func IsValidPassword(hash, password []byte) bool
- func JWT(c *fiber.Ctx) error
- func ListObjs[Schema any](statement *gorm.DB, pagination schema.Pagination) (schemaValue []Schema, count int64, err error)
- func Login(c *fiber.Ctx) error
- func Logout(c *fiber.Ctx) error
- func Paginate(pagination schema.Pagination) func(db *gorm.DB) *gorm.DB
- func Register(c *fiber.Ctx) error
- func ResetPassword(c *fiber.Ctx) error
- func UpdateMovie(c *fiber.Ctx) error
- func UpdatePromo(c *fiber.Ctx) error
- func UpdateShow(c *fiber.Ctx) error
- func UpdateUserMe(c *fiber.Ctx) error
- func Version(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Activate ¶
func Activate(c *fiber.Ctx) error
Activation method for activating a new unactivated user.
@Description Activate a new user. @Summary activate @Tags Auth @Accept json @Produce json @Param id query string true "id" @Param code query string true "code" @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} interface{} "Ok" @Router /api/v1/auth/activate [post]
func AdminCreateUser ¶
func AdminCreateUser(c *fiber.Ctx) error
CreateUser func for creates a new user.
@Description Create a new user. @Summary create a new user @Tags Admin @Accept json @Produce json @Param createuser body schema.CreateUser true "Create new user" @Failure 400,401,409,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.User "Ok" @Security ApiKeyAuth @Router /api/v1/admin/users [post]
func AdminDeleteUser ¶
func AdminDeleteUser(c *fiber.Ctx) error
DeleteUser func delete a user.
@Description delete user @Summary delete a user @Tags Admin @Accept json @Produce json @Param id path string true "User ID" @Success 200 {object} interface{} "Ok" @Failure 401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/admin/users/{id} [delete]
func AdminGetUser ¶
func AdminGetUser(c *fiber.Ctx) error
GetUser func get a user.
@Description a user. @Summary get a user @Tags Admin @Accept json @Produce json @Param id path string true "User ID" @Success 200 {object} schema.UserDetail @Failure 400,401,403,404 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/admin/users/{id} [get]
func AdminGetUsers ¶
func AdminGetUsers(c *fiber.Ctx) error
GetUsers func get all users.
@Description Get all users. @Summary get all users @Tags Admin @Accept json @Produce json @Param offset query integer false "offset" @Param limit query integer false "limit" @Success 200 {object} schema.UserDetailNoCardsListResponse @Failure 400,401,403 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/admin/users [get]
func AdminUpdateUser ¶
func AdminUpdateUser(c *fiber.Ctx) error
UpdateUser func update a user.
@Description first_name, last_name, is_active, is_admin only @Summary update a user @Tags Admin @Accept json @Produce json @Param id path string true "User ID" @Param updateuser body schema.AdminUpdateUser true "Update a user" @Success 200 {object} schema.User @Failure 400,401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/admin/users/{id} [put]
func ChangePassword ¶
func ChangePassword(c *fiber.Ctx) error
ChangePassword method for changing the user's password.
@Description Change the user's password. @Summary change password @Tags Auth @Accept json @Produce json @Param changePassword body schema.UserChangePassword true "Change password" @Param redirect_url query string false "Redirect url after login" @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.UserChangePassword "Ok" "Ok" @Router /api/v1/auth/changepassword [post]
func CheckoutOrder ¶
func CheckoutOrder(c *fiber.Ctx) error
CheckoutOrder func for check out an existing order.
@Description Checkout a order. @Summary checkout a order @Tags Order @Accept json @Produce json @Param id path string true "Order ID" @Param Card body schema.UpdateCard true "Card to checkout" @Failure 400,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.Order "Ok" @Security ApiKeyAuth @Router /api/v1/orders/{id}/checkout [post]
func CreateMovie ¶
func CreateMovie(c *fiber.Ctx) error
CreateMovie func for creates a new movie.
@Description Create a new movie. @Summary create a new movie @Tags Movie @Accept json @Produce json @Param movie body schema.UpsertMovie true "Create new movie" @Failure 400,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.Movie "Ok" @Security ApiKeyAuth @Router /api/v1/movies [post]
func CreateOrder ¶
func CreateOrder(c *fiber.Ctx) error
CreateOrder func for creates a new order.
@Description Create a new order. @Summary create a new order @Tags Order @Accept json @Produce json @Param Order body schema.CreateOrder true "Create new order" @Failure 400,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.Order "Ok" @Security ApiKeyAuth @Router /api/v1/orders [post]
func CreatePromo ¶
func CreatePromo(c *fiber.Ctx) error
CreatePromo func creates a new promotion
@Description Create a new promotion. @Summary create a new promotion @Tags Admin @Accept json @Produce json @Param promotion body schema.UpsertPromotion true "Create new promo" @Success 200 {object} schema.Promotion @Failure 400 {object} schema.ErrorResponse "Error" @Router /api/v1/admin/promotions [post] @Security ApiKeyAuth
func CreateShow ¶
func CreateShow(c *fiber.Ctx) error
CreateShow func for creates a new show.
@Description Create a new show. @Summary create a new show @Tags Show @Accept json @Produce json @Param Show body schema.UpsertShow true "Create new Show" @Failure 400,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.Show "Ok" @Security ApiKeyAuth @Router /api/v1/shows [post]
func DeleteMovie ¶
func DeleteMovie(c *fiber.Ctx) error
DeleteMovie func delete a movie.
@Description delete movie @Summary delete a movie @Tags Movie @Accept json @Produce json @Param id path string true "Movie ID" @Success 200 {object} interface{} "Ok" @Failure 401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/movies/{id} [delete]
func DeleteShow ¶
func DeleteShow(c *fiber.Ctx) error
DeleteShow func delete a Show.
@Description delete show @Summary delete a show @Tags Show @Accept json @Produce json @Param id path string true "Show ID" @Success 200 {object} interface{} "Ok" @Failure 401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/shows/{id} [delete]
func ForgotPassword ¶
func ForgotPassword(c *fiber.Ctx) error
ForgotPassword method for initiating the password reset process.
@Description Initiate the password reset process. @Summary forgot password @Tags Auth @Accept json @Produce json @Param email query string false "Email" @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} interface{} "Ok" @Router /api/v1/auth/forgotpassword [post]
func GenerateNewAccessToken ¶
func GeneratePasswordHash ¶
func GetCard ¶
func GetCard(c *fiber.Ctx) error
GetCard func gets a card.
@Description a payment card. @Summary get a payment card @Tags Card @Accept json @Produce json @Param id path string true "Card ID" @Success 200 {object} schema.Card @Failure 400,404 {object} schema.ErrorResponse "Error" @Router /api/v1/cards/{id} [get]
func GetJWTUser ¶
func GetMovie ¶
func GetMovie(c *fiber.Ctx) error
GetMovie func gets a movie.
@Description a movie. @Summary get a movie @Tags Movie @Accept json @Produce json @Param id path string true "Movie ID" @Success 200 {object} schema.Movie @Failure 400,404 {object} schema.ErrorResponse "Error" @Router /api/v1/movies/{id} [get]
func GetMovieShows ¶
func GetMovieShows(c *fiber.Ctx) error
GetMovieShows func gets all shows of a movie.
@Description shows of a movie. @Summary get shows of a movie @Tags Movie @Accept json @Produce json @Param id path string true "Movie ID" @Success 200 {object} schema.ShowListResponse @Failure 400,404 {object} schema.ErrorResponse "Error" @Router /api/v1/movies/{id}/shows [get]
func GetMovies ¶
func GetMovies(c *fiber.Ctx) error
GetMovies func gets all movies.
@Description Get all movies. @Summary get all movies @Tags Movie @Accept json @Produce json @Param offset query integer false "offset" @Param limit query integer false "limit" @Param search query string false "search by title" @Param running query bool false "the movie is running or not" @Param category query string false "filter by category" @Param showTime query string false "filter by show time" @Success 200 {object} schema.MovieListResponse @Failure 400 {object} schema.ErrorResponse "Error" @Router /api/v1/movies [get]
func GetOrder ¶
func GetOrder(c *fiber.Ctx) error
GetOrder func gets a order.
@Description a order. @Summary get a order @Tags Order @Accept json @Produce json @Param id path string true "Order ID" @Success 200 {object} schema.Order @Failure 400,404 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/orders/{id} [get]
func GetPagination ¶
func GetPagination(c *fiber.Ctx) schema.Pagination
func GetPromos ¶
func GetPromos(c *fiber.Ctx) error
GetPromos func gets all promotions.
@Description Get all promotions. @Summary get all promotions @Tags Admin @Accept json @Produce json @Param search query string false "search by code" @Param offset query integer false "offset" @Param limit query integer false "limit" @Success 200 {object} schema.PromoListResponse @Failure 400 {object} schema.ErrorResponse "Error" @Router /api/v1/admin/promotions [get]
func GetShow ¶
func GetShow(c *fiber.Ctx) error
GetShow func gets a Show.
@Description a show. @Summary get a show @Tags Show @Accept json @Produce json @Param id path string true "Show ID" @Success 200 {object} schema.Show @Failure 400,404 {object} schema.ErrorResponse "Error" @Router /api/v1/shows/{id} [get]
func GetTicket ¶
func GetTicket(c *fiber.Ctx) error
GetTicket func retrieves a ticket by ID
@Description Retrieve a ticket by ID. @Summary retrieve a ticket by ID @Tags Ticket @Accept json @Produce json @Param id path string true "Ticket ID" @Success 200 {object} schema.Ticket @Failure 400,404 {object} schema.ErrorResponse "Error" @Router /api/v1/tickets/{id} [get] @Security ApiKeyAuth
func GetUserMe ¶
func GetUserMe(c *fiber.Ctx) error
GetUserMe func get a user me.
@Description a user me. @Summary get a user me @Tags User @Accept json @Produce json @Success 200 {object} schema.UserDetail @Failure 400,401,403,404 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/users/me [get]
func GetUserOrders ¶
func GetUserOrders(c *fiber.Ctx) error
GetUserOrders func gets the list of all orders history from the current user.
@Description get all orders history from the current user. @Summary get all orders history @Tags User @Accept json @Produce json @Param offset query integer false "offset" @Param limit query integer false "limit" @Success 200 {object} schema.OrderListResponse @Failure 400,401,403,404 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/users/me/orders [get]
func IsValidPassword ¶
func JWT ¶
func JWT(c *fiber.Ctx) error
Get current JWT method for debugging.
@Description Get current JWT. @Summary JWT @Tags Auth @Accept json @Produce json @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.JWT "Ok" @Security ApiKeyAuth @Router /api/v1/auth/jwt [post]
func Login ¶
func Login(c *fiber.Ctx) error
Login method for creating a new access token.
@Description Set new access token to cookies and redirect. Demo username: demo, password: 123456 @Summary login @Tags Auth @Accept json @Produce json @Param login body schema.Auth true "Request for token" @Param redirect_url query string false "Redirect url after login" @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.TokenResponse "Ok" @Router /api/v1/auth/login [post]
func Logout ¶
func Logout(c *fiber.Ctx) error
Logout method.
@Description Clean cookies @Summary logout @Tags Auth @Accept json @Produce json @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} interface{} "Ok" @Security ApiKeyAuth @Router /api/v1/auth/logout [post]
func Register ¶
func Register(c *fiber.Ctx) error
Register method for creating a new unactivated user.
@Description Register for a new user. @Summary register @Tags Auth @Accept json @Produce json @Param register body schema.RegisterUser true "register user" @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.User "Ok" @Router /api/v1/auth/register [post]
func ResetPassword ¶
func ResetPassword(c *fiber.Ctx) error
ResetPassword method for resetting the user's password.
@Description Reset the user's password. @Summary reset password @Tags Auth @Accept json @Produce json @Param resetPassword body schema.UserResetPassword true "Reset password" @Param redirect_url query string false "Redirect url after login" @Failure 400,404,401,500 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.UserResetPassword "Ok" "Ok" @Router /api/v1/auth/resetpassword [post]
func UpdateMovie ¶
func UpdateMovie(c *fiber.Ctx) error
UpdateMovie func update a movie.
@Description update movie @Summary update a movie @Tags Movie @Accept json @Produce json @Param id path string true "Movie ID" @Param updatemovie body schema.UpsertMovie true "Update a movie" @Success 200 {object} schema.Movie @Failure 400,401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/movies/{id} [put]
func UpdatePromo ¶
func UpdatePromo(c *fiber.Ctx) error
UpdatePromo func update a promo.
@Description update promo @Summary update a promo @Tags Admin @Accept json @Produce json @Param id path string true "Promo ID" @Param updatepromo body schema.UpsertPromotion true "Update a promo" @Success 200 {object} schema.Promotion @Failure 400,401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/admin/promotions/{id} [put]
func UpdateShow ¶
func UpdateShow(c *fiber.Ctx) error
UpdateShow func update a Show.
@Description update show @Summary update a show @Tags Show @Accept json @Produce json @Param id path string true "Show ID" @Param updateShow body schema.UpsertShow true "Update a Show" @Success 200 {object} schema.Show @Failure 400,401,403,404,500 {object} schema.ErrorResponse "Error" @Security ApiKeyAuth @Router /api/v1/shows/{id} [put]
func UpdateUserMe ¶
func UpdateUserMe(c *fiber.Ctx) error
UpdateUser update user information.
@Description update user info. @Summary update user info @Tags User @Accept json @Produce json @Param user body schema.UpdateUser true "update user profile" @Failure 400,401,403,404 {object} schema.ErrorResponse "Error" @Success 200 {object} schema.UserDetail "Ok" @Security ApiKeyAuth @Router /api/v1/users/me [put]
Types ¶
This section is empty.