package setting

import (
	"context"

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

type DeleteSettingLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewDeleteSettingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSettingLogic {
	return &DeleteSettingLogic{ctx: ctx, svcCtx: svcCtx}
}

func (l *DeleteSettingLogic) DeleteSetting(req *types.SettingKeyPath) error {
	return l.svcCtx.Setting.Delete(l.ctx, req.Scope, req.ScopeID, req.Key)
}
