package v1

import (
	dto "quyun/v2/app/http/super/v1/dto"
	"quyun/v2/app/requests"
	"quyun/v2/app/services"

	"github.com/gofiber/fiber/v3"
)

// @provider
type contents struct{}

// List contents
//
// @Router /super/v1/contents [get]
// @Summary List contents
// @Description List contents
// @Tags Content
// @Accept json
// @Produce json
// @Param page query int false "Page number"
// @Param limit query int false "Page size"
// @Success 200 {object} requests.Pager{items=[]dto.AdminContentItem}
// @Bind filter query
func (c *contents) List(ctx fiber.Ctx, filter *dto.SuperContentListFilter) (*requests.Pager, error) {
	return services.Super.ListContents(ctx, filter)
}

// Update content status
//
// @Router /super/v1/tenants/:tenantID/contents/:contentID/status [patch]
// @Summary Update content status
// @Description Update content status
// @Tags Content
// @Accept json
// @Produce json
// @Param tenantID path int64 true "Tenant ID"
// @Param contentID path int64 true "Content ID"
// @Param form body dto.SuperTenantContentStatusUpdateForm true "Update form"
// @Success 200 {string} string "Updated"
// @Bind tenantID path
// @Bind contentID path
// @Bind form body
func (c *contents) UpdateStatus(ctx fiber.Ctx, tenantID, contentID int64, form *dto.SuperTenantContentStatusUpdateForm) error {
	return services.Super.UpdateContentStatus(ctx, tenantID, contentID, form)
}
