handler

package
v0.0.0-...-e328feb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *common.Config) *Server

func (*Server) CreateCategory

func (server *Server) CreateCategory(ctx *gin.Context)

CreateCategory godoc @Summary Create a new category @Description Create a new category @Tags category @Accept json @Produce json @Param Authorization header string true "Bearer token" @Param name body string true "Name" alphanum @Param description body string false "Description" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /categories [post]

func (*Server) CreateVideo

func (server *Server) CreateVideo(ctx *gin.Context)

CreateVideo godoc @Summary Create a new video @Description Create a new video @Tags video @Accept multipart/form-data @Produce json @Param Authorization header string true "Bearer token" @Param title formData string true "Title" @Param description formData string false "Description" @Param category_ids formData []uint64 true "CategoryIDs" @Param file formData file true "Media file" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos [post]

func (*Server) GetCategories

func (server *Server) GetCategories(ctx *gin.Context)

GetCategories godoc @Summary Get all categories @Description Get all categories @Tags category @Accept json @Produce json @Param Authorization header string true "Bearer token" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /categories [get]

func (*Server) GetProfile

func (server *Server) GetProfile(ctx *gin.Context)

GetProfile godoc @Summary Get current user profile @Description Get current user profile @Tags user @Accept json @Produce json @Param Authorization header string true "Bearer token" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /users/me [get]

func (*Server) GetRouter

func (server *Server) GetRouter() *gin.Engine

func (*Server) GetSegments

func (server *Server) GetSegments(ctx *gin.Context)

GetSegments godoc @Summary Get video segments @Description Get video segments @Tags video @Accept json @Produce json @Param id path int true "ID" @Param page query int false "Page" @Param limit query int false "Limit" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos/{id}/segments [get]

func (*Server) GetTokenMaker

func (server *Server) GetTokenMaker() token.TokenMaker

func (*Server) GetVideoDetails

func (server *Server) GetVideoDetails(ctx *gin.Context)

GetVideoDetails godoc @Summary Get video details @Description Get video details @Tags video @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos/{id} [get]

func (*Server) GetVideos

func (server *Server) GetVideos(ctx *gin.Context)

GetVideos godoc @Summary List videos by filters @Description List videos by filters @Tags video @Accept json @Produce json @Param page query int false "Page" @Param limit query int false "Limit" @Param user_id query int false "UserID" @Param status query string false "Status" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos [get]

func (*Server) Login

func (server *Server) Login(ctx *gin.Context)

Login godoc @Summary Login @Description Login @Tags auth @Accept json @Produce json @Param username body string true "Username" alphanum @Param password body string true "Password" minlength(8) @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /auth/login [post]

func (*Server) Register

func (server *Server) Register(ctx *gin.Context)

Register godoc @Summary Register @Description Register @Tags user @Accept json @Produce json @Param username body string true "Username" alphanum @Param password body string true "Password" minlength(8) @Param full_name body string true "Full Name" minlength(8) @Param email body string true "Email" minlength(8) @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /users/register [post]

func (*Server) RunDBMigration

func (server *Server) RunDBMigration()

func (*Server) Start

func (server *Server) Start()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL