package com.usky.rule.service.impl;

import com.usky.common.security.utils.SecurityUtils;
import com.usky.rule.domain.RuleEngineCondition;
import com.usky.rule.mapper.RuleEngineConditionMapper;
import com.usky.rule.service.RuleEngineConditionService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RuleEngineConditionServiceImpl implements RuleEngineConditionService {
    private final RuleEngineConditionMapper ruleEngineConditionMapper;

    public RuleEngineConditionServiceImpl(RuleEngineConditionMapper ruleEngineConditionMapper) {
        this.ruleEngineConditionMapper = ruleEngineConditionMapper;
    }

    @Override
    public List<RuleEngineCondition> listConditions(Integer type) {
        if (type == null) {
            return ruleEngineConditionMapper.selectAll();
        }
        return ruleEngineConditionMapper.selectByType(type);
    }
}
