feat: add superadmin creator review and coupon governance
This commit is contained in:
47
backend/app/http/super/v1/creator_applications.go
Normal file
47
backend/app/http/super/v1/creator_applications.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 creatorApplications struct{}
|
||||
|
||||
// List creator applications
|
||||
//
|
||||
// @Router /super/v1/creator-applications [get]
|
||||
// @Summary List creator applications
|
||||
// @Description List creator applications across tenants
|
||||
// @Tags Creator
|
||||
// @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.TenantItem}
|
||||
// @Bind filter query
|
||||
func (c *creatorApplications) List(ctx fiber.Ctx, filter *dto.TenantListFilter) (*requests.Pager, error) {
|
||||
return services.Super.ListCreatorApplications(ctx, filter)
|
||||
}
|
||||
|
||||
// Review creator application
|
||||
//
|
||||
// @Router /super/v1/creator-applications/:id<int>/review [post]
|
||||
// @Summary Review creator application
|
||||
// @Description Approve or reject creator application
|
||||
// @Tags Creator
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int64 true "Tenant ID"
|
||||
// @Param form body dto.SuperCreatorApplicationReviewForm true "Review form"
|
||||
// @Success 200 {string} string "Reviewed"
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id path
|
||||
// @Bind form body
|
||||
func (c *creatorApplications) Review(ctx fiber.Ctx, user *models.User, id int64, form *dto.SuperCreatorApplicationReviewForm) error {
|
||||
return services.Super.ReviewCreatorApplication(ctx, user.ID, id, form)
|
||||
}
|
||||
Reference in New Issue
Block a user