| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.resource.builder.sms; |
| | | package org.springblade.Autowired.builder.sms; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.springblade.Autowired.entity.Sms; |
| | | import org.springblade.Autowired.service.ISmsService; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springblade.resource.entity.Sms; |
| | | import org.springblade.resource.service.ISmsService; |
| | | |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | |
| | | template = templatePool.get(tenantId); |
| | | if (Func.hasEmpty(template, smsCached) || !sms.getTemplateId().equals(smsCached.getTemplateId()) || !sms.getAccessKey().equals(smsCached.getAccessKey())) { |
| | | if (sms.getCategory() == SmsEnum.YUNPIAN.getCategory()) { |
| | | template = YunpianSmsBuilder.template(sms, bladeRedis); |
| | | template = org.springblade.Autowired.builder.sms.YunpianSmsBuilder.template(sms, bladeRedis); |
| | | } else if (sms.getCategory() == SmsEnum.QINIU.getCategory()) { |
| | | template = QiniuSmsBuilder.template(sms, bladeRedis); |
| | | template = org.springblade.Autowired.builder.sms.QiniuSmsBuilder.template(sms, bladeRedis); |
| | | } else if (sms.getCategory() == SmsEnum.ALI.getCategory()) { |
| | | template = AliSmsBuilder.template(sms, bladeRedis); |
| | | template = org.springblade.Autowired.builder.sms.AliSmsBuilder.template(sms, bladeRedis); |
| | | } else if (sms.getCategory() == SmsEnum.TENCENT.getCategory()) { |
| | | template = TencentSmsBuilder.template(sms, bladeRedis); |
| | | template = org.springblade.Autowired.builder.sms.TencentSmsBuilder.template(sms, bladeRedis); |
| | | } |
| | | templatePool.put(tenantId, template); |
| | | smsPool.put(tenantId, sms); |