Documentation ¶
Index ¶
- type Handler
- func (h Handler) AddToFavorites(ctx echo.Context) error
- func (h Handler) Create(ctx echo.Context) error
- func (h Handler) CreateCover(ctx echo.Context) error
- func (h Handler) Delete(ctx echo.Context) error
- func (h Handler) DeleteCover(ctx echo.Context) error
- func (h Handler) Get(ctx echo.Context) error
- func (h Handler) GetAll(ctx echo.Context) error
- func (h Handler) GetAllCovers(ctx echo.Context) error
- func (h Handler) GetCover(ctx echo.Context) error
- func (h Handler) GetFavorites(ctx echo.Context) error
- func (h Handler) GetPopular(ctx echo.Context) error
- func (h Handler) GetPopularOfWeek(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
- func (h Handler) UpdateCover(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 AlbumUseCase AlbumUseCase.AlbumUseCase }
func MakeHandler ¶
func MakeHandler(album AlbumUseCase.AlbumUseCase, user user_domain.UserUseCase) Handler
func (Handler) AddToFavorites ¶
AddToFavorites godoc @Summary AddToFavorites @Description add to favorite @Tags album @Accept application/json @Produce application/json @Param albumId body structs.AlbumIdWrapper true "albumId" @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/albums/favorites [post]
func (Handler) Create ¶
Create godoc @Summary Create @Description creating new album @Tags album @Accept application/json @Produce application/json @Param Album body albumProto.Album true "params of new album. 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/albums/ [post]
func (Handler) CreateCover ¶
CreateCover godoc @Summary Create @Description creating new albumCover @Tags albumCover @Accept application/json @Produce application/json @Param Album body albumProto.AlbumCover true "params of new album cover. 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/albumCovers/ [post]
func (Handler) Delete ¶
Delete godoc @Summary Delete @Description deleting album by id @Tags album @Accept application/json @Produce application/json @Param id path integer true "id of album 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/albums/{id} [delete]
func (Handler) DeleteCover ¶
DeleteCover godoc @Summary Delete @Description deleting album cover by id @Tags albumCover @Accept application/json @Produce application/json @Param id path integer true "id of album cover 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/albumCovers/{id} [delete]
func (Handler) Get ¶
Get godoc @Summary Get @Description getting album by id @Tags album @Accept application/json @Produce application/json @Param id path integer true "id of album 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/albums/{id} [get]
func (Handler) GetAll ¶
GetAll godoc @Summary GetAll @Description getting all albums @Tags album @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/albums/ [get]
func (Handler) GetAllCovers ¶
GetAllCovers godoc @Summary GetAll @Description getting all albums cover @Tags albumCover @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/albumCovers/ [get]
func (Handler) GetCover ¶
GetCover godoc @Summary Get @Description getting album cover by id @Tags albumCover @Accept application/json @Produce application/json @Param id path integer true "id of album cover 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/albumCovers/{id} [get]
func (Handler) GetFavorites ¶
GetFavorites godoc @Summary GetFavorites @Description getting favorites albums @Tags album @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/albums/favorites [get]
func (Handler) GetPopular ¶
GetPopular godoc @Summary GetPopular @Description getting top20 popular albums @Tags album @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/albums/popular [get]
func (Handler) GetPopularOfWeek ¶
GetPopularOfWeek godoc @Summary GetPopularOfTheWeek @Description getting top20 popular albums of the week @Tags album @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/albums/popular/week [get]
func (Handler) Like ¶
Like godoc @Summary Like @Description like album by id @Tags album @Accept application/json @Produce application/json @Param id path integer true "id of album 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/albums/like/{id} [put]
func (Handler) LikeCheckByUser ¶
LikeCheckByUser godoc @Summary LikeCheckByUser @Description LikeCheckByUser @Tags album @Accept application/json @Produce application/json @Param id path integer true "id of album 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/albums/like/{id} [get]
func (Handler) RemoveFromFavorites ¶
RemoveFromFavorites godoc @Summary RemoveFromFavorites @Description remove from favorites @Tags album @Accept application/json @Produce application/json @Param id path integer true "albumId" @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/albums/favorites/{id} [delete]
func (Handler) Update ¶
Update godoc @Summary Update @Description updating album by id @Tags albumCover @Accept application/json @Produce application/json @Param Album body albumProto.Album true "id of updating album 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/albums/ [put]
func (Handler) UpdateCover ¶
UpdateCover godoc @Summary Update @Description updating album cover by id @Tags albumCover @Accept application/json @Produce application/json @Param AlbumCover body albumProto.AlbumCover true "id of updating album cover 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/albumCovers/ [put]