playlistDeliveryHttp

package
v0.0.0-...-704a905 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	PlaylistUseCase PlaylistUseCase.PlaylistUseCase
	UserUseCase     user_domain.UserUseCase
}

func (Handler) AddToPlaylist

func (h Handler) AddToPlaylist(ctx echo.Context) error

AddToPlaylist godoc @Summary AddToPlaylist @Description adding track_id to playlist @Tags playlist @Accept application/json @Produce application/json @Param playlistIdTrackId body playlistProto.PlaylistIdTrackId true "ids of playlist and track" @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/playlists/ofUser [post]

func (Handler) Create

func (h Handler) Create(ctx echo.Context) error

Create godoc @Summary Create @Description creating new playlist @Tags playlist @Accept application/json @Produce application/json @Param Playlist body playlistProto.Playlist true "params of new playlist. 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/playlists/ [post]

func (Handler) Delete

func (h Handler) Delete(ctx echo.Context) error

Delete godoc @Summary Delete @Description deleting playlists by id @Tags playlist @Accept application/json @Produce application/json @Param id path integer true "id of playlists 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/playlists/{id} [delete]

func (Handler) Get

func (h Handler) Get(ctx echo.Context) error

Get godoc @Summary Get @Description getting playlist by id @Tags playlist @Accept application/json @Produce application/json @Param id path integer true "id of playlist 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/playlists/{id} [get]

func (Handler) GetAll

func (h Handler) GetAll(ctx echo.Context) error

GetAll godoc @Summary GetAll @Description getting all playlists @Tags playlist @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/playlists/ [get]

func (Handler) GetAllOfCurrentUser

func (h Handler) GetAllOfCurrentUser(ctx echo.Context) error

GetAllOfCurrentUser godoc @Summary GetAllOfCurrentUser @Description getting all playlists of user @Tags playlist @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/playlists/ofUser [get]

func (Handler) GetOfCurrentUser

func (h Handler) GetOfCurrentUser(ctx echo.Context) error

GetOfCurrentUser godoc @Summary GetOfCurrentUser @Description getting playlist by id of current user @Tags playlist @Accept application/json @Produce application/json @Param id path integer true "id of playlist 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/playlists/ofUser/{id} [get]

func (Handler) RemoveFromPlaylist

func (h Handler) RemoveFromPlaylist(ctx echo.Context) error

RemoveFromPlaylist godoc @Summary RemoveFromPlaylist @Description remove track_id from playlist @Tags playlist @Accept application/json @Produce application/json @Param playlistId query integer true "id of playlists" @Param trackId query integer true "id of track" @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/playlists/ofUser [delete]

func (Handler) Update

func (h Handler) Update(ctx echo.Context) error

Update godoc @Summary Update @Description updating playlist by id @Tags playlist @Accept application/json @Produce application/json @Param playlist body playlistProto.Playlist true "id of updating playlist 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/playlists/ [put]

Jump to

Keyboard shortcuts

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