feat: add content management feature for superadmin

- Implemented API endpoint for fetching content list with filtering, sorting, and pagination.
- Added DTOs for content items and tenant information.
- Created frontend components for content management, including search and data table functionalities.
- Updated routing to include content management page.
- Enhanced the superadmin menu to navigate to the new content management section.
- Included necessary styles and scripts for the new content management interface.
This commit is contained in:
2025-12-24 16:24:50 +08:00
parent 568f5cda43
commit d60c1e9312
14 changed files with 1373 additions and 8 deletions

View File

@@ -71,6 +71,165 @@
}
}
},
"/super/v1/contents": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Super"
],
"summary": "内容列表(平台侧汇总)",
"parameters": [
{
"type": "string",
"description": "Asc specifies comma-separated field names to sort ascending by.",
"name": "asc",
"in": "query"
},
{
"type": "string",
"name": "created_at_from",
"in": "query"
},
{
"type": "string",
"name": "created_at_to",
"in": "query"
},
{
"type": "string",
"description": "Desc specifies comma-separated field names to sort descending by.",
"name": "desc",
"in": "query"
},
{
"type": "integer",
"name": "id",
"in": "query"
},
{
"type": "string",
"name": "keyword",
"in": "query"
},
{
"type": "integer",
"description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "price_amount_max",
"in": "query"
},
{
"type": "integer",
"name": "price_amount_min",
"in": "query"
},
{
"type": "string",
"name": "published_at_from",
"in": "query"
},
{
"type": "string",
"name": "published_at_to",
"in": "query"
},
{
"enum": [
"draft",
"reviewing",
"published",
"unpublished",
"blocked"
],
"type": "string",
"x-enum-varnames": [
"ContentStatusDraft",
"ContentStatusReviewing",
"ContentStatusPublished",
"ContentStatusUnpublished",
"ContentStatusBlocked"
],
"name": "status",
"in": "query"
},
{
"type": "string",
"name": "tenant_code",
"in": "query"
},
{
"type": "integer",
"name": "tenant_id",
"in": "query"
},
{
"type": "string",
"name": "tenant_name",
"in": "query"
},
{
"type": "integer",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"name": "username",
"in": "query"
},
{
"enum": [
"public",
"tenant_only",
"private"
],
"type": "string",
"x-enum-varnames": [
"ContentVisibilityPublic",
"ContentVisibilityTenantOnly",
"ContentVisibilityPrivate"
],
"name": "visibility",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/requests.Pager"
},
{
"type": "object",
"properties": {
"items": {
"$ref": "#/definitions/dto.SuperContentItem"
}
}
}
]
}
}
}
}
},
"/super/v1/orders": {
"get": {
"consumes": [
@@ -4461,6 +4620,43 @@
}
}
},
"dto.SuperContentItem": {
"type": "object",
"properties": {
"content": {
"$ref": "#/definitions/models.Content"
},
"owner": {
"$ref": "#/definitions/dto.SuperUserLite"
},
"price": {
"$ref": "#/definitions/models.ContentPrice"
},
"status_description": {
"type": "string"
},
"tenant": {
"$ref": "#/definitions/dto.SuperContentTenantLite"
},
"visibility_description": {
"type": "string"
}
}
},
"dto.SuperContentTenantLite": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.SuperOrderDetail": {
"type": "object",
"properties": {