feat: update sms module
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
package com.schisandra.auth.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.schisandra.auth.application.convert.SchisandraAuthUserDTOConverter;
|
||||
import com.schisandra.auth.application.dto.SchisandraAuthUserDTO;
|
||||
import com.schisandra.auth.common.entity.Result;
|
||||
import com.schisandra.auth.domain.bo.SchisandraAuthUserBO;
|
||||
import com.schisandra.auth.domain.service.SchisandraAuthUserDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
@@ -28,7 +25,6 @@ import javax.annotation.Resource;
|
||||
public class SchisandraAuthUserController {
|
||||
@Resource
|
||||
private SchisandraAuthUserDomainService schisandraAuthUserDomainService;
|
||||
|
||||
/**
|
||||
* @description 更新用户信息
|
||||
* @param schisandraAuthUserDTO
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package com.schisandra.auth.application.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Classname SchisandraSmsController
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.auth.application.controller
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-08 01:41
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sms/")
|
||||
@Slf4j
|
||||
public class SchisandraSmsController {
|
||||
|
||||
@GetMapping("send")
|
||||
public SmsResponse send(String phone){
|
||||
SmsBlend smsBlend =SmsFactory.getSmsBlend();
|
||||
return smsBlend.sendMessage(phone, "1234");
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
package com.schisandra.auth.common.config;
|
||||
|
||||
import org.dromara.sms4j.aliyun.config.AlibabaConfig;
|
||||
import org.dromara.sms4j.core.datainterface.SmsReadConfig;
|
||||
import org.dromara.sms4j.provider.config.BaseConfig;
|
||||
import org.dromara.sms4j.unisms.config.UniConfig;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname SmsConfig
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.auth.common.config
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-08 18:46
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class SmsConfig implements SmsReadConfig {
|
||||
|
||||
//这里的configId指的是框架在调用该接口方法时候会传递进来的参数,用户可以根据此参数作为标准来动态的进行查询
|
||||
@Override
|
||||
public BaseConfig getSupplierConfig(String configId) {
|
||||
|
||||
AlibabaConfig alibabaConfig=new AlibabaConfig();
|
||||
alibabaConfig.setConfigId("alibaba");
|
||||
alibabaConfig.setRequestUrl("dysmsapi.aliyuncs.com");
|
||||
alibabaConfig.setAccessKeyId("LTAI5tDy2edL9LhW43rnus69");
|
||||
alibabaConfig.setAccessKeySecret("YWp44dcFrBICrjZgqvJBE7ZHArZfIP");
|
||||
alibabaConfig.setSignature("阿里云短信测试");
|
||||
alibabaConfig.setTemplateId("SMS_154950909");
|
||||
alibabaConfig.setTemplateName("code");
|
||||
alibabaConfig.setSdkAppId("sms");
|
||||
return alibabaConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseConfig> getSupplierConfigList() {
|
||||
//此处仅为示例,实际环境中,数据可以来自任意位置,
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -70,36 +70,13 @@ sa-token:
|
||||
is-log: true
|
||||
token-prefix: schisandra
|
||||
|
||||
#sms:
|
||||
# # 标注从yml读取配置
|
||||
# config-type: yaml
|
||||
# blends:
|
||||
# # 自定义的标识,也就是configId这里可以是任意值(最好不要是中文)
|
||||
# tx1:
|
||||
# #厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||
# supplier: tencent
|
||||
# #您的accessKey
|
||||
# access-key-id: 您的accessKey
|
||||
# #您的accessKeySecret
|
||||
# access-key-secret: 您的accessKeySecret
|
||||
# #您的短信签名
|
||||
# signature: 您的短信签名
|
||||
# #模板ID 非必须配置,如果使用sendMessage的快速发送需此配置
|
||||
# template-id: xxxxxxxx
|
||||
# #您的sdkAppId
|
||||
# sdk-app-id: 您的sdkAppId
|
||||
# # 自定义的标识,也就是configId这里可以是任意值(最好不要是中文)
|
||||
# tx2:
|
||||
# #厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||
# supplier: tencent
|
||||
# #您的accessKey
|
||||
# access-key-id: 您的accessKey
|
||||
# #您的accessKeySecret
|
||||
# access-key-secret: 您的accessKeySecret
|
||||
# #您的短信签名
|
||||
# signature: 您的短信签名
|
||||
# #模板ID 非必须配置,如果使用sendMessage的快速发送需此配置
|
||||
# template-id: xxxxxxxx
|
||||
# #您的sdkAppId
|
||||
# sdk-app-id: 您的sdkAppId
|
||||
sms:
|
||||
# 标注从yml读取配置
|
||||
config-type: interface
|
||||
restricted: true
|
||||
accountMax: 10
|
||||
minuteMax: 1
|
||||
isPrint: false
|
||||
HttpLog: true
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user