tenant: admin batch topup
This commit is contained in:
@@ -234,3 +234,39 @@ func (*orderAdmin) adminTopupUser(
|
||||
time.Now(),
|
||||
)
|
||||
}
|
||||
|
||||
// adminBatchTopupUsers
|
||||
//
|
||||
// @Summary 批量为租户成员充值(租户管理)
|
||||
// @Tags Tenant
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param tenantCode path string true "Tenant Code"
|
||||
// @Param form body dto.AdminBatchTopupForm true "Form"
|
||||
// @Success 200 {object} dto.AdminBatchTopupResponse
|
||||
//
|
||||
// @Router /t/:tenantCode/v1/admin/users/topup/batch [post]
|
||||
// @Bind tenant local key(tenant)
|
||||
// @Bind tenantUser local key(tenant_user)
|
||||
// @Bind form body
|
||||
func (*orderAdmin) adminBatchTopupUsers(
|
||||
ctx fiber.Ctx,
|
||||
tenant *models.Tenant,
|
||||
tenantUser *models.TenantUser,
|
||||
form *dto.AdminBatchTopupForm,
|
||||
) (*dto.AdminBatchTopupResponse, error) {
|
||||
if err := requireTenantAdmin(tenantUser); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if form == nil {
|
||||
return nil, errorx.ErrInvalidParameter
|
||||
}
|
||||
|
||||
log.WithFields(log.Fields{
|
||||
"tenant_id": tenant.ID,
|
||||
"user_id": tenantUser.UserID,
|
||||
"total": len(form.Items),
|
||||
}).Info("tenant.admin.users.topup.batch")
|
||||
|
||||
return services.Order.AdminBatchTopupUsers(ctx, tenant.ID, tenantUser.UserID, form, time.Now())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user