maxmall-common/maxmall-common-base/src/main/java/com/maxmall/common/base/constant/AliyunSmsConstants.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.maxmall.common.base.constant;

import com.google.common.collect.Lists;
import com.maxmall.common.base.enums.ErrorCodeEnum;
import com.maxmall.common.base.exception.BusinessException;
import org.springframework.util.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
 * The class Aliyun sms constants.
 *
 * @author maxmall.net@gmail.com
 */
public class AliyunSmsConstants {

	/**
	 * 短信模板枚举
	 */
	public enum SmsTempletEnum {

		/**
		 * 通用模板(短信内容:验证码${code}, 您正在注册成为maxmall用户, 感谢您的支持!)
		 */
		UAC_PC_GLOBAL_TEMPLATE("UAC_PC_GLOBAL_TEMPLATE", "SMS_105115057", "code"),;

		private String busType;

		private String templetCode;

		private String smsParamName;

		public static SmsTempletEnum getEnum(String templateCode) {
			SmsTempletEnum smsTempletEnum = null;
			for (SmsTempletEnum ele : SmsTempletEnum.values()) {
				if (templateCode.equals(ele.getTempletCode())) {
					smsTempletEnum = ele;
					break;
				}
			}
			return smsTempletEnum;
		}

		public static boolean isSmsTemplate(String smsTemplateCode) {

			if (StringUtils.isEmpty(smsTemplateCode)) {
				throw new BusinessException(ErrorCodeEnum.UAC10011020);
			}
			List<String> templetCodeList = getTemplateCodeList();

			return templetCodeList.contains(smsTemplateCode);
		}

		public static List<SmsTempletEnum> getList() {
			return Arrays.asList(SmsTempletEnum.values());
		}

		public static List<String> getTemplateCodeList() {
			List<String> templetCodeList = Lists.newArrayList();
后面还有 46 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。