feat: add tenant content management features for superadmin
- Implemented API endpoints for listing tenant contents and updating content status.
- Added Swagger documentation for new endpoints:
- GET /super/v1/tenants/{tenantID}/contents
- PATCH /super/v1/tenants/{tenantID}/contents/{contentID}/status
- Created DTOs for content item and status update form.
- Enhanced frontend to support content management in the tenant detail page.
- Added search and filter functionalities for tenant contents.
- Implemented unpublish functionality with confirmation dialog.
- Updated service layer to handle new content management logic.
This commit is contained in:
30
backend/app/http/super/tenant_content.go
Normal file
30
backend/app/http/super/tenant_content.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package super
|
||||
|
||||
import (
|
||||
"quyun/v2/app/http/super/dto"
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/app/services"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
// contents
|
||||
//
|
||||
// @Summary 租户内容列表(平台侧)
|
||||
// @Tags Super
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param tenantID path int64 true "TenantID"
|
||||
// @Param filter query dto.TenantContentFilter true "Filter"
|
||||
// @Success 200 {object} requests.Pager{items=dto.SuperTenantContentItem}
|
||||
//
|
||||
// @Router /super/v1/tenants/:tenantID<int>/contents [get]
|
||||
// @Bind tenantID path
|
||||
// @Bind filter query
|
||||
func (*tenant) contents(ctx fiber.Ctx, tenantID int64, filter *dto.TenantContentFilter) (*requests.Pager, error) {
|
||||
if filter == nil {
|
||||
filter = &dto.TenantContentFilter{}
|
||||
}
|
||||
filter.Pagination.Format()
|
||||
return services.Content.SuperTenantContentsPage(ctx, tenantID, filter)
|
||||
}
|
||||
Reference in New Issue
Block a user