feat: add content report governance

This commit is contained in:
2026-01-16 11:36:04 +08:00
parent 3af3c854c9
commit 609ca7b980
18 changed files with 2480 additions and 101 deletions

View File

@@ -340,6 +340,100 @@ const docTemplate = `{
}
}
},
"/super/v1/content-reports": {
"get": {
"description": "List content report records across tenants",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Content"
],
"summary": "List content reports",
"parameters": [
{
"type": "integer",
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Page size",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/requests.Pager"
},
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.SuperContentReportItem"
}
}
}
}
]
}
}
}
}
},
"/super/v1/content-reports/{id}/process": {
"post": {
"description": "Process a content report record",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Content"
],
"summary": "Process content report",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Report ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Process form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperContentReportProcessForm"
}
}
],
"responses": {
"200": {
"description": "Processed",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/contents": {
"get": {
"description": "List contents",
@@ -7835,6 +7929,108 @@ const docTemplate = `{
}
}
},
"dto.SuperContentReportItem": {
"type": "object",
"properties": {
"content_id": {
"description": "ContentID 内容ID。",
"type": "integer"
},
"content_owner_id": {
"description": "ContentOwnerID 内容作者用户ID。",
"type": "integer"
},
"content_owner_name": {
"description": "ContentOwnerName 内容作者用户名/昵称。",
"type": "string"
},
"content_status": {
"description": "ContentStatus 内容状态。",
"type": "string"
},
"content_title": {
"description": "ContentTitle 内容标题。",
"type": "string"
},
"created_at": {
"description": "CreatedAt 举报时间RFC3339。",
"type": "string"
},
"detail": {
"description": "Detail 举报描述。",
"type": "string"
},
"handled_action": {
"description": "HandledAction 处理动作block/unpublish/ignore。",
"type": "string"
},
"handled_at": {
"description": "HandledAt 处理时间RFC3339。",
"type": "string"
},
"handled_by": {
"description": "HandledBy 处理人用户ID。",
"type": "integer"
},
"handled_by_name": {
"description": "HandledByName 处理人用户名/昵称。",
"type": "string"
},
"handled_reason": {
"description": "HandledReason 处理说明。",
"type": "string"
},
"id": {
"description": "ID 举报ID。",
"type": "integer"
},
"reason": {
"description": "Reason 举报原因。",
"type": "string"
},
"reporter_id": {
"description": "ReporterID 举报人用户ID。",
"type": "integer"
},
"reporter_name": {
"description": "ReporterName 举报人用户名/昵称。",
"type": "string"
},
"status": {
"description": "Status 处理状态。",
"type": "string"
},
"tenant_code": {
"description": "TenantCode 租户编码。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID。",
"type": "integer"
},
"tenant_name": {
"description": "TenantName 租户名称。",
"type": "string"
}
}
},
"dto.SuperContentReportProcessForm": {
"type": "object",
"properties": {
"action": {
"description": "Action 处理动作approve/reject。",
"type": "string"
},
"content_action": {
"description": "ContentAction 内容处置动作block/unpublish/ignore仅在 approve 时生效。",
"type": "string"
},
"reason": {
"description": "Reason 处理说明(可选,用于审计记录)。",
"type": "string"
}
}
},
"dto.SuperContentReviewForm": {
"type": "object",
"required": [