package placement_topic

import (
	"context"

	brandlogic "haixun-backend/internal/logic/brand"
	"haixun-backend/internal/svc"
	"haixun-backend/internal/types"

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

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

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

func (l *GetPlacementTopicScanScheduleLogic) GetPlacementTopicScanSchedule(req *types.PlacementTopicPath) (*types.BrandScanScheduleData, error) {
	if _, _, err := actorFrom(l.ctx); err != nil {
		return nil, err
	}
	return brandlogic.NewGetBrandScanScheduleLogic(l.ctx, l.svcCtx).GetBrandScanSchedule(&types.BrandPath{ID: req.ID})
}
