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": [

View File

@@ -334,6 +334,100 @@
}
}
},
"/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",
@@ -7829,6 +7923,108 @@
}
}
},
"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": [

View File

@@ -1376,6 +1376,81 @@ definitions:
- action
- content_ids
type: object
dto.SuperContentReportItem:
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
type: object
dto.SuperContentReportProcessForm:
properties:
action:
description: Action 处理动作approve/reject
type: string
content_action:
description: ContentAction 内容处置动作block/unpublish/ignore仅在 approve 时生效。
type: string
reason:
description: Reason 处理说明(可选,用于审计记录)。
type: string
type: object
dto.SuperContentReviewForm:
properties:
action:
@@ -3345,6 +3420,65 @@ paths:
summary: Delete comment
tags:
- Content
/super/v1/content-reports:
get:
consumes:
- application/json
description: List content report records across tenants
parameters:
- description: Page number
in: query
name: page
type: integer
- description: Page size
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
items:
$ref: '#/definitions/dto.SuperContentReportItem'
type: array
type: object
summary: List content reports
tags:
- Content
/super/v1/content-reports/{id}/process:
post:
consumes:
- application/json
description: Process a content report record
parameters:
- description: Report ID
format: int64
in: path
name: id
required: true
type: integer
- description: Process form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.SuperContentReportProcessForm'
produces:
- application/json
responses:
"200":
description: Processed
schema:
type: string
summary: Process content report
tags:
- Content
/super/v1/contents:
get:
consumes: