Documentation
¶
Index ¶
- func CreateAuthor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler
- func CreateAuthorIfNotExistsFor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler
- func GetAuthor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler
- func GetAuthorName(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler
- func GetAuthorPads(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler
- func Init(initStore *lib.InitStore)
- type AuthorNameResponse
- type CreateAuthorIfNotExistsForRequest
- type CreateDto
- type CreateDtoResponse
- type PadsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuthor ¶ added in v0.0.5
CreateAuthor godoc @Summary Create a new author @Description Creates a new author with the specified name @Tags Authors @Accept json @Produce json @Param author body CreateDto true "Author data" @Success 200 {object} CreateDtoResponse @Failure 400 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author [post]
func CreateAuthorIfNotExistsFor ¶ added in v0.0.5
func CreateAuthorIfNotExistsFor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler
CreateAuthorIfNotExistsFor godoc @Summary Create an author if not exists for a mapper @Description Creates an author for a mapper if it doesn't exist, otherwise returns existing author ID @Tags Authors @Accept json @Produce json @Param request body CreateAuthorIfNotExistsForRequest true "Author mapper and name" @Success 200 {object} CreateDtoResponse @Failure 400 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/createIfNotExistsFor [post]
func GetAuthor ¶ added in v0.0.5
GetAuthor godoc @Summary Get an author @Description Returns the information of an author by their ID @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Success 200 {object} author.Author @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId} [get]
func GetAuthorName ¶ added in v0.0.5
GetAuthorName godoc @Summary Get author name @Description Returns the name of an author @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Success 200 {object} AuthorNameResponse @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId}/name [get]
func GetAuthorPads ¶ added in v0.0.5
GetAuthorPads godoc @Summary Get all pads of an author @Description Returns all pad IDs that an author has contributed to @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Success 200 {array} string @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId}/pads [get]
Types ¶
type AuthorNameResponse ¶ added in v0.0.5
type AuthorNameResponse struct {
AuthorName string `json:"authorName"`
}
AuthorNameResponse represents the response with author name
type CreateAuthorIfNotExistsForRequest ¶ added in v0.0.5
type CreateAuthorIfNotExistsForRequest struct {
AuthorMapper string `json:"authorMapper" validate:"required"`
Name string `json:"name"`
}
CreateAuthorIfNotExistsForRequest represents the request to create an author if not exists
type CreateDto ¶
type CreateDto struct {
Name string `json:"name" validate:"required" example:"John Doe"`
}
CreateDto represents the request to create an author
type CreateDtoResponse ¶
type CreateDtoResponse struct {
AuthorId string `json:"authorId" example:"a.s8oes9dhwrvt0zif"`
}
CreateDtoResponse represents the response when creating an author
type PadsResponse ¶ added in v0.0.5
type PadsResponse struct {
PadIds []string `json:"padIds"`
}
PadsResponse represents a list of pad IDs