Documentation ¶
Index ¶
- func CreatePage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DeletePage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DepublishPage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DetrashPage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPages(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPagesStats(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPublicPage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPublicPageBySlug(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPublicPages(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func PublishPage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func SearchPublicPages(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func TrashPage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func UpdatePage(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePage ¶
@Tags Page (Editor) @Summary Create Page @Description Create a new page. @Router /v1/auth/editor/page [post] @Security BearerAuth @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param form body object{slug=string,title=string,content=string,publishNow=boolean} true "Create page form" @Success 200 {object} object{data=object{uid=string,slug=string,title=string,content=string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},publishedAt=time,updatedAt=time,createdAt=time,deletedAt=time}} @Failure 401 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}
func DeletePage ¶
@Tags Page (Editor) @Summary Delete Page (Permanent) @Description Delete a page (permanent). @Router /v1/auth/editor/page/{uid}/permanent [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Page's UID or slug" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func DepublishPage ¶
@Tags Page (Editor) @Summary Unpublish Page @Description Remove publish status from a page if page already published. @Router /v1/auth/writer/page/{uid}/depublish [put] @Router /v1/auth/writer/page/{uid}/depublish [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func DetrashPage ¶
@Tags Page (Editor) @Summary Restore Page (Soft) @Description Restore a deleted page (soft-deleted). @Router /v1/auth/editor/page/{uid}/detrash [put] @Router /v1/auth/editor/page/{uid}/detrash [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Page's UID or slug" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPage ¶
@Tags Page (Editor) @Summary Get Page @Description Get a page. @Router /v1/auth/editor/page/{uid} [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Page's UID or slug" @Success 200 {object} object{data=object{uid=string,slug=string,title=string,content=string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},publishedAt=time,updatedAt=time,createdAt=time,deletedAt=time}} @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPages ¶
@Tags Page (Editor) @Summary Get Pages @Description Get pages. @Router /v1/auth/editor/pages [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Param type query string false "Filter data by type, e.g.: ?type=trash, ?type=published, ?type=draft." @Success 200 {object} object{data=[]object{uid=string,slug=string,title=string,content=string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},publishedAt=time,updatedAt=time,createdAt=time,deletedAt=time}} @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPagesStats ¶
@Tags Page (Editor) @Summary Get Pages Stats @Description Get pages's stats. @Router /v1/auth/editor/pages/stats [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Param type query string false "Filter data by type, e.g.: ?type=trash, ?type=published, ?type=draft." @Success 200 {object} object{data=object{currentPage=int,totalPages=int,itemsPerPage=int,totalItems=int}} @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPublicPage ¶
@Tags Page (Public) @Summary Get Public Page @Description Get a page that available publicly. @Router /v1/page/{uid} [get] @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @Success 200 {object} object{data=object{uid=string,slug=string,title=string,content=string,publishedAt=time}} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPublicPageBySlug ¶
func GetPublicPageBySlug( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Page (Public) @Summary Get Public Page By Slug @Description Get a page that available publicly by its slug. @Router /v1/page/{slug} [get] @Produce application/json @Produce application/msgpack @Param slug query string false "The slug query." @Success 200 {object} object{data=object{uid=string,slug=string,title=string,content=string,publishedAt=time}} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPublicPages ¶
func GetPublicPages( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Page (Public) @Summary Get Public Pages @Description Get pages that available publicly. @Router /v1/pages [get] @Produce application/json @Produce application/msgpack @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Success 200 {object} object{data=[]object{uid=string,slug=string,title=string,content=string,publishedAt=time}} @Success 204 @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func PublishPage ¶
@Tags Page (Editor) @Summary Publish Page @Description Publish a page if not published yet. @Router /v1/auth/editor/page/{uid}/publish [put] @Router /v1/auth/editor/page/{uid}/publish [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func SearchPublicPages ¶
func SearchPublicPages( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Page (Public) @Summary Search Public Pages @Description Search posts that available publicly. @Router /v1/page/search [get] @Produce application/json @Produce application/msgpack @Param q query string false "The search query." @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Success 200 {object} object{data=[]object{uid=string,slug=string,title=string,content=string,publishedAt=time}} @Success 204 @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func TrashPage ¶
@Tags Page (Editor) @Summary Delete Page (Soft) @Description Delete a page (soft-deleted). @Router /v1/auth/editor/page/{uid} [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Page's UID or slug" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func UpdatePage ¶
@Tags Page (Editor) @Summary Update Page @Description Update a page. @Router /v1/auth/editor/page/{uid} [put] @Router /v1/auth/editor/page/{uid} [patch] @Security BearerAuth @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param uid path string true "Page's UID or slug" @Param form body object{slug=string,title=string,content=string,publishNow=boolean} true "Update page form" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}
Types ¶
This section is empty.