package com.seamew.lottery.domain.rule.service.engine;

import com.seamew.lottery.domain.rule.service.logic.LogicFilter;
import com.seamew.lottery.domain.rule.service.logic.impl.UserAgeFilter;
import com.seamew.lottery.domain.rule.service.logic.impl.UserGenderFilter;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author: seamew
 * @Title: EngineConfig
 * @CreateTime: 2023年02月25日 17:08:00
 * @Description: 规则配置
 * @Version: 1.0
 */
public class EngineConfig {

    protected static Map<String, LogicFilter> logicFilterMap = new ConcurrentHashMap<>();

    @Resource
    private UserAgeFilter userAgeFilter;
    @Resource
    private UserGenderFilter userGenderFilter;

    @PostConstruct
    public void init() {
        logicFilterMap.put("userAge", userAgeFilter);
        logicFilterMap.put("userGender", userGenderFilter);
    }
}
