package banner

import (
	"context"

	"sundynix-micro-go/app/plant/api/internal/types"
	plantModel "sundynix-micro-go/app/plant/model"

	"sundynix-micro-go/app/plant/api/internal/svc"

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

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

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

func (l *DeleteBannerLogic) DeleteBanner(req *types.IdReq) error {
	return l.svcCtx.DB.Where("id = ?", req.Id).Delete(&plantModel.Banner{}).Error
}
