package com.jwipc.sys.client.impl;

import com.jwipc.sys.client.ValidationRuleSettingClient;
import com.jwipc.sys.client.convert.ValidationRuleSettingClientConvert;
import com.jwipc.sys.client.dto.ValidationRuleSettingInfoClientDTO;
import com.jwipc.sys.logic.ValidationRuleSettingLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Chen Tianshi
 * @since 2025/8/29 16:13
 */
@Service
@RequiredArgsConstructor
public class ValidationRuleSettingClientImpl implements ValidationRuleSettingClient {
    private final ValidationRuleSettingLogic validationRuleSettingLogic;
    private final ValidationRuleSettingClientConvert validationRuleSettingClientConvert;

    @Override
    public List<ValidationRuleSettingInfoClientDTO> getFieldValidationList(String templateId, Integer type) {
        List<ValidationRuleSettingInfoClientDTO> resultList = validationRuleSettingClientConvert.logicInfo2ClientInfo(validationRuleSettingLogic.getAllValidationByTemplateId(templateId, type));
        return resultList;
    }
}
