Files
pyGoEdge-UserPanel/reference/goedge 文档/PostCategoryService.md
2025-11-18 03:36:49 +08:00

3.9 KiB
Raw Blame History

PostCategoryService

文章分类管理服务


createPostCategory

创建分类

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/PostCategoryService/createPostCategory
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/PostCategoryService/deletePostCategory
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/PostCategoryService/findAllPostCategories
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/PostCategoryService/findPostCategory
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/PostCategoryService/sortPostCategories
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/PostCategoryService/updatePostCategory
  • RPCrpc 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 '{
    ...
  }'