Documentation ¶
Index ¶
- type Handler
- func (h Handler) AddToFavorites(ctx echo.Context) error
- func (h Handler) Create(ctx echo.Context) error
- func (h Handler) Delete(ctx echo.Context) error
- func (h Handler) Get(ctx echo.Context) error
- func (h Handler) GetAll(ctx echo.Context) error
- func (h Handler) GetFavorites(ctx echo.Context) error
- func (h Handler) GetPopular(ctx echo.Context) error
- func (h Handler) Like(ctx echo.Context) error
- func (h Handler) LikeCheckByUser(ctx echo.Context) error
- func (h Handler) RemoveFromFavorites(ctx echo.Context) error
- func (h Handler) Update(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { UserUseCase user_domain.UserUseCase ArtistUseCase ArtistUseCase.ArtistUseCase TrackUseCase TrackUseCase.TrackUseCase }
func MakeHandler ¶
func MakeHandler(artist ArtistUseCase.ArtistUseCase, track TrackUseCase.TrackUseCase, user user_domain.UserUseCase) Handler
func (Handler) AddToFavorites ¶
AddToFavorites godoc @Summary AddToFavorites @Description add to favorite @Tags artist @Accept application/json @Produce application/json @Param artistId body structs.ArtistIdWrapper true "artistId" @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/favorites [post]
func (Handler) Create ¶
Create godoc @Summary Create @Description creating new artist @Tags artist @Accept application/json @Produce application/json @Param Artist body artistProto.Artist true "params of new artist. Id will be set automatically." @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/ [post]
func (Handler) Delete ¶
Delete godoc @Summary Delete @Description deleting artist by id @Tags artist @Accept application/json @Produce application/json @Param id path integer true "id of artist which need to be deleted" @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/{id} [delete]
func (Handler) Get ¶
Get godoc @Summary Get @Description getting artist by id @Tags artist @Accept application/json @Produce application/json @Param id path integer true "id of artist which need to be getted" @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/{id} [get]
func (Handler) GetAll ¶
GetAll godoc @Summary GetAll @Description getting all artists @Tags artist @Accept application/json @Produce application/json @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/ [get]
func (Handler) GetFavorites ¶
GetFavorites godoc @Summary GetFavorites @Description getting favorites artist @Tags artist @Accept application/json @Produce application/json @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/favorites [get]
func (Handler) GetPopular ¶
GetPopular godoc @Summary GetPopular @Description getting top20 popular artists @Tags artist @Accept application/json @Produce application/json @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/popular [get]
func (Handler) Like ¶
Like godoc @Summary Like @Description like artist by id @Tags artist @Accept application/json @Produce application/json @Param id path integer true "id of artist which need to be liked" @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/like/{id} [put]
func (Handler) LikeCheckByUser ¶
LikeCheckByUser godoc @Summary LikeCheckByUser @Description LikeCheckByUser @Tags artist @Accept application/json @Produce application/json @Param id path integer true "id of artist which need to check for like" @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/like/{id} [get]
func (Handler) RemoveFromFavorites ¶
RemoveFromFavorites godoc @Summary RemoveFromFavorites @Description remove from favorites @Tags artist @Accept application/json @Produce application/json @Param id path integer true "artistId" @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/favorites/{id} [delete]
func (Handler) Update ¶
Update godoc @Summary Update @Description updating artist by id @Tags artist @Accept application/json @Produce application/json @Param Artist body artistProto.Artist true "id of updating artist and params of it." @Success 200 {object} webUtils.Success @Failure 400 {object} webUtils.Error "Data is invalid" @Failure 405 {object} webUtils.Error "Method is not allowed" @Router /api/v1/artists/ [put]