article.api 2.8 KB
syntax = "v1"

info(
	title: "文章内容处理"
	desc: "编辑处理文章内容"
	author: "author"
	email: "email"
	version: "v1"
)

// 小程序接口
@server(
	prefix: v1/mini
	group: article
	jwt: MiniAuth
)
service Core {
	@doc "小程序创建发布内容"
	@handler MiniCreateArticle
	post /article (MiniArticleCreateRequest) returns (MiniArticleCreateResponse)
	@doc "小程序获取文章内容详情"
	@handler MiniGetArticle
	get /article/:id (MiniArticleGetRequest) returns (MiniArticleGetResponse)
	@doc "小程序获取文章的点赞人员列表"
	@handler MiniUserLikeArticle
	post /article/user_like/list (MiniUserLikeArticleRequest) returns (MiniUserLikeArticleResponse)
	@doc "小程序人员操作点赞文章/评论"
	@handler MiniSetUserLike
	post /article/user_like/set (MiniSetUserLikeRequset) returns (MiniSetUserLikeResponse)

	@doc "小程序标记当前人员查看的文章"
	@handler MiniArticleMarkUserRead
	post /article/mark/user_read (MiniArticleMarkUserReadRequest) returns (MiniArticleMarkUserReadResponse)

	@doc "小程序获取文章浏览记录"
	@handler MiniArticleMarkList
	post /article/mark/list (MiniArticleMarkListRequest) returns (MiniArticleMarkListResponse)

	@doc "小程序获取我发布的文章"
	@handler MiniArticleSearchMe
	post /article/search/me (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse)

	@doc "小程序创建文章进草稿箱"
	@handler MiniCreateArticleDraft
	post /article_draft (MiniArticleDraftCreateRequest) returns (MiniArticleDraftCreateResponse)

	@doc "小程序更新文章草稿"
	@handler MiniUpdateArticleDraft
	put /article_draft (MiniArticleDraftUpdateRequest) returns (MiniArticleDraftUpdateResponse)

	@doc "小程序获取我的草稿箱列表"
	@handler MiniSearchArticleDraftMe
	post /article_draft/search/me (MiniArticleDraftSearchMeRequest) returns (MiniArticleDraftSearchMeResponse)

	@doc "小程序获取我的草稿内容"
	@handler MiniGetArticleDraftMe
	get /article_draft/me/:id (MiniArticleDraftGetMeRequest) returns (MiniArticleDraftGetMeResponse)

	@doc "小程序删除我的草稿内容"
	@handler MiniDeleteArticleDraftMe
	delete /article_draft/me/:id (MiniArticleDraftDeleteMeRequest) returns (MiniArticleDraftDeleteMeResponse)

	@doc "小程序获取文章的编辑记录"
	@handler MiniArticleBackupSearch
	post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse)
}

// 管理后台接口
@server(
	prefix: v1/system
	group: article
	jwt: MiniAuth
)
service Core {
	@doc "管理后台获取文章内容详情"
	@handler SystemGetArticle
	get /article/:id (SystemArticleGetRequest) returns (SystemArticleGetResponse)

	@doc "管理后台获取文章列表"
	@handler SystemSearchArticle
	post /article/search (SystemArticleSearchRequest) returns (SystemArticleSearchResponse)
}