- 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.
31 lines
829 B
Go
31 lines
829 B
Go
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)
|
|
}
|