package com.YuyeTech.TPlat.service.impl;

import com.YuyeTech.TPlat.dataobject.LevelCondition;
import com.YuyeTech.TPlat.dataobject.LevelJump;
import com.YuyeTech.TPlat.dataobject.UserLevel;
import com.YuyeTech.TPlat.dto.LevelConditionDTO;
import com.YuyeTech.TPlat.dto.LevelJumpDTO;
import com.YuyeTech.TPlat.repository.LevelConditionRepository;
import com.YuyeTech.TPlat.repository.LevelHonorRepository;
import com.YuyeTech.TPlat.repository.LevelJumpRepository;
import com.YuyeTech.TPlat.repository.UserLevelRepository;
import com.YuyeTech.TPlat.service.LevelConditionService;
import com.YuyeTech.TPlat.service.LevelJumpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;


/**
 * @author:slambb
 * @date:2021/8/7
 */
@Service
public class LevelConditionServiceImpl implements LevelConditionService {

    @Autowired
    private LevelConditionRepository levelConditionRepository;

    @Override
    public List<LevelConditionDTO> findByConditionUnlockIn(String conditionUnlock) {
        return levelConditionRepository.findByTypeAndLimitTypeIn(0,Pattern.compile(",").splitAsStream(conditionUnlock).map((x) -> Integer.parseInt(x))
                .collect(Collectors.toList()));
    }
}
