feat: add audit logs and system configs

This commit is contained in:
2026-01-15 20:07:36 +08:00
parent 914df9edf2
commit b3fc226bbe
25 changed files with 3325 additions and 108 deletions

View File

@@ -138,6 +138,58 @@ const docTemplate = `{
}
}
},
"/super/v1/audit-logs": {
"get": {
"description": "List audit logs across tenants",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Audit"
],
"summary": "List audit logs",
"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.SuperAuditLogItem"
}
}
}
}
]
}
}
}
}
},
"/super/v1/auth/login": {
"post": {
"description": "Login",
@@ -1138,6 +1190,132 @@ const docTemplate = `{
}
}
},
"/super/v1/system-configs": {
"get": {
"description": "List platform system configs",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SystemConfig"
],
"summary": "List system configs",
"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.SuperSystemConfigItem"
}
}
}
}
]
}
}
}
},
"post": {
"description": "Create platform system config",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SystemConfig"
],
"summary": "Create system config",
"parameters": [
{
"description": "Create form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigCreateForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigItem"
}
}
}
}
},
"/super/v1/system-configs/{id}": {
"patch": {
"description": "Update platform system config",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SystemConfig"
],
"summary": "Update system config",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Config ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigUpdateForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigItem"
}
}
}
}
},
"/super/v1/tenant-join-requests": {
"get": {
"description": "List tenant join requests across tenants",
@@ -7212,6 +7390,51 @@ const docTemplate = `{
}
}
},
"dto.SuperAuditLogItem": {
"type": "object",
"properties": {
"action": {
"description": "Action 动作标识。",
"type": "string"
},
"created_at": {
"description": "CreatedAt 创建时间RFC3339。",
"type": "string"
},
"detail": {
"description": "Detail 操作详情。",
"type": "string"
},
"id": {
"description": "ID 审计日志ID。",
"type": "integer"
},
"operator_id": {
"description": "OperatorID 操作者用户ID。",
"type": "integer"
},
"operator_name": {
"description": "OperatorName 操作者用户名/昵称。",
"type": "string"
},
"target_id": {
"description": "TargetID 目标ID。",
"type": "string"
},
"tenant_code": {
"description": "TenantCode 租户编码。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID。",
"type": "integer"
},
"tenant_name": {
"description": "TenantName 租户名称。",
"type": "string"
}
}
},
"dto.SuperContentBatchReviewForm": {
"type": "object",
"required": [
@@ -7992,6 +8215,74 @@ const docTemplate = `{
}
}
},
"dto.SuperSystemConfigCreateForm": {
"type": "object",
"properties": {
"config_key": {
"description": "ConfigKey 配置项Key唯一。",
"type": "string"
},
"description": {
"description": "Description 配置说明。",
"type": "string"
},
"value": {
"description": "Value 配置值JSON。",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"dto.SuperSystemConfigItem": {
"type": "object",
"properties": {
"config_key": {
"description": "ConfigKey 配置项Key。",
"type": "string"
},
"created_at": {
"description": "CreatedAt 创建时间RFC3339。",
"type": "string"
},
"description": {
"description": "Description 配置说明。",
"type": "string"
},
"id": {
"description": "ID 配置ID。",
"type": "integer"
},
"updated_at": {
"description": "UpdatedAt 更新时间RFC3339。",
"type": "string"
},
"value": {
"description": "Value 配置值JSON。",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"dto.SuperSystemConfigUpdateForm": {
"type": "object",
"properties": {
"description": {
"description": "Description 配置说明(可选)。",
"type": "string"
},
"value": {
"description": "Value 配置值JSON可选。",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"dto.SuperTenantContentStatusUpdateForm": {
"type": "object",
"required": [

View File

@@ -132,6 +132,58 @@
}
}
},
"/super/v1/audit-logs": {
"get": {
"description": "List audit logs across tenants",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Audit"
],
"summary": "List audit logs",
"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.SuperAuditLogItem"
}
}
}
}
]
}
}
}
}
},
"/super/v1/auth/login": {
"post": {
"description": "Login",
@@ -1132,6 +1184,132 @@
}
}
},
"/super/v1/system-configs": {
"get": {
"description": "List platform system configs",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SystemConfig"
],
"summary": "List system configs",
"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.SuperSystemConfigItem"
}
}
}
}
]
}
}
}
},
"post": {
"description": "Create platform system config",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SystemConfig"
],
"summary": "Create system config",
"parameters": [
{
"description": "Create form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigCreateForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigItem"
}
}
}
}
},
"/super/v1/system-configs/{id}": {
"patch": {
"description": "Update platform system config",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SystemConfig"
],
"summary": "Update system config",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Config ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigUpdateForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SuperSystemConfigItem"
}
}
}
}
},
"/super/v1/tenant-join-requests": {
"get": {
"description": "List tenant join requests across tenants",
@@ -7206,6 +7384,51 @@
}
}
},
"dto.SuperAuditLogItem": {
"type": "object",
"properties": {
"action": {
"description": "Action 动作标识。",
"type": "string"
},
"created_at": {
"description": "CreatedAt 创建时间RFC3339。",
"type": "string"
},
"detail": {
"description": "Detail 操作详情。",
"type": "string"
},
"id": {
"description": "ID 审计日志ID。",
"type": "integer"
},
"operator_id": {
"description": "OperatorID 操作者用户ID。",
"type": "integer"
},
"operator_name": {
"description": "OperatorName 操作者用户名/昵称。",
"type": "string"
},
"target_id": {
"description": "TargetID 目标ID。",
"type": "string"
},
"tenant_code": {
"description": "TenantCode 租户编码。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID。",
"type": "integer"
},
"tenant_name": {
"description": "TenantName 租户名称。",
"type": "string"
}
}
},
"dto.SuperContentBatchReviewForm": {
"type": "object",
"required": [
@@ -7986,6 +8209,74 @@
}
}
},
"dto.SuperSystemConfigCreateForm": {
"type": "object",
"properties": {
"config_key": {
"description": "ConfigKey 配置项Key唯一。",
"type": "string"
},
"description": {
"description": "Description 配置说明。",
"type": "string"
},
"value": {
"description": "Value 配置值JSON。",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"dto.SuperSystemConfigItem": {
"type": "object",
"properties": {
"config_key": {
"description": "ConfigKey 配置项Key。",
"type": "string"
},
"created_at": {
"description": "CreatedAt 创建时间RFC3339。",
"type": "string"
},
"description": {
"description": "Description 配置说明。",
"type": "string"
},
"id": {
"description": "ID 配置ID。",
"type": "integer"
},
"updated_at": {
"description": "UpdatedAt 更新时间RFC3339。",
"type": "string"
},
"value": {
"description": "Value 配置值JSON。",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"dto.SuperSystemConfigUpdateForm": {
"type": "object",
"properties": {
"description": {
"description": "Description 配置说明(可选)。",
"type": "string"
},
"value": {
"description": "Value 配置值JSON可选。",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"dto.SuperTenantContentStatusUpdateForm": {
"type": "object",
"required": [

View File

@@ -1231,6 +1231,39 @@ definitions:
description: TotalSize 资产总大小(字节)。
type: integer
type: object
dto.SuperAuditLogItem:
properties:
action:
description: Action 动作标识。
type: string
created_at:
description: CreatedAt 创建时间RFC3339
type: string
detail:
description: Detail 操作详情。
type: string
id:
description: ID 审计日志ID。
type: integer
operator_id:
description: OperatorID 操作者用户ID。
type: integer
operator_name:
description: OperatorName 操作者用户名/昵称。
type: string
target_id:
description: TargetID 目标ID。
type: string
tenant_code:
description: TenantCode 租户编码。
type: string
tenant_id:
description: TenantID 租户ID。
type: integer
tenant_name:
description: TenantName 租户名称。
type: string
type: object
dto.SuperContentBatchReviewForm:
properties:
action:
@@ -1766,6 +1799,54 @@ definitions:
description: TenantID 租户ID不传代表全平台
type: integer
type: object
dto.SuperSystemConfigCreateForm:
properties:
config_key:
description: ConfigKey 配置项Key唯一
type: string
description:
description: Description 配置说明。
type: string
value:
description: Value 配置值JSON
items:
type: integer
type: array
type: object
dto.SuperSystemConfigItem:
properties:
config_key:
description: ConfigKey 配置项Key。
type: string
created_at:
description: CreatedAt 创建时间RFC3339
type: string
description:
description: Description 配置说明。
type: string
id:
description: ID 配置ID。
type: integer
updated_at:
description: UpdatedAt 更新时间RFC3339
type: string
value:
description: Value 配置值JSON
items:
type: integer
type: array
type: object
dto.SuperSystemConfigUpdateForm:
properties:
description:
description: Description 配置说明(可选)。
type: string
value:
description: Value 配置值JSON可选
items:
type: integer
type: array
type: object
dto.SuperTenantContentStatusUpdateForm:
properties:
status:
@@ -2936,6 +3017,37 @@ paths:
summary: Asset usage
tags:
- Asset
/super/v1/audit-logs:
get:
consumes:
- application/json
description: List audit logs 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.SuperAuditLogItem'
type: array
type: object
summary: List audit logs
tags:
- Audit
/super/v1/auth/login:
post:
consumes:
@@ -3562,6 +3674,86 @@ paths:
summary: Report overview
tags:
- Report
/super/v1/system-configs:
get:
consumes:
- application/json
description: List platform system configs
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.SuperSystemConfigItem'
type: array
type: object
summary: List system configs
tags:
- SystemConfig
post:
consumes:
- application/json
description: Create platform system config
parameters:
- description: Create form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.SuperSystemConfigCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.SuperSystemConfigItem'
summary: Create system config
tags:
- SystemConfig
/super/v1/system-configs/{id}:
patch:
consumes:
- application/json
description: Update platform system config
parameters:
- description: Config ID
format: int64
in: path
name: id
required: true
type: integer
- description: Update form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.SuperSystemConfigUpdateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.SuperSystemConfigItem'
summary: Update system config
tags:
- SystemConfig
/super/v1/tenant-join-requests:
get:
consumes: