3.9 KiB
3.9 KiB
PostCategoryService
文章分类管理服务
createPostCategory
创建分类
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/PostCategoryService/createPostCategory - RPC:
rpc createPostCategory(CreatePostCategoryRequest) returns (CreatePostCategoryResponse);
请求对象 (CreatePostCategoryRequest)
{
"name": "string // 分类名称",
"code": "string // 分类代号"
}
响应对象 (CreatePostCategoryResponse)
{
"postCategoryId": "int64 // 分类ID"
}
调用示例
curl -X POST "https://backend.dooki.cloud/PostCategoryService/createPostCategory" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
deletePostCategory
删除分类
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/PostCategoryService/deletePostCategory - RPC:
rpc deletePostCategory(DeletePostCategoryRequest) returns (RPCSuccess);
请求对象 (DeletePostCategoryRequest)
{
"postCategoryId": "int64 // 分类ID"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/PostCategoryService/deletePostCategory" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
findAllPostCategories
列出所有分类
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/PostCategoryService/findAllPostCategories - RPC:
rpc findAllPostCategories(FindAllPostCategoriesRequest) returns (FindAllPostCategoriesResponse);
请求对象 (FindAllPostCategoriesRequest)
{}
响应对象 (FindAllPostCategoriesResponse)
{
"postCategories": "[]PostCategory // 分类列表"
}
调用示例
curl -X POST "https://backend.dooki.cloud/PostCategoryService/findAllPostCategories" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
findPostCategory
查询单个分类
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/PostCategoryService/findPostCategory - RPC:
rpc findPostCategory(FindPostCategoryRequest) returns (FindPostCategoryResponse);
请求对象 (FindPostCategoryRequest)
{
"postCategoryId": "int64 // 分类ID"
}
响应对象 (FindPostCategoryResponse)
{
"postCategory": "PostCategory // 分类信息"
}
调用示例
curl -X POST "https://backend.dooki.cloud/PostCategoryService/findPostCategory" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
sortPostCategories
对分类进行排序
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/PostCategoryService/sortPostCategories - RPC:
rpc sortPostCategories(SortPostCategoriesRequest) returns (RPCSuccess);
请求对象 (SortPostCategoriesRequest)
{
"postCategoryIds": "[]int64 // 分类ID列表"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/PostCategoryService/sortPostCategories" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
updatePostCategory
修改分类
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/PostCategoryService/updatePostCategory - RPC:
rpc updatePostCategory(UpdatePostCategoryRequest) returns (RPCSuccess);
请求对象 (UpdatePostCategoryRequest)
{
"postCategoryId": "int64 // 分类ID",
"name": "string // 分类名称",
"code": "string // 分类代号",
"isOn": "bool // 是否启用"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/PostCategoryService/updatePostCategory" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'