feat: add super admin health review

This commit is contained in:
2026-01-13 15:02:05 +08:00
parent 19b15bf20a
commit 5ac2ea028c
10 changed files with 1208 additions and 0 deletions

View File

@@ -133,6 +133,48 @@ const docTemplate = `{
}
}
},
"/super/v1/contents/{id}/review": {
"post": {
"description": "Review content",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Content"
],
"summary": "Review content",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Content ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Review form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperContentReviewForm"
}
}
],
"responses": {
"200": {
"description": "Reviewed",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/orders": {
"get": {
"description": "List orders",
@@ -373,6 +415,58 @@ const docTemplate = `{
}
}
},
"/super/v1/tenants/health": {
"get": {
"description": "Tenant health overview",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Tenant"
],
"summary": "Tenant health overview",
"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.TenantHealthItem"
}
}
}
}
]
}
}
}
}
},
"/super/v1/tenants/statuses": {
"get": {
"description": "Tenant statuses",
@@ -4677,6 +4771,26 @@ const docTemplate = `{
}
}
},
"dto.SuperContentReviewForm": {
"type": "object",
"required": [
"action"
],
"properties": {
"action": {
"description": "Action 审核动作approve/reject。",
"type": "string",
"enum": [
"approve",
"reject"
]
},
"reason": {
"description": "Reason 审核说明(驳回时填写,便于作者修正)。",
"type": "string"
}
}
},
"dto.SuperContentTenantLite": {
"type": "object",
"properties": {
@@ -5004,6 +5118,90 @@ const docTemplate = `{
}
}
},
"dto.TenantHealthItem": {
"type": "object",
"properties": {
"alerts": {
"description": "Alerts 异常提示列表(用于运营侧提示)。",
"type": "array",
"items": {
"type": "string"
}
},
"code": {
"description": "Code 租户编码。",
"type": "string"
},
"content_count": {
"description": "ContentCount 内容总数。",
"type": "integer"
},
"health_level": {
"description": "HealthLevel 健康等级healthy/warning/risk。",
"type": "string"
},
"last_paid_at": {
"description": "LastPaidAt 最近成交时间RFC3339空代表暂无成交。",
"type": "string"
},
"member_count": {
"description": "MemberCount 租户成员数量(包含管理员)。",
"type": "integer"
},
"name": {
"description": "Name 租户名称。",
"type": "string"
},
"owner": {
"description": "Owner 租户所有者信息。",
"allOf": [
{
"$ref": "#/definitions/dto.TenantOwnerUserLite"
}
]
},
"paid_amount": {
"description": "PaidAmount 已支付金额(分)。",
"type": "integer"
},
"paid_orders": {
"description": "PaidOrders 已支付订单数(内容购买)。",
"type": "integer"
},
"published_content_count": {
"description": "PublishedContentCount 已发布内容数量。",
"type": "integer"
},
"refund_amount": {
"description": "RefundAmount 已退款金额(分)。",
"type": "integer"
},
"refund_orders": {
"description": "RefundOrders 已退款订单数(内容购买)。",
"type": "integer"
},
"refund_rate": {
"description": "RefundRate 退款率(退款订单数 / 已支付订单数)。",
"type": "number"
},
"status": {
"description": "Status 租户状态。",
"allOf": [
{
"$ref": "#/definitions/consts.TenantStatus"
}
]
},
"status_description": {
"description": "StatusDescription 租户状态描述(用于展示)。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID。",
"type": "integer"
}
}
},
"dto.TenantInviteAcceptForm": {
"type": "object",
"properties": {

View File

@@ -127,6 +127,48 @@
}
}
},
"/super/v1/contents/{id}/review": {
"post": {
"description": "Review content",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Content"
],
"summary": "Review content",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Content ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Review form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperContentReviewForm"
}
}
],
"responses": {
"200": {
"description": "Reviewed",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/orders": {
"get": {
"description": "List orders",
@@ -367,6 +409,58 @@
}
}
},
"/super/v1/tenants/health": {
"get": {
"description": "Tenant health overview",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Tenant"
],
"summary": "Tenant health overview",
"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.TenantHealthItem"
}
}
}
}
]
}
}
}
}
},
"/super/v1/tenants/statuses": {
"get": {
"description": "Tenant statuses",
@@ -4671,6 +4765,26 @@
}
}
},
"dto.SuperContentReviewForm": {
"type": "object",
"required": [
"action"
],
"properties": {
"action": {
"description": "Action 审核动作approve/reject。",
"type": "string",
"enum": [
"approve",
"reject"
]
},
"reason": {
"description": "Reason 审核说明(驳回时填写,便于作者修正)。",
"type": "string"
}
}
},
"dto.SuperContentTenantLite": {
"type": "object",
"properties": {
@@ -4998,6 +5112,90 @@
}
}
},
"dto.TenantHealthItem": {
"type": "object",
"properties": {
"alerts": {
"description": "Alerts 异常提示列表(用于运营侧提示)。",
"type": "array",
"items": {
"type": "string"
}
},
"code": {
"description": "Code 租户编码。",
"type": "string"
},
"content_count": {
"description": "ContentCount 内容总数。",
"type": "integer"
},
"health_level": {
"description": "HealthLevel 健康等级healthy/warning/risk。",
"type": "string"
},
"last_paid_at": {
"description": "LastPaidAt 最近成交时间RFC3339空代表暂无成交。",
"type": "string"
},
"member_count": {
"description": "MemberCount 租户成员数量(包含管理员)。",
"type": "integer"
},
"name": {
"description": "Name 租户名称。",
"type": "string"
},
"owner": {
"description": "Owner 租户所有者信息。",
"allOf": [
{
"$ref": "#/definitions/dto.TenantOwnerUserLite"
}
]
},
"paid_amount": {
"description": "PaidAmount 已支付金额(分)。",
"type": "integer"
},
"paid_orders": {
"description": "PaidOrders 已支付订单数(内容购买)。",
"type": "integer"
},
"published_content_count": {
"description": "PublishedContentCount 已发布内容数量。",
"type": "integer"
},
"refund_amount": {
"description": "RefundAmount 已退款金额(分)。",
"type": "integer"
},
"refund_orders": {
"description": "RefundOrders 已退款订单数(内容购买)。",
"type": "integer"
},
"refund_rate": {
"description": "RefundRate 退款率(退款订单数 / 已支付订单数)。",
"type": "number"
},
"status": {
"description": "Status 租户状态。",
"allOf": [
{
"$ref": "#/definitions/consts.TenantStatus"
}
]
},
"status_description": {
"description": "StatusDescription 租户状态描述(用于展示)。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID。",
"type": "integer"
}
}
},
"dto.TenantInviteAcceptForm": {
"type": "object",
"properties": {

View File

@@ -879,6 +879,20 @@ definitions:
description: Likes 累计点赞数。
type: integer
type: object
dto.SuperContentReviewForm:
properties:
action:
description: Action 审核动作approve/reject
enum:
- approve
- reject
type: string
reason:
description: Reason 审核说明(驳回时填写,便于作者修正)。
type: string
required:
- action
type: object
dto.SuperContentTenantLite:
properties:
code:
@@ -1093,6 +1107,64 @@ definitions:
required:
- duration
type: object
dto.TenantHealthItem:
properties:
alerts:
description: Alerts 异常提示列表(用于运营侧提示)。
items:
type: string
type: array
code:
description: Code 租户编码。
type: string
content_count:
description: ContentCount 内容总数。
type: integer
health_level:
description: HealthLevel 健康等级healthy/warning/risk
type: string
last_paid_at:
description: LastPaidAt 最近成交时间RFC3339空代表暂无成交
type: string
member_count:
description: MemberCount 租户成员数量(包含管理员)。
type: integer
name:
description: Name 租户名称。
type: string
owner:
allOf:
- $ref: '#/definitions/dto.TenantOwnerUserLite'
description: Owner 租户所有者信息。
paid_amount:
description: PaidAmount 已支付金额(分)。
type: integer
paid_orders:
description: PaidOrders 已支付订单数(内容购买)。
type: integer
published_content_count:
description: PublishedContentCount 已发布内容数量。
type: integer
refund_amount:
description: RefundAmount 已退款金额(分)。
type: integer
refund_orders:
description: RefundOrders 已退款订单数(内容购买)。
type: integer
refund_rate:
description: RefundRate 退款率(退款订单数 / 已支付订单数)。
type: number
status:
allOf:
- $ref: '#/definitions/consts.TenantStatus'
description: Status 租户状态。
status_description:
description: StatusDescription 租户状态描述(用于展示)。
type: string
tenant_id:
description: TenantID 租户ID。
type: integer
type: object
dto.TenantInviteAcceptForm:
properties:
code:
@@ -1827,6 +1899,34 @@ paths:
summary: List contents
tags:
- Content
/super/v1/contents/{id}/review:
post:
consumes:
- application/json
description: Review content
parameters:
- description: Content ID
format: int64
in: path
name: id
required: true
type: integer
- description: Review form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.SuperContentReviewForm'
produces:
- application/json
responses:
"200":
description: Reviewed
schema:
type: string
summary: Review content
tags:
- Content
/super/v1/orders:
get:
consumes:
@@ -2164,6 +2264,37 @@ paths:
summary: List tenant users
tags:
- Tenant
/super/v1/tenants/health:
get:
consumes:
- application/json
description: Tenant health overview
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.TenantHealthItem'
type: array
type: object
summary: Tenant health overview
tags:
- Tenant
/super/v1/tenants/statuses:
get:
consumes: