// Code scaffolded by goctl. Safe to edit.
// goctl 1.10.1

package persona

import (
	"context"

	"haixun-backend/internal/svc"
	"haixun-backend/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type DeleteStylePresetLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewDeleteStylePresetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteStylePresetLogic {
	return &DeleteStylePresetLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *DeleteStylePresetLogic) DeleteStylePreset(req *types.StylePresetPath) error {
	tenantID, uid, err := actorFrom(l.ctx)
	if err != nil {
		return err
	}
	return l.svcCtx.StylePreset.Delete(l.ctx, tenantID, uid, req.ID, req.PresetID)
}
