Documentation ¶
Index ¶
- func CreatePost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DeleteMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DeletePost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DepublishMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DepublishPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DetrashMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func DetrashPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetMyPosts(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetMyPostsStats(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPosts(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPostsStats(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPublicPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func GetPublicPosts(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func PublishMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func PublishPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func SearchPublicPosts(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func TrashMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func TrashPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func UpdateMyPost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
- func UpdatePost(maxCtxDuration time.Duration, svc *service.Service) (handler gin.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePost ¶
@Tags Post (Writer) @Summary Create Post @Description Create a new post. @Router /v1/auth/writer/post [post] @Security BearerAuth @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param form body object{slug=string,title=string,description=string,featuringImagePath=string,categories=[]string,tags=[]string,content=string,publishNow=boolean} true "Create post form" @Success 200 {object} object{data=object{uid=string,slug=string,title=string,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,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 DeleteMyPost ¶
@Tags Post (Writer) @Summary Delete My Post (Permanent) @Description Delete my post (permanent). @Router /v1/auth/writer/post/{uid}/permanent [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post'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 DeletePost ¶
@Tags Post (Writer) @Summary Delete Post (Permanent) @Description Delete a post (permanent). @Router /v1/auth/editor/post/{uid}/permanent [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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}
func DepublishMyPost ¶
func DepublishMyPost( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Post (Writer) @Summary Unpublish My Post @Description Remove publish status from my post if post already published. @Router /v1/auth/writer/post/{uid}/depublish [put] @Router /v1/auth/writer/post/{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 DepublishPost ¶
@Tags Post (Editor) @Summary Unpublish Post @Description Remove a post from publish status if post already published. @Router /v1/auth/editor/post/{uid}/depublish [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func DetrashMyPost ¶
@Tags Post (Writer) @Summary Restore My Post (Soft) @Description Restore my deleted post (soft-deleted). @Router /v1/auth/writer/post/{uid}/detrash [put] @Router /v1/auth/writer/post/{uid}/detrash [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post'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 DetrashPost ¶
@Tags Post (Editor) @Summary Restore Post (Soft) @Description Restore a deleted post (soft-deleted). @Router /v1/auth/editor/post/{uid}/detrash [put] @Router /v1/auth/editor/post/{uid}/detrash [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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}
func GetMyPost ¶
@Tags Post (Writer) @Summary Get My Post @Description Get my post. @Router /v1/auth/writer/post/{uid} [get] @Security BearerAuth @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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,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 GetMyPosts ¶
@Tags Post (Writer) @Summary Get My Posts @Description Get my posts. @Router /v1/auth/writer/posts [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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,publishedAt=time,updatedAt=time,createdAt=time,deletedAt=time}} @Failure 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetMyPostsStats ¶
func GetMyPostsStats( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Post (Writer) @Summary Get My Posts Stats @Description Get my posts's stats. @Router /v1/auth/writer/posts/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 GetPost ¶
@Tags Post (Editor) @Summary Get Post @Description Get a post. @Router /v1/auth/editor/post/{uid} [get] @Security BearerAuth @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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,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 GetPosts ¶
@Tags Post (Editor) @Summary Get Posts @Description Get posts. @Router /v1/auth/editor/posts [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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,publishedAt=time,updatedAt=time,createdAt=time,deletedAt=time}} @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPostsStats ¶
@Tags Post (Editor) @Summary Get Posts Stats @Description Get posts's stats. @Router /v1/auth/editor/posts/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 GetPublicPost ¶
@Tags Post (Public) @Summary Get Public Post @Description Get a post that available publicly. @Router /v1/post/{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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,content=string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,publishedAt=time}} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func GetPublicPosts ¶
func GetPublicPosts( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Post (Public) @Summary Get Public Posts @Description Get posts that available publicly. @Router /v1/posts [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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,content=string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,publishedAt=time}} @Success 204 @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func PublishMyPost ¶
@Tags Post (Writer) @Summary Publish My Post @Description Publish my post if not published yet. @Router /v1/auth/writer/post/{uid}/publish [put] @Router /v1/auth/writer/post/{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 PublishPost ¶
@Tags Post (Editor) @Summary Publish Post @Description Publish a post if not published yet. @Router /v1/auth/editor/post/{uid}/publish [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}
func SearchPublicPosts ¶
func SearchPublicPosts( maxCtxDuration time.Duration, svc *service.Service, ) (handler gin.HandlerFunc)
@Tags Post (Public) @Summary Search Public Posts @Description Search posts that available publicly. @Router /v1/post/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,featuringImagePath=string,description=string,categories=[]object{uid=string,slug=string,name=string},tags=[]string,content=string,author=object{uid=string,username=string,email=string,firstName=string,lastName=string},commentCount=int,publishedAt=time}} @Success 204 @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}
func TrashMyPost ¶
@Tags Post (Writer) @Summary Delete My Post (Soft) @Description Delete my post (soft-deleted). @Router /v1/auth/writer/post/{uid} [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post'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 TrashPost ¶
@Tags Post (Editor) @Summary Delete Post (Soft) @Description Delete a post (soft-deleted). @Router /v1/auth/editor/post/{uid} [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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}
func UpdateMyPost ¶
@Tags Post (Writer) @Summary Update My Post @Description Update my post. @Router /v1/auth/writer/post/{uid} [put] @Router /v1/auth/writer/post/{uid} [patch] @Security BearerAuth @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @Param form body object{slug=string,title=string,description=string,featuringImagePath=string,categories=[]string,tags=[]string,content=string,publishNow=boolean} true "Update post 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}
func UpdatePost ¶
@Tags Post (Editor) @Summary Update Post @Description Update a post. @Router /v1/auth/editor/post/{uid} [put] @Router /v1/auth/editor/post/{uid} [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @Param form body object{slug=string,title=string,description=string,featuringImagePath=string,categories=[]string,tags=[]string,content=string,publishNow=boolean} true "Update post 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.