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

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

func (l *GeneratePlacementTopicContentMatrixLogic) GeneratePlacementTopicContentMatrix(req *types.GeneratePlacementTopicContentMatrixHandlerReq) (*types.ContentMatrixData, error) {
	if _, _, err := actorFrom(l.ctx); err != nil {
		return nil, err
	}
	return brandlogic.NewGenerateBrandContentMatrixLogic(l.ctx, l.svcCtx).GenerateBrandContentMatrix(&types.GenerateContentMatrixHandlerReq{
		BrandPath: types.BrandPath{ID: req.ID},
		GenerateContentMatrixReq: types.GenerateContentMatrixReq{
			Count: req.Count,
		},
	})
}
