64 lines
2.0 KiB
Go
64 lines
2.0 KiB
Go
package v1
|
|
|
|
import (
|
|
dto "quyun/v2/app/http/super/v1/dto"
|
|
"quyun/v2/app/requests"
|
|
"quyun/v2/app/services"
|
|
"quyun/v2/database/models"
|
|
|
|
"github.com/gofiber/fiber/v3"
|
|
)
|
|
|
|
// @provider
|
|
type contentReports struct{}
|
|
|
|
// List content reports
|
|
//
|
|
// @Router /super/v1/content-reports [get]
|
|
// @Summary List content reports
|
|
// @Description List content report records across tenants
|
|
// @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.SuperContentReportItem}
|
|
// @Bind filter query
|
|
func (c *contentReports) List(ctx fiber.Ctx, filter *dto.SuperContentReportListFilter) (*requests.Pager, error) {
|
|
return services.Super.ListContentReports(ctx, filter)
|
|
}
|
|
|
|
// Process content report
|
|
//
|
|
// @Router /super/v1/content-reports/:id<int>/process [post]
|
|
// @Summary Process content report
|
|
// @Description Process a content report record
|
|
// @Tags Content
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param id path int64 true "Report ID"
|
|
// @Param form body dto.SuperContentReportProcessForm true "Process form"
|
|
// @Success 200 {string} string "Processed"
|
|
// @Bind user local key(__ctx_user)
|
|
// @Bind id path
|
|
// @Bind form body
|
|
func (c *contentReports) Process(ctx fiber.Ctx, user *models.User, id int64, form *dto.SuperContentReportProcessForm) error {
|
|
return services.Super.ProcessContentReport(ctx, user.ID, id, form)
|
|
}
|
|
|
|
// Batch process content reports
|
|
//
|
|
// @Router /super/v1/content-reports/process/batch [post]
|
|
// @Summary Batch process content reports
|
|
// @Description Batch process content report records
|
|
// @Tags Content
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param form body dto.SuperContentReportBatchProcessForm true "Batch process form"
|
|
// @Success 200 {string} string "Processed"
|
|
// @Bind user local key(__ctx_user)
|
|
// @Bind form body
|
|
func (c *contentReports) BatchProcess(ctx fiber.Ctx, user *models.User, form *dto.SuperContentReportBatchProcessForm) error {
|
|
return services.Super.BatchProcessContentReports(ctx, user.ID, form)
|
|
}
|