feat(editor): update
This commit is contained in:
@@ -24,7 +24,7 @@ type Creator struct{}
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind form body
|
||||
func (c *Creator) Apply(ctx fiber.Ctx, user *models.User, form *dto.ApplyForm) error {
|
||||
return services.Creator.Apply(ctx.Context(), user.ID, form)
|
||||
return services.Creator.Apply(ctx, user.ID, form)
|
||||
}
|
||||
|
||||
// Get creator dashboard stats
|
||||
@@ -38,7 +38,23 @@ func (c *Creator) Apply(ctx fiber.Ctx, user *models.User, form *dto.ApplyForm) e
|
||||
// @Success 200 {object} dto.DashboardStats
|
||||
// @Bind user local key(__ctx_user)
|
||||
func (c *Creator) Dashboard(ctx fiber.Ctx, user *models.User) (*dto.DashboardStats, error) {
|
||||
return services.Creator.Dashboard(ctx.Context(), user.ID)
|
||||
return services.Creator.Dashboard(ctx, user.ID)
|
||||
}
|
||||
|
||||
// Get content details for edit
|
||||
//
|
||||
// @Router /v1/creator/contents/:id [get]
|
||||
// @Summary Get content
|
||||
// @Description Get content details for edit
|
||||
// @Tags CreatorCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path string true "Content ID"
|
||||
// @Success 200 {object} dto.ContentEditDTO
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id path
|
||||
func (c *Creator) GetContent(ctx fiber.Ctx, user *models.User, id string) (*dto.ContentEditDTO, error) {
|
||||
return services.Creator.GetContent(ctx, user.ID, id)
|
||||
}
|
||||
|
||||
// List creator contents
|
||||
@@ -60,7 +76,7 @@ func (c *Creator) ListContents(
|
||||
user *models.User,
|
||||
filter *dto.CreatorContentListFilter,
|
||||
) ([]dto.ContentItem, error) {
|
||||
return services.Creator.ListContents(ctx.Context(), user.ID, filter)
|
||||
return services.Creator.ListContents(ctx, user.ID, filter)
|
||||
}
|
||||
|
||||
// Create/Publish content
|
||||
@@ -76,7 +92,7 @@ func (c *Creator) ListContents(
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind form body
|
||||
func (c *Creator) CreateContent(ctx fiber.Ctx, user *models.User, form *dto.ContentCreateForm) error {
|
||||
return services.Creator.CreateContent(ctx.Context(), user.ID, form)
|
||||
return services.Creator.CreateContent(ctx, user.ID, form)
|
||||
}
|
||||
|
||||
// Update content
|
||||
@@ -94,7 +110,7 @@ func (c *Creator) CreateContent(ctx fiber.Ctx, user *models.User, form *dto.Cont
|
||||
// @Bind id path
|
||||
// @Bind form body
|
||||
func (c *Creator) UpdateContent(ctx fiber.Ctx, user *models.User, id string, form *dto.ContentUpdateForm) error {
|
||||
return services.Creator.UpdateContent(ctx.Context(), user.ID, id, form)
|
||||
return services.Creator.UpdateContent(ctx, user.ID, id, form)
|
||||
}
|
||||
|
||||
// Delete content
|
||||
@@ -110,7 +126,7 @@ func (c *Creator) UpdateContent(ctx fiber.Ctx, user *models.User, id string, for
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id path
|
||||
func (c *Creator) DeleteContent(ctx fiber.Ctx, user *models.User, id string) error {
|
||||
return services.Creator.DeleteContent(ctx.Context(), user.ID, id)
|
||||
return services.Creator.DeleteContent(ctx, user.ID, id)
|
||||
}
|
||||
|
||||
// List sales orders
|
||||
@@ -131,7 +147,7 @@ func (c *Creator) ListOrders(
|
||||
user *models.User,
|
||||
filter *dto.CreatorOrderListFilter,
|
||||
) ([]dto.Order, error) {
|
||||
return services.Creator.ListOrders(ctx.Context(), user.ID, filter)
|
||||
return services.Creator.ListOrders(ctx, user.ID, filter)
|
||||
}
|
||||
|
||||
// Process refund
|
||||
@@ -149,7 +165,7 @@ func (c *Creator) ListOrders(
|
||||
// @Bind id path
|
||||
// @Bind form body
|
||||
func (c *Creator) Refund(ctx fiber.Ctx, user *models.User, id string, form *dto.RefundForm) error {
|
||||
return services.Creator.ProcessRefund(ctx.Context(), user.ID, id, form)
|
||||
return services.Creator.ProcessRefund(ctx, user.ID, id, form)
|
||||
}
|
||||
|
||||
// Get channel settings
|
||||
@@ -163,7 +179,7 @@ func (c *Creator) Refund(ctx fiber.Ctx, user *models.User, id string, form *dto.
|
||||
// @Success 200 {object} dto.Settings
|
||||
// @Bind user local key(__ctx_user)
|
||||
func (c *Creator) GetSettings(ctx fiber.Ctx, user *models.User) (*dto.Settings, error) {
|
||||
return services.Creator.GetSettings(ctx.Context(), user.ID)
|
||||
return services.Creator.GetSettings(ctx, user.ID)
|
||||
}
|
||||
|
||||
// Update channel settings
|
||||
@@ -179,7 +195,7 @@ func (c *Creator) GetSettings(ctx fiber.Ctx, user *models.User) (*dto.Settings,
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind form body
|
||||
func (c *Creator) UpdateSettings(ctx fiber.Ctx, user *models.User, form *dto.Settings) error {
|
||||
return services.Creator.UpdateSettings(ctx.Context(), user.ID, form)
|
||||
return services.Creator.UpdateSettings(ctx, user.ID, form)
|
||||
}
|
||||
|
||||
// List payout accounts
|
||||
@@ -193,7 +209,7 @@ func (c *Creator) UpdateSettings(ctx fiber.Ctx, user *models.User, form *dto.Set
|
||||
// @Success 200 {array} dto.PayoutAccount
|
||||
// @Bind user local key(__ctx_user)
|
||||
func (c *Creator) ListPayoutAccounts(ctx fiber.Ctx, user *models.User) ([]dto.PayoutAccount, error) {
|
||||
return services.Creator.ListPayoutAccounts(ctx.Context(), user.ID)
|
||||
return services.Creator.ListPayoutAccounts(ctx, user.ID)
|
||||
}
|
||||
|
||||
// Add payout account
|
||||
@@ -209,7 +225,7 @@ func (c *Creator) ListPayoutAccounts(ctx fiber.Ctx, user *models.User) ([]dto.Pa
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind form body
|
||||
func (c *Creator) AddPayoutAccount(ctx fiber.Ctx, user *models.User, form *dto.PayoutAccount) error {
|
||||
return services.Creator.AddPayoutAccount(ctx.Context(), user.ID, form)
|
||||
return services.Creator.AddPayoutAccount(ctx, user.ID, form)
|
||||
}
|
||||
|
||||
// Remove payout account
|
||||
@@ -225,7 +241,7 @@ func (c *Creator) AddPayoutAccount(ctx fiber.Ctx, user *models.User, form *dto.P
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id query
|
||||
func (c *Creator) RemovePayoutAccount(ctx fiber.Ctx, user *models.User, id string) error {
|
||||
return services.Creator.RemovePayoutAccount(ctx.Context(), user.ID, id)
|
||||
return services.Creator.RemovePayoutAccount(ctx, user.ID, id)
|
||||
}
|
||||
|
||||
// Request withdrawal
|
||||
@@ -241,5 +257,5 @@ func (c *Creator) RemovePayoutAccount(ctx fiber.Ctx, user *models.User, id strin
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind form body
|
||||
func (c *Creator) Withdraw(ctx fiber.Ctx, user *models.User, form *dto.WithdrawForm) error {
|
||||
return services.Creator.Withdraw(ctx.Context(), user.ID, form)
|
||||
return services.Creator.Withdraw(ctx, user.ID, form)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user