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 payoutAccounts struct{} // List payout accounts // // @Router /super/v1/payout-accounts [get] // @Summary List payout accounts // @Description List payout accounts across tenants // @Tags Finance // @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.SuperPayoutAccountItem} // @Bind filter query func (c *payoutAccounts) List(ctx fiber.Ctx, filter *dto.SuperPayoutAccountListFilter) (*requests.Pager, error) { return services.Super.ListPayoutAccounts(ctx, filter) } // Create payout account // // @Router /super/v1/creators/:tenantID/payout-accounts [post] // @Summary Create payout account // @Description Create payout account for tenant // @Tags Finance // @Accept json // @Produce json // @Param tenantID path int64 true "Tenant ID" // @Param form body dto.SuperPayoutAccountCreateForm true "Create form" // @Success 200 {string} string "Created" // @Bind user local key(__ctx_user) // @Bind tenantID path // @Bind form body func (c *payoutAccounts) Create(ctx fiber.Ctx, user *models.User, tenantID int64, form *dto.SuperPayoutAccountCreateForm) error { return services.Super.CreatePayoutAccount(ctx, user.ID, tenantID, form) } // Remove payout account // // @Router /super/v1/payout-accounts/:id [delete] // @Summary Remove payout account // @Description Remove payout account across tenants // @Tags Finance // @Accept json // @Produce json // @Param id path int64 true "Payout account ID" // @Success 200 {string} string "Removed" // @Bind user local key(__ctx_user) // @Bind id path func (c *payoutAccounts) Remove(ctx fiber.Ctx, user *models.User, id int64) error { return services.Super.RemovePayoutAccount(ctx, user.ID, id) } // Review payout account // // @Router /super/v1/payout-accounts/:id/review [post] // @Summary Review payout account // @Description Review payout account across tenants // @Tags Finance // @Accept json // @Produce json // @Param id path int64 true "Payout account ID" // @Param form body dto.SuperPayoutAccountReviewForm true "Review form" // @Success 200 {string} string "Reviewed" // @Bind user local key(__ctx_user) // @Bind id path // @Bind form body func (c *payoutAccounts) Review(ctx fiber.Ctx, user *models.User, id int64, form *dto.SuperPayoutAccountReviewForm) error { return services.Super.ReviewPayoutAccount(ctx, user.ID, id, form) } // Update payout account // // @Router /super/v1/payout-accounts/:id [patch] // @Summary Update payout account // @Description Update payout account across tenants // @Tags Finance // @Accept json // @Produce json // @Param id path int64 true "Payout account ID" // @Param form body dto.SuperPayoutAccountUpdateForm true "Update form" // @Success 200 {string} string "Updated" // @Bind user local key(__ctx_user) // @Bind id path // @Bind form body func (c *payoutAccounts) Update(ctx fiber.Ctx, user *models.User, id int64, form *dto.SuperPayoutAccountUpdateForm) error { return services.Super.UpdatePayoutAccount(ctx, user.ID, id, form) }