comments

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePublicCommentReply

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

@Tags Comment (Public) @Summary Create Public Comment's Reply @Description Create a reply for a comment that available publicly. @Router /v1/comment/reply [post] @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param form body object{parentCommentUid=string,email=string,name=string,content=string} true "Create comment form" @Success 200 {object} object{data=object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=time}} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

func CreatePublicPostComment

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

@Tags Comment (Public) @Summary Create Public Post's Comment @Description Create a comment for a post that available publicly. @Router /v1/comment [post] @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param form body object{postUid=string,email=string,name=string,content=string} true "Create comment form" @Success 200 {object} object{data=object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=time}} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

func DeleteComment

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

@Tags Comment (Editor) @Summary Delete Comment (Permanent) @Description Delete comment (permanent). @Router /v1/auth/editor/comment/{uid}/permanent [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func DeleteMyComment

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

@Tags Comment (Writer) @Summary Delete My Comment (Permanent) @Description Delete a comment of my post (permanent). @Router /v1/auth/writer/comment/{uid}/permanent [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func DetrashComment

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

@Tags Comment (Editor) @Summary Restore Comment (Soft) @Description Restore deleted comment (soft-deleted). @Router /v1/auth/editor/comment/{uid}/detrash [put] @Router /v1/auth/editor/comment/{uid}/detrash [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func DetrashMyComment

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

@Tags Comment (Writer) @Summary Restore My Comment (Soft) @Description Restore a deleted comment of my post (soft-deleted). @Router /v1/auth/writer/comment/{uid}/detrash [put] @Router /v1/auth/writer/comment/{uid}/detrash [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetComment

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

@Tags Comment (Editor) @Summary Get Comment @Description Get a comment. @Router /v1/auth/editor/comment/{uid} [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 200 {object} object{data=object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=string,deletedAt=string}} @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetComments

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

@Tags Comment (Editor) @Summary Get Comments @Description Get comments. @Router /v1/auth/editor/comments [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,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=string,deletedAt=string}} @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetCommentsStats

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

@Tags Comment (Editor) @Summary Get Comments Stats @Description Get comments's stats. @Router /v1/auth/editor/comments/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 GetMyComment

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

@Tags Comment (Writer) @Summary Get My Comment @Description Get a comment of mine. @Router /v1/auth/writer/comment/{uid} [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 200 {object} object{data=object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=string,deletedAt=string}} @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetMyComments

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

@Tags Comment (Writer) @Summary Get My Comments @Description Get comments of mine. @Router /v1/auth/writer/comments [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=active." @Success 200 {object} object{data=[]object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=string,deletedAt=string}} @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetMyCommentsStats

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

@Tags Comment (Writer) @Summary Get My Comments Stats @Description Get my comments's stats. @Router /v1/auth/writer/comments/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=active." @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 GetMyPostComments

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

@Tags Comment (Writer) @Summary Get My Post Comments @Description Get my post's comments. @Router /v1/auth/writer/post/{uid}/comments [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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=active." @Success 200 {object} object{data=[]object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=string,deletedAt=string}} @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetMyPostCommentsStats

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

@Tags Comment (Writer) @Summary Get My Post Comments Stats @Description Get my post's comments stats. @Router /v1/auth/writer/post/{uid}/comments/stats [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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=active." @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 GetPostComments

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

@Tags Comment (Editor) @Summary Get Post Comments @Description Get post's comments. @Router /v1/auth/editor/post/{uid}/comments [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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=active." @Success 200 {object} object{data=[]object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=string,deletedAt=string}} @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetPostCommentsStats

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

@Tags Comment (Editor) @Summary Get Post Comments Stats @Description Get post's comments stats. @Router /v1/auth/editor/post/{uid}/comments/stats [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID or slug" @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=active." @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 GetPublicComment

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

@Tags Comment (Public) @Summary Get Public Comment @Description Get a comment that available publicly. @Router /v1/comment/{uid} [get] @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 200 {object} object{data=object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=time}} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetPublicCommentReplies

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

@Tags Comment (Public) @Summary Get Public Comment's Replies @Description Get public comment's replies that available publicly. @Router /v1/comment/{uid}/replies [get] @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 200 {object} object{data=[]object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=time}} @Failure 204 @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetPublicPostComments

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

@Tags Comment (Public) @Summary Get Public Post's Comments @Description Get public post's comments that available publicly. @Router /v1/post/{uid}/comments [get] @Produce application/json @Produce application/msgpack @Param uid path string true "Post's UID" @Success 200 {object} object{data=[]object{uid=string,postUid=string,parentCommentUid=string,email=string,name=string,content=string,replyCount=int,createdAt=time}} @Failure 204 @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func TrashComment

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

@Tags Comment (Editor) @Summary Delete Comment (Soft) @Description Delete a comment (soft-deleted). @Router /v1/auth/editor/comment/{uid} [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func TrashMyComment

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

@Tags Comment (Writer) @Summary Delete My Comment (Soft) @Description Delete a comment of my post (soft-deleted). @Router /v1/auth/writer/comment/{uid} [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "Comment's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {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