mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	项目结构调整 x 22 : 优化 trace;将 sms 的集成测试,移到 biz-sms 下
This commit is contained in:
		| @@ -1,55 +0,0 @@ | ||||
| package cn.iocoder.yudao.adminserver.framework.sms.core.client.impl.aliyun; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.core.KeyValue; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.impl.aliyun.AliyunSmsClient; | ||||
| import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; | ||||
| import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | ||||
| import org.junit.jupiter.api.BeforeAll; | ||||
| import org.junit.jupiter.api.Test; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * {@link AliyunSmsClient} 的集成测试 | ||||
|  */ | ||||
| public class AliyunSmsClientIntegrationTest { | ||||
|  | ||||
|     private static AliyunSmsClient smsClient; | ||||
|  | ||||
|     @BeforeAll | ||||
|     public static void before() { | ||||
|         // 创建配置类 | ||||
|         SmsChannelProperties properties = new SmsChannelProperties(); | ||||
|         properties.setId(1L); | ||||
|         properties.setSignature("Ballcat"); | ||||
|         properties.setCode(SmsChannelEnum.ALIYUN.getCode()); | ||||
|         properties.setApiKey(System.getenv("ALIYUN_ACCESS_KEY")); | ||||
|         properties.setApiSecret(System.getenv("ALIYUN_SECRET_KEY")); | ||||
|         // 创建客户端 | ||||
|         smsClient = new AliyunSmsClient(properties); | ||||
|         smsClient.init(); | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
|     public void testSendSms() { | ||||
|         List<KeyValue<String, Object>> templateParams = new ArrayList<>(); | ||||
|         templateParams.add(new KeyValue<>("code", "1024")); | ||||
| //        templateParams.put("operation", "嘿嘿"); | ||||
| //        SmsResult result = smsClient.send(1L, "15601691399", "4372216", templateParams); | ||||
|         SmsCommonResult<SmsSendRespDTO> result = smsClient.sendSms(1L, "15601691399", | ||||
|                 "SMS_207945135", templateParams); | ||||
|         System.out.println(result); | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
|     public void testGetSmsTemplate() { | ||||
|         String apiTemplateId = "SMS_2079451351"; | ||||
|         SmsCommonResult<SmsTemplateRespDTO> result = smsClient.getSmsTemplate(apiTemplateId); | ||||
|         System.out.println(result); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1,46 +0,0 @@ | ||||
| package cn.iocoder.yudao.adminserver.framework.sms.core.client.impl.debug; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.core.KeyValue; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.impl.debug.DebugDingTalkSmsClient; | ||||
| import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; | ||||
| import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | ||||
| import org.junit.jupiter.api.BeforeAll; | ||||
| import org.junit.jupiter.api.Test; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * {@link DebugDingTalkSmsClient} 的集成测试 | ||||
|  */ | ||||
| public class DebugDingTalkSmsClientIntegrationTest { | ||||
|  | ||||
|     private static DebugDingTalkSmsClient smsClient; | ||||
|  | ||||
|     @BeforeAll | ||||
|     public static void init() { | ||||
|         // 创建配置类 | ||||
|         SmsChannelProperties properties = new SmsChannelProperties(); | ||||
|         properties.setId(1L); | ||||
|         properties.setSignature("芋道"); | ||||
|         properties.setCode(SmsChannelEnum.DEBUG_DING_TALK.getCode()); | ||||
|         properties.setApiKey("696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859"); | ||||
|         properties.setApiSecret("SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67"); | ||||
|         // 创建客户端 | ||||
|         smsClient = new DebugDingTalkSmsClient(properties); | ||||
|         smsClient.init(); | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
|     public void testSendSms() { | ||||
|         List<KeyValue<String, Object>> templateParams = new ArrayList<>(); | ||||
|         templateParams.add(new KeyValue<>("code", "1024")); | ||||
|         templateParams.add(new KeyValue<>("operation", "嘿嘿")); | ||||
| //        SmsResult result = smsClient.send(1L, "15601691399", "4372216", templateParams); | ||||
|         SmsCommonResult<SmsSendRespDTO> result = smsClient.sendSms(1L, "15601691399", "4383920", templateParams); | ||||
|         System.out.println(result); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1,53 +0,0 @@ | ||||
| package cn.iocoder.yudao.adminserver.framework.sms.core.client.impl.yunpian; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.core.KeyValue; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | ||||
| import cn.iocoder.yudao.framework.sms.core.client.impl.yunpian.YunpianSmsClient; | ||||
| import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; | ||||
| import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | ||||
| import org.junit.jupiter.api.BeforeAll; | ||||
| import org.junit.jupiter.api.Test; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * {@link YunpianSmsClient} 的集成测试 | ||||
|  */ | ||||
| public class YunpianSmsClientIntegrationTest { | ||||
|  | ||||
|     private static YunpianSmsClient smsClient; | ||||
|  | ||||
|     @BeforeAll | ||||
|     public static void init() { | ||||
|         // 创建配置类 | ||||
|         SmsChannelProperties properties = new SmsChannelProperties(); | ||||
|         properties.setId(1L); | ||||
|         properties.setSignature("芋道"); | ||||
|         properties.setCode(SmsChannelEnum.YUN_PIAN.getCode()); | ||||
|         properties.setApiKey("1555a14277cb8a608cf45a9e6a80d510"); | ||||
|         // 创建客户端 | ||||
|         smsClient = new YunpianSmsClient(properties); | ||||
|         smsClient.init(); | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
|     public void testSendSms() { | ||||
|         List<KeyValue<String, Object>> templateParams = new ArrayList<>(); | ||||
|         templateParams.add(new KeyValue<>("code", "1024")); | ||||
|         templateParams.add(new KeyValue<>("operation", "嘿嘿")); | ||||
| //        SmsResult result = smsClient.send(1L, "15601691399", "4372216", templateParams); | ||||
|         SmsCommonResult<SmsSendRespDTO> result = smsClient.sendSms(1L, "15601691399", "4383920", templateParams); | ||||
|         System.out.println(result); | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
|     public void testGetSmsTemplate() { | ||||
|         String apiTemplateId = "4383920"; | ||||
|         SmsCommonResult<SmsTemplateRespDTO> result = smsClient.getSmsTemplate(apiTemplateId); | ||||
|         System.out.println(result); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1 +0,0 @@ | ||||
| package cn.iocoder.yudao.adminserver.framework.sms.core.client; | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV