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 GetPlacementTopicContentMatrixLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

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

func (l *GetPlacementTopicContentMatrixLogic) GetPlacementTopicContentMatrix(req *types.PlacementTopicPath) (*types.ContentMatrixData, error) {
	if _, _, err := actorFrom(l.ctx); err != nil {
		return nil, err
	}
	return brandlogic.NewGetBrandContentMatrixLogic(l.ctx, l.svcCtx).GetBrandContentMatrix(&types.BrandPath{ID: req.ID})
}
