pages

package
v0.0.0-...-7b45942 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePage

func CreatePage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func DeletePage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func DepublishPage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func DetrashPage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func GetPage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func GetPages(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func GetPagesStats(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func GetPublicPage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func PublishPage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func TrashPage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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

func UpdatePage(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@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.

Jump to

Keyboard shortcuts

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