feat: add content report governance
This commit is contained in:
47
backend/app/http/super/v1/content_reports.go
Normal file
47
backend/app/http/super/v1/content_reports.go
Normal file
@@ -0,0 +1,47 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user