/**
 * 
 */
package org.springblade.modules.system.enums;

import java.util.function.Function;
import java.util.stream.Collectors;

import com.baomidou.mybatisplus.annotation.EnumValue;

import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author wookvn
 *	
 *	短信类型
 */
@Getter
@AllArgsConstructor
public enum SmsCategory {

	aliyun(0, "阿里云", str -> ReUtil.findAllGroup0("\\$\\{(\\w+)\\}", str).stream().map(item -> StrUtil.removeAny(item, "${", "}")).collect(Collectors.joining(","))),
	
	qiniu(1, "七牛云", str -> ReUtil.findAllGroup0("\\$\\{(\\w+)\\}", str).stream().map(item -> StrUtil.removeAny(item, "${", "}")).collect(Collectors.joining(","))),
	
	tencent(2, "腾讯云", str -> ReUtil.findAllGroup0("\\{(\\w+)\\}", str).stream().map(item -> StrUtil.removeAny(item, "{", "}")).collect(Collectors.joining(",")));
	
	@EnumValue
	private final int value;
	private final String message;
	private final Function<String, String> function;
}
