package jnpf.util.attendance;

import jnpf.attendance.service.MachineStrategy;
import jnpf.enums.attendance.MachineEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 考勤机策略工厂
 *
 * @author yanwenfu
 * @create 2021-01-26
 */
@Component
public class MachineStrategyFactory {

    @Autowired
    private Map<String, MachineStrategy> machineStrategyMap;

    public MachineStrategy getMachineStrategy(MachineEnum machine) {

        return machineStrategyMap.get(machine.getDescription());
    }
}
