feat: expand superadmin edits and minio docs

This commit is contained in:
2026-01-17 19:32:46 +08:00
parent 3af5b20bcc
commit 984a404b5f
25 changed files with 2688 additions and 36 deletions

View File

@@ -2,8 +2,10 @@ package v1
import (
dto "quyun/v2/app/http/super/v1/dto"
v1_dto "quyun/v2/app/http/v1/dto"
"quyun/v2/app/requests"
"quyun/v2/app/services"
"quyun/v2/database/models"
"github.com/gofiber/fiber/v3"
)
@@ -26,3 +28,36 @@ type creators struct{}
func (c *creators) List(ctx fiber.Ctx, filter *dto.TenantListFilter) (*requests.Pager, error) {
return services.Super.ListTenants(ctx, filter)
}
// Get creator settings
//
// @Router /super/v1/creators/:tenantID<int>/settings [get]
// @Summary Get creator settings
// @Description Get creator settings by tenant ID
// @Tags Creator
// @Accept json
// @Produce json
// @Param tenantID path int64 true "Tenant ID"
// @Success 200 {object} v1_dto.Settings
// @Bind tenantID path
func (c *creators) GetSettings(ctx fiber.Ctx, tenantID int64) (*v1_dto.Settings, error) {
return services.Super.GetCreatorSettings(ctx, tenantID)
}
// Update creator settings
//
// @Router /super/v1/creators/:tenantID<int>/settings [put]
// @Summary Update creator settings
// @Description Update creator settings by tenant ID
// @Tags Creator
// @Accept json
// @Produce json
// @Param tenantID path int64 true "Tenant ID"
// @Param form body v1_dto.Settings true "Settings form"
// @Success 200 {string} string "Updated"
// @Bind user local key(__ctx_user)
// @Bind tenantID path
// @Bind form body
func (c *creators) UpdateSettings(ctx fiber.Ctx, user *models.User, tenantID int64, form *v1_dto.Settings) error {
return services.Super.UpdateCreatorSettings(ctx, user.ID, tenantID, form)
}