mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
Merge branch 'dev' of https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web into dev
This commit is contained in:
@@ -74,7 +74,8 @@ public class MemberController extends BaseController {
|
||||
if (StringUtils.isBlank(dto.getMobileNumber())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
String sendSMSResult = SMSUtil.sendSMS(request, dto.getMobileNumber());
|
||||
// String sendSMSResult = SMSUtil.sendSMS(request, dto.getMobileNumber());
|
||||
String sendSMSResult = SMSUtil.sendSMSV2(request, dto.getMobileNumber());
|
||||
response = new RestApiResponse<>(sendSMSResult);
|
||||
} catch (Exception e) {
|
||||
logger.error("下发短信接口 发生异常 error", e);
|
||||
|
||||
@@ -28,6 +28,9 @@ import com.jsowell.service.OrderService;
|
||||
import com.jsowell.service.TempService;
|
||||
import com.jsowell.thirdparty.platform.dto.PushOrderDTO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -963,4 +966,17 @@ public class TempController extends BaseController {
|
||||
logger.info("关闭支付未启动的订单, param:{}, result:{}", JSON.toJSONString(dto), response);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试发送短信
|
||||
* http://localhost:8080/temp/testSendSMS
|
||||
*/
|
||||
@GetMapping("/testSendSMS")
|
||||
public void testSend(){
|
||||
// 在创建完SmsBlend实例后,再未手动调用注销的情况下框架会持有该实例,可以直接通过指定configId来获取想要的配置,如果你想使用
|
||||
// 负载均衡形式获取实例,只要使用getSmsBlend的无参重载方法即可,如果你仅有一个配置,也可以使用该方法
|
||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("tx1");
|
||||
SmsResponse smsResponse = smsBlend.sendMessage("18521561107","888888");
|
||||
logger.info("发送短信结果:{}, 详情:{}", smsResponse.isSuccess(), JSON.toJSONString(smsResponse));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,3 +152,47 @@ chargeAlgorithm2pdf:
|
||||
getPdfLinkUrl: /api/docking/report/pdf/
|
||||
token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
# sms4j
|
||||
sms:
|
||||
# 标注从yml读取配置
|
||||
config-type: yaml
|
||||
blends:
|
||||
# 自定义的标识,也就是configId这里可以是任意值(最好不要是中文)
|
||||
tx1:
|
||||
#厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||
supplier: tencent
|
||||
#您的accessKey
|
||||
access-key-id: AKIDfDakkZBbqvnSt8Azb3JMKD3jCVcZJxPh
|
||||
#您的accessKeySecret
|
||||
access-key-secret: 95oKgpJeoncGoASXQ6qRp35wa2HKQVPA
|
||||
#您的短信签名
|
||||
signature: 举视新能源
|
||||
#模板ID 非必须配置,如果使用sendMessage的快速发送需此配置
|
||||
template-id: 1002460
|
||||
#您的sdkAppId
|
||||
sdk-app-id: 1400536771
|
||||
# 代理
|
||||
proxy:
|
||||
# 是否启用代理 默认关闭 需手动开启
|
||||
enable: false
|
||||
host: 127.0.0.1
|
||||
port: 8080
|
||||
ali1:
|
||||
#厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||
supplier: alibaba
|
||||
#您的accessKey
|
||||
access-key-id: AKIDfDakkZBbqvnSt8Azb3JMKD3jCVcZJxPh
|
||||
#您的accessKeySecret
|
||||
access-key-secret: 95oKgpJeoncGoASXQ6qRp35wa2HKQVPA
|
||||
#您的短信签名
|
||||
signature: 举视上海新能源
|
||||
#模板ID 非必须配置,如果使用sendMessage的快速发送需此配置
|
||||
template-id: 1002460
|
||||
#您的sdkAppId
|
||||
sdk-app-id: 1400536771
|
||||
# 代理
|
||||
proxy:
|
||||
# 是否启用代理 默认关闭 需手动开启
|
||||
enable: false
|
||||
host: 127.0.0.1
|
||||
port: 8080
|
||||
Reference in New Issue
Block a user