package com.tzy.common.dto.pay;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * @author by po'yi
 * @Classname DictPropDTO
 * @Description TODO
 * @Date 2023/7/24 11:29
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class DictPropDTO implements Serializable {

	/**开启时间,0-24小时*/
	private Integer startTime=0;
	/**结束时间,0-24小时*/
	private Integer endTime=24;
	/**指定组队类型,多个用逗号隔开*/
	private String infoType;

	private List<String> infoTypeList;
	/**排除指定组队类型,多个用逗号隔开*/
	private String unlessType;

	private List<String> unlessTypeList;

	public List<String> getUnlessTypeList() {
		if(StringUtils.isNotEmpty(unlessType)){
			return Arrays.asList(unlessType.split(","));
		}
		return unlessTypeList;
	}

	public List<String> getInfoTypeList() {
		if(StringUtils.isNotEmpty(infoType)){
			return Arrays.asList(infoType.split(","));
		}
		return infoTypeList;
	}
}
