package com.YuyeTech.TPlat.game.gameInfo.service;

import com.YuyeTech.TPlat.dto.PageInfoDTO;
import com.YuyeTech.TPlat.game.gameInfo.repository.FcCategoryReferenceRepository;
import com.YuyeTech.TPlat.game.gameInfo.repository.FcInfoRepository;
import com.YuyeTech.TPlat.utils.AliyunOSSUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;


/**
 * @author:slambb
 * @date:2020/6/24
 */
@Service
public class FcCategoryReferenceServiceImpl implements FcCategoryReferenceService {
    @Autowired
    private FcCategoryReferenceRepository fcCategoryReferenceRepository;

    @Autowired
    private FcInfoService fcInfoService;

    @Autowired
    private FcInfoRepository fcInfoRepository;

    @Autowired
    private AliyunOSSUtil aliyunOSSUtil;

    @Override
    public List<PageInfoDTO> findByGameId(String gameId, Pageable pageable) {
        return fcCategoryReferenceRepository.findByGameId(gameId,pageable).stream().map(e->new PageInfoDTO(e.getGameId().toString(),"1","1","1")).collect(Collectors.toList());

    }

}
