package com.fizz.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fizz.business.domain.PlantConfig;
import com.fizz.business.mapper.PlantConfigMapper;
import com.fizz.business.service.PlantConfigService;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.stream.Collectors;

@Service
public class PlantConfigServiceImpl extends ServiceImpl<PlantConfigMapper, PlantConfig> implements PlantConfigService {
    @Override
    public Map<String, PlantConfig> getAllConfig() {
        return this.list().stream().collect(Collectors.toMap(
                PlantConfig::getVarname,
                obj -> obj,
                (key1 , key2) -> key1
        ));
    }
}
