package service

import (
	"context"
	"github.com/sirupsen/logrus"
	"youngee_b_api/db"
	"youngee_b_api/model/http_model"
)

var Talent *talent

type talent struct {
}

func (*talent) GetGoodsTalentList(ctx context.Context, request http_model.GetGoodsTalentRequest) (*http_model.GetGoodsTalentListData, error) {
	res, err := db.GetGoodstalentList(ctx, request)
	if err != nil {
		logrus.WithContext(ctx).Errorf("[talent service] call GetGoodsTalentList error,err:%+v", err)
		return nil, err
	}
	return res, nil
}

func (*talent) GetProjectTalentList(ctx context.Context, request http_model.GetProjectTalentRequest) (*http_model.GetProjectTalentListData, error) {
	res, err := db.GetProjecttalentList(ctx, request)
	if err != nil {
		logrus.WithContext(ctx).Errorf("[talent service] call GetProjectTalentList error,err:%+v", err)
		return nil, err
	}
	return res, nil
}

func (*talent) GetLocallifeTalentList(ctx context.Context, request http_model.GetLocallifeTalentRequest) (*http_model.GetLocallifeTalentListData, error) {
	res, err := db.GetLocallifetalentList(ctx, request)
	if err != nil {
		logrus.WithContext(ctx).Errorf("[talent service] call GetLocallifeTalentList error,err:%+v", err)
		return nil, err
	}
	return res, nil
}
