feat: 更改数据库主键id生成策略
This commit is contained in:
@@ -3,8 +3,8 @@ package com.schisandra.auth.application.config;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.schisandra.auth.application.context.SmsConfigContext;
|
||||
import com.schisandra.auth.common.redis.RedisUtil;
|
||||
import com.schisandra.auth.infra.entity.SmsConfigInfo;
|
||||
import com.schisandra.auth.infra.rpc.SmsConfigRpc;
|
||||
import com.schisandra.auth.infra.entity.ConfigInfo;
|
||||
import com.schisandra.auth.infra.rpc.ConfigRpc;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||
import org.springframework.context.SmartLifecycle;
|
||||
@@ -24,7 +24,7 @@ public class SmsInitConfig implements SmartLifecycle {
|
||||
@Resource
|
||||
SmsReadConfig smsReadConfig;
|
||||
@Resource
|
||||
SmsConfigRpc smsConfigRpc;
|
||||
ConfigRpc configRpc;
|
||||
|
||||
@Resource
|
||||
RedisUtil redisUtil;
|
||||
@@ -32,7 +32,7 @@ public class SmsInitConfig implements SmartLifecycle {
|
||||
private final String smsConfigPrefix="sys.config";
|
||||
|
||||
public void init() {
|
||||
SmsConfigInfo configInfo = smsConfigRpc.getConfigInfo(SmsConfigContext.SMS_CONFIG_KEY);
|
||||
ConfigInfo configInfo = configRpc.getConfigInfo(SmsConfigContext.SMS_CONFIG_KEY);
|
||||
if (ObjectUtil.isEmpty(configInfo)){
|
||||
log.info("短信配置获取失败!");
|
||||
}
|
||||
|
@@ -1,43 +0,0 @@
|
||||
package com.schisandra.auth.application.convert;
|
||||
|
||||
import com.schisandra.auth.application.dto.SchisandraSmsConfigDTO;
|
||||
import com.schisandra.auth.domain.bo.SchisandraSmsConfigBO;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-08 20:09:54
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface SchisandraSmsConfigDTOConvert {
|
||||
|
||||
SchisandraSmsConfigDTOConvert INSTANCE = Mappers.getMapper(SchisandraSmsConfigDTOConvert.class);
|
||||
|
||||
/**
|
||||
* @description: 将bo转换为实体
|
||||
* @param: schisandraSmsConfigDTO
|
||||
* @return com.schisandra.auth.infra.basic.bo.SchisandraAuthUser
|
||||
* @author schisandra
|
||||
* @date: 2024/3/21 23:13
|
||||
*/
|
||||
SchisandraSmsConfigBO convertDTOToBO(SchisandraSmsConfigDTO schisandraSmsConfigDTO);
|
||||
|
||||
/**
|
||||
* @description: 将实体转换为bo
|
||||
* @param: schisandraSmsConfigBO
|
||||
* @return com.schisandra.auth.domain.bo.SchisandraAuthUserBO
|
||||
* @author schisandra
|
||||
* @date: 2024/3/21 23:13
|
||||
*/
|
||||
SchisandraSmsConfigDTO convertBOToDTO(SchisandraSmsConfigBO schisandraSmsConfigBO);
|
||||
|
||||
List<SchisandraSmsConfigDTO> convertBOToDTOList(List<SchisandraSmsConfigBO> schisandraSmsConfigBO);
|
||||
|
||||
}
|
||||
|
@@ -1,177 +0,0 @@
|
||||
package com.schisandra.auth.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-08 20:09:54
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraSmsConfigDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 配置id
|
||||
*/
|
||||
private String configId;
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String requestUrl;
|
||||
/**
|
||||
* 模板变量名称
|
||||
*/
|
||||
private String templateName;
|
||||
/**
|
||||
* 接口名称
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 地域信息
|
||||
*/
|
||||
private String region;
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
private String accessKeyId;
|
||||
/**
|
||||
* 密钥
|
||||
*/
|
||||
private String accessKeySecret;
|
||||
/**
|
||||
* 厂商名称标识
|
||||
*/
|
||||
private String supplier;
|
||||
/**
|
||||
* 短信签名
|
||||
*/
|
||||
private String signature;
|
||||
/**
|
||||
* appid
|
||||
*/
|
||||
private String sdkAppId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private Integer weight;
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer retryInterval;
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer maxRetries;
|
||||
/**
|
||||
* 厂商的发送数量上限,默认不设置上限
|
||||
*/
|
||||
private Long maximum;
|
||||
/**
|
||||
* REST API Base URL
|
||||
*/
|
||||
private String baseUrl;
|
||||
/**
|
||||
* 请求域名
|
||||
*/
|
||||
private String serverIp;
|
||||
/**
|
||||
* 请求端口
|
||||
*/
|
||||
private Integer serverPort;
|
||||
/**
|
||||
* 国内短信签名通道号
|
||||
*/
|
||||
private String sender;
|
||||
/**
|
||||
* 短信状态报告接收地
|
||||
*/
|
||||
private String statusCallBack;
|
||||
/**
|
||||
* APP接入地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 模板短信请求地址
|
||||
*/
|
||||
private String templateUrl;
|
||||
/**
|
||||
* 验证码短信请求地址
|
||||
*/
|
||||
private String codeUrl;
|
||||
/**
|
||||
* 验证码验证请求地址
|
||||
*/
|
||||
private String verifyUrl;
|
||||
/**
|
||||
* 是否需要支持短信上行。true:需要,false:不需要false
|
||||
*/
|
||||
private String needUp;
|
||||
/**
|
||||
* 请求超时时间
|
||||
*/
|
||||
private Integer connTimeout;
|
||||
/**
|
||||
* 是否为简易模式
|
||||
*/
|
||||
private String isSimple;
|
||||
/**
|
||||
* 短信发送后将向这个地址推送(运营商返回的)发送报告
|
||||
*/
|
||||
private String callbackUrl;
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Integer mchId;
|
||||
/**
|
||||
* app key
|
||||
*/
|
||||
private String appKey;
|
||||
/**
|
||||
* app id
|
||||
*/
|
||||
private Integer appId;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
* 单发链接
|
||||
*/
|
||||
private String singleMsgUrl;
|
||||
/**
|
||||
* 群发链接
|
||||
*/
|
||||
private String massMsgUrl;
|
||||
/**
|
||||
* 签名ID
|
||||
*/
|
||||
private String signatureId;
|
||||
/**
|
||||
* 是否删除 0 未删除 1已删除
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
/**
|
||||
* 额外字段
|
||||
*/
|
||||
private String extraJson;
|
||||
/**
|
||||
* 服务名
|
||||
*/
|
||||
private String service;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,10 +1,8 @@
|
||||
package com.schisandra.auth.application.handler.sms;
|
||||
|
||||
import com.schisandra.auth.application.convert.SchisandraSmsConfigDTOConvert;
|
||||
import com.schisandra.auth.application.dto.SchisandraSmsConfigDTO;
|
||||
import com.schisandra.auth.common.enums.SmsSupplierType;
|
||||
import com.schisandra.auth.domain.bo.SchisandraSmsConfigBO;
|
||||
import com.schisandra.auth.domain.service.SchisandraSmsConfigDomainService;
|
||||
import com.schisandra.auth.infra.entity.SmsConfigInfo;
|
||||
import com.schisandra.auth.infra.rpc.SmsConfigRpc;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.dromara.sms4j.aliyun.config.AlibabaConfig;
|
||||
@@ -25,8 +23,9 @@ import javax.annotation.Resource;
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AlibabaSmsHandler implements SchisandraSmsTypeHandler{
|
||||
|
||||
@Resource
|
||||
SchisandraSmsConfigDomainService schisandraSmsConfigDomainService;
|
||||
private SmsConfigRpc smsConfigRpc;
|
||||
@Override
|
||||
public SmsSupplierType getHandlerType() {
|
||||
return SmsSupplierType.ALIBABA;
|
||||
@@ -34,22 +33,21 @@ public class AlibabaSmsHandler implements SchisandraSmsTypeHandler{
|
||||
|
||||
@Override
|
||||
public BaseConfig addConfig(String configId) {
|
||||
SchisandraSmsConfigBO schisandraSmsConfigBO = schisandraSmsConfigDomainService.queryByConfigId(configId);
|
||||
SchisandraSmsConfigDTO schisandraSmsConfigDTO = SchisandraSmsConfigDTOConvert.INSTANCE.convertBOToDTO(schisandraSmsConfigBO);
|
||||
if (ObjectUtils.isEmpty(schisandraSmsConfigDTO)){
|
||||
SmsConfigInfo smsConfigInfo = smsConfigRpc.getSmsConfigInfo(configId);
|
||||
if (ObjectUtils.isEmpty(smsConfigInfo)){
|
||||
log.error("阿里云短信配置信息获取失败");
|
||||
return null;
|
||||
}
|
||||
AlibabaConfig alibabaConfig=new AlibabaConfig();
|
||||
alibabaConfig.setConfigId(schisandraSmsConfigDTO.getConfigId());
|
||||
alibabaConfig.setRequestUrl(schisandraSmsConfigDTO.getRequestUrl());
|
||||
alibabaConfig.setAccessKeyId(schisandraSmsConfigDTO.getAccessKeyId());
|
||||
alibabaConfig.setAccessKeySecret(schisandraSmsConfigDTO.getAccessKeySecret());
|
||||
alibabaConfig.setSignature(schisandraSmsConfigDTO.getSignature());
|
||||
alibabaConfig.setTemplateId(schisandraSmsConfigDTO.getTemplateId());
|
||||
alibabaConfig.setTemplateName(schisandraSmsConfigDTO.getTemplateName());
|
||||
alibabaConfig.setSdkAppId(schisandraSmsConfigDTO.getSdkAppId());
|
||||
alibabaConfig.setMaximum(Math.toIntExact(schisandraSmsConfigDTO.getMaximum()));
|
||||
alibabaConfig.setConfigId(smsConfigInfo.getConfigId());
|
||||
alibabaConfig.setRequestUrl(smsConfigInfo.getRequestUrl());
|
||||
alibabaConfig.setAccessKeyId(smsConfigInfo.getAccessKeyId());
|
||||
alibabaConfig.setAccessKeySecret(smsConfigInfo.getAccessKeySecret());
|
||||
alibabaConfig.setSignature(smsConfigInfo.getSignature());
|
||||
alibabaConfig.setTemplateId(smsConfigInfo.getTemplateId());
|
||||
alibabaConfig.setTemplateName(smsConfigInfo.getTemplateName());
|
||||
alibabaConfig.setSdkAppId(smsConfigInfo.getSdkAppId());
|
||||
alibabaConfig.setMaximum(Math.toIntExact(smsConfigInfo.getMaximum()));
|
||||
return alibabaConfig;
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,8 @@
|
||||
package com.schisandra.auth.application.handler.sms;
|
||||
|
||||
import com.schisandra.auth.application.convert.SchisandraSmsConfigDTOConvert;
|
||||
import com.schisandra.auth.application.dto.SchisandraSmsConfigDTO;
|
||||
import com.schisandra.auth.common.enums.SmsSupplierType;
|
||||
import com.schisandra.auth.domain.bo.SchisandraSmsConfigBO;
|
||||
import com.schisandra.auth.domain.service.SchisandraSmsConfigDomainService;
|
||||
import com.schisandra.auth.infra.entity.SmsConfigInfo;
|
||||
import com.schisandra.auth.infra.rpc.SmsConfigRpc;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.dromara.sms4j.provider.config.BaseConfig;
|
||||
@@ -24,40 +22,41 @@ import javax.annotation.Resource;
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class TencentSmsHandler implements SchisandraSmsTypeHandler{
|
||||
@Resource
|
||||
SchisandraSmsConfigDomainService schisandraSmsConfigDomainService;
|
||||
public class TencentSmsHandler implements SchisandraSmsTypeHandler {
|
||||
|
||||
@Override
|
||||
public SmsSupplierType getHandlerType() {
|
||||
return SmsSupplierType.TENCENT;
|
||||
}
|
||||
|
||||
@Resource
|
||||
private SmsConfigRpc smsConfigRpc;
|
||||
|
||||
@Override
|
||||
public BaseConfig addConfig(String configId) {
|
||||
SchisandraSmsConfigBO schisandraSmsConfigBO = schisandraSmsConfigDomainService.queryByConfigId(configId);
|
||||
SchisandraSmsConfigDTO schisandraSmsConfigDTO = SchisandraSmsConfigDTOConvert.INSTANCE.convertBOToDTO(schisandraSmsConfigBO);
|
||||
if (ObjectUtils.isEmpty(schisandraSmsConfigDTO)){
|
||||
SmsConfigInfo smsConfigInfo = smsConfigRpc.getSmsConfigInfo(configId);
|
||||
if (ObjectUtils.isEmpty(smsConfigInfo)) {
|
||||
log.error("腾讯短信配置信息获取失败");
|
||||
return null;
|
||||
}
|
||||
TencentConfig tencentConfig=new TencentConfig();
|
||||
tencentConfig.setAccessKeyId(schisandraSmsConfigDTO.getAccessKeyId());
|
||||
tencentConfig.setAccessKeySecret(schisandraSmsConfigDTO.getAccessKeySecret());
|
||||
tencentConfig.setConfigId(schisandraSmsConfigDTO.getConfigId());
|
||||
tencentConfig.setAction(schisandraSmsConfigDTO.getAction());
|
||||
tencentConfig.setService(schisandraSmsConfigDTO.getService());
|
||||
tencentConfig.setRequestUrl(schisandraSmsConfigDTO.getRequestUrl());
|
||||
tencentConfig.setConnTimeout(schisandraSmsConfigDTO.getConnTimeout());
|
||||
tencentConfig.setTerritory(schisandraSmsConfigDTO.getRegion());
|
||||
tencentConfig.setVersion(schisandraSmsConfigDTO.getVersion());
|
||||
tencentConfig.setTemplateId(schisandraSmsConfigDTO.getTemplateId());
|
||||
tencentConfig.setSignature(schisandraSmsConfigDTO.getSignature());
|
||||
tencentConfig.setSdkAppId(schisandraSmsConfigDTO.getSdkAppId());
|
||||
tencentConfig.setMaxRetries(schisandraSmsConfigDTO.getMaxRetries());
|
||||
tencentConfig.setMaximum(Math.toIntExact(schisandraSmsConfigDTO.getMaximum()));
|
||||
tencentConfig.setWeight(schisandraSmsConfigDTO.getWeight());
|
||||
tencentConfig.setMaximum(Math.toIntExact(schisandraSmsConfigDTO.getMaximum()));
|
||||
tencentConfig.setMaxRetries(Math.toIntExact(schisandraSmsConfigDTO.getMaxRetries()));
|
||||
TencentConfig tencentConfig = new TencentConfig();
|
||||
tencentConfig.setAccessKeyId(smsConfigInfo.getAccessKeyId());
|
||||
tencentConfig.setAccessKeySecret(smsConfigInfo.getAccessKeySecret());
|
||||
tencentConfig.setConfigId(smsConfigInfo.getConfigId());
|
||||
tencentConfig.setAction(smsConfigInfo.getAction());
|
||||
tencentConfig.setService(smsConfigInfo.getService());
|
||||
tencentConfig.setRequestUrl(smsConfigInfo.getRequestUrl());
|
||||
tencentConfig.setConnTimeout(smsConfigInfo.getConnTimeout());
|
||||
tencentConfig.setTerritory(smsConfigInfo.getRegion());
|
||||
tencentConfig.setVersion(smsConfigInfo.getVersion());
|
||||
tencentConfig.setTemplateId(smsConfigInfo.getTemplateId());
|
||||
tencentConfig.setSignature(smsConfigInfo.getSignature());
|
||||
tencentConfig.setSdkAppId(smsConfigInfo.getSdkAppId());
|
||||
tencentConfig.setMaxRetries(smsConfigInfo.getMaxRetries());
|
||||
tencentConfig.setMaximum(Math.toIntExact(smsConfigInfo.getMaximum()));
|
||||
tencentConfig.setWeight(smsConfigInfo.getWeight());
|
||||
tencentConfig.setMaximum(Math.toIntExact(smsConfigInfo.getMaximum()));
|
||||
tencentConfig.setMaxRetries(Math.toIntExact(smsConfigInfo.getMaxRetries()));
|
||||
return tencentConfig;
|
||||
}
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ public enum OauthType {
|
||||
/**
|
||||
* System
|
||||
*/
|
||||
SYSTEM("system");
|
||||
SYSTEM("SYSTEM");
|
||||
|
||||
public String type;
|
||||
|
||||
|
@@ -1,165 +0,0 @@
|
||||
package com.schisandra.auth.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-08 20:09:54
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraSmsConfigBO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 配置id
|
||||
*/
|
||||
private String configId;
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String requestUrl;
|
||||
/**
|
||||
* 模板变量名称
|
||||
*/
|
||||
private String templateName;
|
||||
/**
|
||||
* 接口名称
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 地域信息
|
||||
*/
|
||||
private String region;
|
||||
|
||||
private String accessKeyId;
|
||||
|
||||
private String accessKeySecret;
|
||||
/**
|
||||
* 厂商名称标识
|
||||
*/
|
||||
private String supplier;
|
||||
/**
|
||||
* 短信签名
|
||||
*/
|
||||
private String signature;
|
||||
|
||||
private String sdkAppId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private Integer weight;
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer retryInterval;
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer maxRetries;
|
||||
/**
|
||||
* 厂商的发送数量上限,默认不设置上限
|
||||
*/
|
||||
private Long maximum;
|
||||
/**
|
||||
* REST API Base URL
|
||||
*/
|
||||
private String baseUrl;
|
||||
/**
|
||||
* 请求域名
|
||||
*/
|
||||
private String serverIp;
|
||||
/**
|
||||
* 请求端口
|
||||
*/
|
||||
private Integer serverPort;
|
||||
/**
|
||||
* 国内短信签名通道号
|
||||
*/
|
||||
private String sender;
|
||||
/**
|
||||
* 短信状态报告接收地
|
||||
*/
|
||||
private String statusCallBack;
|
||||
/**
|
||||
* APP接入地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 模板短信请求地址
|
||||
*/
|
||||
private String templateUrl;
|
||||
/**
|
||||
* 验证码短信请求地址
|
||||
*/
|
||||
private String codeUrl;
|
||||
/**
|
||||
* 验证码验证请求地址
|
||||
*/
|
||||
private String verifyUrl;
|
||||
/**
|
||||
* 是否需要支持短信上行。true:需要,false:不需要false
|
||||
*/
|
||||
private String needUp;
|
||||
/**
|
||||
* 请求超时时间
|
||||
*/
|
||||
private Integer connTimeout;
|
||||
/**
|
||||
* 是否为简易模式
|
||||
*/
|
||||
private String isSimple;
|
||||
/**
|
||||
* 短信发送后将向这个地址推送(运营商返回的)发送报告
|
||||
*/
|
||||
private String callbackUrl;
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Integer mchId;
|
||||
|
||||
private String appKey;
|
||||
|
||||
private Integer appId;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
* 单发链接
|
||||
*/
|
||||
private String singleMsgUrl;
|
||||
/**
|
||||
* 群发链接
|
||||
*/
|
||||
private String massMsgUrl;
|
||||
/**
|
||||
* 签名ID
|
||||
*/
|
||||
private String signatureId;
|
||||
/**
|
||||
* 是否删除 0 未删除 1已删除
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
|
||||
private String extraJson;
|
||||
/**
|
||||
* 服务名
|
||||
*/
|
||||
private String service;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,7 @@
|
||||
package com.schisandra.auth.domain.convert;
|
||||
|
||||
import com.schisandra.auth.domain.bo.SchisandraAuthPermissionBO;
|
||||
import com.schisandra.auth.domain.bo.SchisandraAuthRoleBO;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraAuthPermission;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraAuthRole;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@Mapper(componentModel = "spring")
|
||||
|
@@ -1,48 +0,0 @@
|
||||
package com.schisandra.auth.domain.convert;
|
||||
|
||||
import com.schisandra.auth.domain.bo.SchisandraAuthUserBO;
|
||||
import com.schisandra.auth.domain.bo.SchisandraSmsConfigBO;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraAuthUser;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-08 20:09:54
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface SchisandraSmsConfigBOConvert {
|
||||
|
||||
SchisandraSmsConfigBOConvert INSTANCE = Mappers.getMapper(SchisandraSmsConfigBOConvert.class);
|
||||
|
||||
/**
|
||||
* @description 将bo转换为实体
|
||||
* @param schisandraSmsConfigBO
|
||||
* @return com.schisandra.auth.infra.basic.bo.SchisandraAuthUser
|
||||
* @author schisandra
|
||||
* @date 2024/3/21 23:13
|
||||
*/
|
||||
SchisandraSmsConfig convertBOToEntity(SchisandraSmsConfigBO schisandraSmsConfigBO);
|
||||
|
||||
/**
|
||||
* @description 将实体转换为bo
|
||||
* @param schisandraSmsConfig
|
||||
* @return com.schisandra.auth.domain.bo.SchisandraAuthUserBO
|
||||
* @author schisandra
|
||||
* @date 2024/3/21 23:13
|
||||
*/
|
||||
SchisandraSmsConfigBO convertEntityToBO(SchisandraSmsConfig schisandraSmsConfig);
|
||||
|
||||
List<SchisandraSmsConfigBO> convertEntityToBOList(List<SchisandraSmsConfig> schisandraSmsConfigs);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,17 +0,0 @@
|
||||
package com.schisandra.auth.domain.service;
|
||||
|
||||
|
||||
import com.schisandra.auth.domain.bo.SchisandraSmsConfigBO;
|
||||
|
||||
/**
|
||||
* 用户领域service
|
||||
*
|
||||
* @author schisandra
|
||||
* @date 2024/3/21
|
||||
*/
|
||||
public interface SchisandraSmsConfigDomainService {
|
||||
|
||||
SchisandraSmsConfigBO queryByConfigId(String configId);
|
||||
|
||||
}
|
||||
|
@@ -195,8 +195,7 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
*/
|
||||
@Override
|
||||
public Object deleteById(Long id) {
|
||||
boolean flag = schisandraAuthUserService.deleteById(id);
|
||||
return flag;
|
||||
return schisandraAuthUserService.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,25 +0,0 @@
|
||||
package com.schisandra.auth.domain.service.impl;
|
||||
|
||||
import com.schisandra.auth.domain.bo.SchisandraSmsConfigBO;
|
||||
import com.schisandra.auth.domain.convert.SchisandraSmsConfigBOConvert;
|
||||
import com.schisandra.auth.domain.service.SchisandraSmsConfigDomainService;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig;
|
||||
import com.schisandra.auth.infra.basic.service.SchisandraSmsConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SchisandraSmsConfigDomainServiceImpl implements SchisandraSmsConfigDomainService {
|
||||
@Resource
|
||||
private SchisandraSmsConfigService schisandraSmsConfigService;
|
||||
|
||||
@Override
|
||||
public SchisandraSmsConfigBO queryByConfigId(String configId) {
|
||||
SchisandraSmsConfig schisandraSmsConfig= schisandraSmsConfigService.queryByConfigId(configId);
|
||||
return SchisandraSmsConfigBOConvert.INSTANCE.convertEntityToBO(schisandraSmsConfig);
|
||||
}
|
||||
|
||||
}
|
@@ -11,7 +11,8 @@ import org.springframework.stereotype.Repository;
|
||||
* @since 2024-04-11 13:00:10
|
||||
*/
|
||||
@Repository
|
||||
public interface SchisandraAuthPermissionDao extends BaseMapper<SchisandraAuthPermission> {
|
||||
public interface
|
||||
SchisandraAuthPermissionDao extends BaseMapper<SchisandraAuthPermission> {
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,18 +0,0 @@
|
||||
package com.schisandra.auth.infra.basic.dao;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-11 15:47:58
|
||||
*/
|
||||
@Repository
|
||||
public interface SchisandraSmsConfigDao extends BaseMapper<SchisandraSmsConfig> {
|
||||
|
||||
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -19,7 +20,7 @@ import java.util.Date;
|
||||
@Table(value = "schisandra_auth_permission")
|
||||
public class SchisandraAuthPermission implements Serializable {
|
||||
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
@@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -22,7 +23,7 @@ public class SchisandraAuthRole implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -22,7 +23,7 @@ public class SchisandraAuthRolePermission implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@@ -5,6 +5,7 @@ import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -23,7 +24,7 @@ public class SchisandraAuthUser implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@@ -5,6 +5,7 @@ import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -23,7 +24,7 @@ public class SchisandraAuthUserRole implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@@ -1,186 +0,0 @@
|
||||
package com.schisandra.auth.infra.basic.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-11 15:47:59
|
||||
*/
|
||||
@Data
|
||||
@Table(value = "schisandra_sms_config")
|
||||
public class SchisandraSmsConfig implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
/**
|
||||
* 配置id
|
||||
*/
|
||||
private String configId;
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String requestUrl;
|
||||
/**
|
||||
* 模板变量名称
|
||||
*/
|
||||
private String templateName;
|
||||
/**
|
||||
* 接口名称
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 地域信息
|
||||
*/
|
||||
private String region;
|
||||
|
||||
private String accessKeyId;
|
||||
|
||||
private String accessKeySecret;
|
||||
/**
|
||||
* 厂商名称标识
|
||||
*/
|
||||
private String supplier;
|
||||
/**
|
||||
* 短信签名
|
||||
*/
|
||||
private String signature;
|
||||
|
||||
private String sdkAppId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private Integer weight;
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer retryInterval;
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer maxRetries;
|
||||
/**
|
||||
* 厂商的发送数量上限,默认不设置上限
|
||||
*/
|
||||
private Long maximum;
|
||||
/**
|
||||
* REST API Base URL
|
||||
*/
|
||||
private String baseUrl;
|
||||
/**
|
||||
* 请求域名
|
||||
*/
|
||||
private String serverIp;
|
||||
/**
|
||||
* 请求端口
|
||||
*/
|
||||
private Integer serverPort;
|
||||
/**
|
||||
* 国内短信签名通道号
|
||||
*/
|
||||
private String sender;
|
||||
/**
|
||||
* 短信状态报告接收地
|
||||
*/
|
||||
private String statusCallBack;
|
||||
/**
|
||||
* APP接入地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 模板短信请求地址
|
||||
*/
|
||||
private String templateUrl;
|
||||
/**
|
||||
* 验证码短信请求地址
|
||||
*/
|
||||
private String codeUrl;
|
||||
/**
|
||||
* 验证码验证请求地址
|
||||
*/
|
||||
private String verifyUrl;
|
||||
/**
|
||||
* 是否需要支持短信上行。true:需要,false:不需要false
|
||||
*/
|
||||
private String needUp;
|
||||
/**
|
||||
* 请求超时时间
|
||||
*/
|
||||
private Integer connTimeout;
|
||||
/**
|
||||
* 是否为简易模式
|
||||
*/
|
||||
private String isSimple;
|
||||
/**
|
||||
* 短信发送后将向这个地址推送(运营商返回的)发送报告
|
||||
*/
|
||||
private String callbackUrl;
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Integer mchId;
|
||||
|
||||
private String appKey;
|
||||
|
||||
private Integer appId;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
* 单发链接
|
||||
*/
|
||||
private String singleMsgUrl;
|
||||
/**
|
||||
* 群发链接
|
||||
*/
|
||||
private String massMsgUrl;
|
||||
/**
|
||||
* 签名ID
|
||||
*/
|
||||
private String signatureId;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 是否删除 0 未删除 1已删除
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Integer isDeleted;
|
||||
|
||||
private String extraJson;
|
||||
/**
|
||||
* 服务名
|
||||
*/
|
||||
private String service;
|
||||
|
||||
}
|
||||
|
@@ -1,52 +0,0 @@
|
||||
package com.schisandra.auth.infra.basic.service;
|
||||
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-11 15:48:02
|
||||
*/
|
||||
public interface SchisandraSmsConfigService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraSmsConfig queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraSmsConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int insert(SchisandraSmsConfig schisandraSmsConfig);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraSmsConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraSmsConfig update(SchisandraSmsConfig schisandraSmsConfig);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
|
||||
SchisandraSmsConfig queryByConfigId(String configId);
|
||||
}
|
@@ -97,8 +97,7 @@ public class SchisandraAuthUserServiceImpl implements SchisandraAuthUserService
|
||||
@Override
|
||||
public SchisandraAuthUser selectByUuidAndType(String uuid, String type) {
|
||||
return schisandraAuthUserDao.selectOneByCondition(SchisandraAuthUserTableDef.SCHISANDRA_AUTH_USER.UUID.eq(uuid)
|
||||
.and(SchisandraAuthUserTableDef.SCHISANDRA_AUTH_USER.SOURCE.eq(type)
|
||||
.and(SchisandraAuthUserTableDef.SCHISANDRA_AUTH_USER.IS_DELETED.eq(0))));
|
||||
.and(SchisandraAuthUserTableDef.SCHISANDRA_AUTH_USER.SOURCE.eq(type)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,74 +0,0 @@
|
||||
package com.schisandra.auth.infra.basic.service.impl;
|
||||
|
||||
import com.schisandra.auth.infra.basic.dao.SchisandraSmsConfigDao;
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig;
|
||||
import com.schisandra.auth.infra.basic.entity.table.SchisandraSmsConfigTableDef;
|
||||
import com.schisandra.auth.infra.basic.service.SchisandraSmsConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (SchisandraSmsConfig)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-11 15:48:03
|
||||
*/
|
||||
@Service("schisandraSmsConfigService")
|
||||
public class SchisandraSmsConfigServiceImpl implements SchisandraSmsConfigService {
|
||||
@Resource
|
||||
private SchisandraSmsConfigDao schisandraSmsConfigDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSmsConfig queryById(Integer id) {
|
||||
return this.schisandraSmsConfigDao.selectOneById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraSmsConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int insert(SchisandraSmsConfig schisandraSmsConfig) {
|
||||
return schisandraSmsConfigDao.insert(schisandraSmsConfig,true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraSmsConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSmsConfig update(SchisandraSmsConfig schisandraSmsConfig) {
|
||||
this.schisandraSmsConfigDao.update(schisandraSmsConfig);
|
||||
return this.queryById(schisandraSmsConfig.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.schisandraSmsConfigDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchisandraSmsConfig queryByConfigId(String configId) {
|
||||
return schisandraSmsConfigDao.selectOneByCondition(SchisandraSmsConfigTableDef.SCHISANDRA_SMS_CONFIG.CONFIG_ID.eq(configId));
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
package com.schisandra.auth.infra.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Classname ConfigInfo
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.auth.application.rpc.bo
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-11 23:50
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ConfigInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键
|
||||
*/
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 系统内置(0是 1否)
|
||||
*/
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
}
|
@@ -5,40 +5,203 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Classname SmsConfigInfo
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.auth.application.rpc.bo
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-11 23:50
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
* 短信配置信息表 dto
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-06-19 22:20:47
|
||||
*/
|
||||
@Data
|
||||
public class SmsConfigInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
* id
|
||||
*/
|
||||
private String configName;
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 参数键
|
||||
* 配置id
|
||||
*/
|
||||
private String configKey;
|
||||
private String configId;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
* 请求地址
|
||||
*/
|
||||
private String configValue;
|
||||
private String requestUrl;
|
||||
|
||||
/**
|
||||
* 系统内置(0是 1否)
|
||||
* 模板变量名称
|
||||
*/
|
||||
private Integer configType;
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
* 接口名称
|
||||
*/
|
||||
private String remarks;
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 地域信息
|
||||
*/
|
||||
private String region;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String accessKeyId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String accessKeySecret;
|
||||
|
||||
/**
|
||||
* 厂商名称标识
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 短信签名
|
||||
*/
|
||||
private String signature;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String sdkAppId;
|
||||
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer retryInterval;
|
||||
|
||||
/**
|
||||
* 短信重试次数,默认0次不重试
|
||||
*/
|
||||
private Integer maxRetries;
|
||||
|
||||
/**
|
||||
* 厂商的发送数量上限,默认不设置上限
|
||||
*/
|
||||
private Long maximum;
|
||||
|
||||
/**
|
||||
* REST API Base URL
|
||||
*/
|
||||
private String baseUrl;
|
||||
|
||||
/**
|
||||
* 请求域名
|
||||
*/
|
||||
private String serverIp;
|
||||
|
||||
/**
|
||||
* 请求端口
|
||||
*/
|
||||
private Integer serverPort;
|
||||
|
||||
/**
|
||||
* 国内短信签名通道号
|
||||
*/
|
||||
private String sender;
|
||||
|
||||
/**
|
||||
* 短信状态报告接收地
|
||||
*/
|
||||
private String statusCallBack;
|
||||
|
||||
/**
|
||||
* APP接入地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 模板短信请求地址
|
||||
*/
|
||||
private String templateUrl;
|
||||
|
||||
/**
|
||||
* 验证码短信请求地址
|
||||
*/
|
||||
private String codeUrl;
|
||||
|
||||
/**
|
||||
* 验证码验证请求地址
|
||||
*/
|
||||
private String verifyUrl;
|
||||
|
||||
/**
|
||||
* 是否需要支持短信上行。true:需要,false:不需要false
|
||||
*/
|
||||
private String needUp;
|
||||
|
||||
/**
|
||||
* 请求超时时间
|
||||
*/
|
||||
private Integer connTimeout;
|
||||
|
||||
/**
|
||||
* 是否为简易模式
|
||||
*/
|
||||
private String isSimple;
|
||||
|
||||
/**
|
||||
* 短信发送后将向这个地址推送(运营商返回的)发送报告
|
||||
*/
|
||||
private String callbackUrl;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Integer mchId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer appId;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 单发链接
|
||||
*/
|
||||
private String singleMsgUrl;
|
||||
|
||||
/**
|
||||
* 群发链接
|
||||
*/
|
||||
private String massMsgUrl;
|
||||
|
||||
/**
|
||||
* 签名ID
|
||||
*/
|
||||
private String signatureId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String extraJson;
|
||||
|
||||
/**
|
||||
* 服务名
|
||||
*/
|
||||
private String service;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,41 @@
|
||||
package com.schisandra.auth.infra.rpc;
|
||||
|
||||
|
||||
import com.schisandra.auth.infra.entity.ConfigInfo;
|
||||
import com.schisandra.system.api.SchisandraSystemFeignService;
|
||||
import com.schisandra.system.entity.Result;
|
||||
import com.schisandra.system.entity.SchisandraSysConfigDTO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Classname ConfigRpc
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.auth.application.rpc
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-11 23:44
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class ConfigRpc {
|
||||
@Resource
|
||||
private SchisandraSystemFeignService schisandraSystemFeignService;
|
||||
|
||||
public ConfigInfo getConfigInfo(String key) {
|
||||
Result<SchisandraSysConfigDTO> result = schisandraSystemFeignService.getConfigByKey(key);
|
||||
ConfigInfo configInfo = new ConfigInfo();
|
||||
if (!result.getSuccess()) {
|
||||
return configInfo;
|
||||
}
|
||||
SchisandraSysConfigDTO data = result.getData();
|
||||
configInfo.setConfigKey(data.getConfigKey());
|
||||
configInfo.setConfigName(data.getConfigName());
|
||||
configInfo.setConfigValue(data.getConfigValue());
|
||||
configInfo.setRemarks(data.getRemarks());
|
||||
configInfo.setConfigType(data.getConfigType());
|
||||
return configInfo;
|
||||
}
|
||||
|
||||
}
|
@@ -1,10 +1,9 @@
|
||||
package com.schisandra.auth.infra.rpc;
|
||||
|
||||
|
||||
import com.schisandra.auth.infra.entity.SmsConfigInfo;
|
||||
import com.schisandra.system.api.SchisandraSystemFeignService;
|
||||
import com.schisandra.system.entity.Result;
|
||||
import com.schisandra.system.entity.SchisandraSysConfigDTO;
|
||||
import com.schisandra.system.entity.SchisandraSmsConfigDTO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -12,9 +11,9 @@ import javax.annotation.Resource;
|
||||
/**
|
||||
* @Classname SmsConfigRpc
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.auth.application.rpc
|
||||
* @BelongsPackage: com.schisandra.auth.infra.rpc
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-11 23:44
|
||||
* @CreateTime: 2024-06-19 22:39
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@@ -23,19 +22,49 @@ public class SmsConfigRpc {
|
||||
@Resource
|
||||
private SchisandraSystemFeignService schisandraSystemFeignService;
|
||||
|
||||
public SmsConfigInfo getConfigInfo(String key) {
|
||||
Result<SchisandraSysConfigDTO> result = schisandraSystemFeignService.getConfigByKey(key);
|
||||
public SmsConfigInfo getSmsConfigInfo(String configId) {
|
||||
Result<SchisandraSmsConfigDTO> result = schisandraSystemFeignService.querySmsByConfigId(configId);
|
||||
SmsConfigInfo smsConfigInfo = new SmsConfigInfo();
|
||||
if (!result.getSuccess()) {
|
||||
return smsConfigInfo;
|
||||
}
|
||||
SchisandraSysConfigDTO data = result.getData();
|
||||
smsConfigInfo.setConfigKey(data.getConfigKey());
|
||||
smsConfigInfo.setConfigName(data.getConfigName());
|
||||
smsConfigInfo.setConfigValue(data.getConfigValue());
|
||||
smsConfigInfo.setRemarks(data.getRemarks());
|
||||
smsConfigInfo.setConfigType(data.getConfigType());
|
||||
SchisandraSmsConfigDTO data = result.getData();
|
||||
smsConfigInfo.setConfigId(data.getConfigId());
|
||||
smsConfigInfo.setAction(data.getAction());
|
||||
smsConfigInfo.setAppId(data.getAppId());
|
||||
smsConfigInfo.setAppKey(data.getAppKey());
|
||||
smsConfigInfo.setBaseUrl(data.getBaseUrl());
|
||||
smsConfigInfo.setCodeUrl(data.getCodeUrl());
|
||||
smsConfigInfo.setAccessKeyId(data.getAccessKeyId());
|
||||
smsConfigInfo.setAccessKeySecret(data.getAccessKeySecret());
|
||||
smsConfigInfo.setCallbackUrl(data.getCallbackUrl());
|
||||
smsConfigInfo.setConnTimeout(data.getConnTimeout());
|
||||
smsConfigInfo.setIsSimple(data.getIsSimple());
|
||||
smsConfigInfo.setExtraJson(data.getExtraJson());
|
||||
smsConfigInfo.setMaximum(data.getMaximum());
|
||||
smsConfigInfo.setMaxRetries(data.getMaxRetries());
|
||||
smsConfigInfo.setMassMsgUrl(data.getMassMsgUrl());
|
||||
smsConfigInfo.setMchId(data.getMchId());
|
||||
smsConfigInfo.setNeedUp(data.getNeedUp());
|
||||
smsConfigInfo.setRegion(data.getRegion());
|
||||
smsConfigInfo.setRequestUrl(data.getRequestUrl());
|
||||
smsConfigInfo.setRetryInterval(data.getRetryInterval());
|
||||
smsConfigInfo.setSdkAppId(data.getSdkAppId());
|
||||
smsConfigInfo.setSender(data.getSender());
|
||||
smsConfigInfo.setServerPort(data.getServerPort());
|
||||
smsConfigInfo.setService(data.getService());
|
||||
smsConfigInfo.setSignature(data.getSignature());
|
||||
smsConfigInfo.setSignatureId(data.getSignatureId());
|
||||
smsConfigInfo.setSupplier(data.getSupplier());
|
||||
smsConfigInfo.setStatusCallBack(data.getStatusCallBack());
|
||||
smsConfigInfo.setTemplateUrl(data.getTemplateUrl());
|
||||
smsConfigInfo.setTemplateName(data.getTemplateName());
|
||||
smsConfigInfo.setTemplateId(data.getTemplateId());
|
||||
smsConfigInfo.setUrl(data.getUrl());
|
||||
smsConfigInfo.setVerifyUrl(data.getVerifyUrl());
|
||||
smsConfigInfo.setVersion(data.getVersion());
|
||||
smsConfigInfo.setWeight(data.getWeight());
|
||||
return smsConfigInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraSmsConfigDao">
|
||||
|
||||
<resultMap type="com.schisandra.auth.infra.basic.entity.SchisandraSmsConfig" id="SchisandraSmsConfigMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="configId" column="config_id" jdbcType="VARCHAR"/>
|
||||
<result property="requestUrl" column="request_url" jdbcType="VARCHAR"/>
|
||||
<result property="templateName" column="template_name" jdbcType="VARCHAR"/>
|
||||
<result property="action" column="action" jdbcType="VARCHAR"/>
|
||||
<result property="region" column="region" jdbcType="VARCHAR"/>
|
||||
<result property="accessKeyId" column="access_key_id" jdbcType="VARCHAR"/>
|
||||
<result property="accessKeySecret" column="access_key_secret" jdbcType="VARCHAR"/>
|
||||
<result property="supplier" column="supplier" jdbcType="VARCHAR"/>
|
||||
<result property="signature" column="signature" jdbcType="VARCHAR"/>
|
||||
<result property="sdkAppId" column="sdk_app_id" jdbcType="VARCHAR"/>
|
||||
<result property="templateId" column="template_id" jdbcType="VARCHAR"/>
|
||||
<result property="weight" column="weight" jdbcType="INTEGER"/>
|
||||
<result property="retryInterval" column="retry_interval" jdbcType="INTEGER"/>
|
||||
<result property="maxRetries" column="max_retries" jdbcType="INTEGER"/>
|
||||
<result property="maximum" column="maximum" jdbcType="INTEGER"/>
|
||||
<result property="baseUrl" column="base_url" jdbcType="VARCHAR"/>
|
||||
<result property="serverIp" column="server_ip" jdbcType="VARCHAR"/>
|
||||
<result property="serverPort" column="server_port" jdbcType="INTEGER"/>
|
||||
<result property="sender" column="sender" jdbcType="VARCHAR"/>
|
||||
<result property="statusCallBack" column="status_call_back" jdbcType="VARCHAR"/>
|
||||
<result property="url" column="url" jdbcType="VARCHAR"/>
|
||||
<result property="templateUrl" column="template_url" jdbcType="VARCHAR"/>
|
||||
<result property="codeUrl" column="code_url" jdbcType="VARCHAR"/>
|
||||
<result property="verifyUrl" column="verify_url" jdbcType="VARCHAR"/>
|
||||
<result property="needUp" column="need_up" jdbcType="VARCHAR"/>
|
||||
<result property="connTimeout" column="conn_timeout" jdbcType="INTEGER"/>
|
||||
<result property="isSimple" column="is_simple" jdbcType="VARCHAR"/>
|
||||
<result property="callbackUrl" column="callback_url" jdbcType="VARCHAR"/>
|
||||
<result property="mchId" column="mch_id" jdbcType="INTEGER"/>
|
||||
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="INTEGER"/>
|
||||
<result property="version" column="version" jdbcType="VARCHAR"/>
|
||||
<result property="singleMsgUrl" column="single_msg_url" jdbcType="VARCHAR"/>
|
||||
<result property="massMsgUrl" column="mass_msg_url" jdbcType="VARCHAR"/>
|
||||
<result property="signatureId" column="signature_Id" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
<result property="extraJson" column="extra_json" jdbcType="VARCHAR"/>
|
||||
<result property="service" column="service" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
|
@@ -88,7 +88,7 @@ mybatis-flex:
|
||||
global-config:
|
||||
print-banner: false
|
||||
key-config:
|
||||
key-type: auto
|
||||
key-type: generator
|
||||
normal-value-of-logic-delete: 0
|
||||
deleted-value-of-logic-delete: 1
|
||||
logic-delete-column: is_deleted
|
||||
|
Reference in New Issue
Block a user