소스 검색

:tada: 增加短信封装、优化oss配置

smallchill 6 년 전
부모
커밋
0c215179bb
40개의 변경된 파일2029개의 추가작업 그리고 402개의 파일을 삭제
  1. 1 1
      README.md
  2. 2 10
      blade-ops/blade-resource/pom.xml
  3. 2 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/AliOssBuilder.java
  4. 2 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/MinioOssBuilder.java
  5. 6 6
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java
  6. 2 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/QiniuOssBuilder.java
  7. 2 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/TencentOssBuilder.java
  8. 50 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/AliSmsBuilder.java
  9. 47 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/QiniuSmsBuilder.java
  10. 138 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/SmsBuilder.java
  11. 46 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/TencentSmsBuilder.java
  12. 44 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/YunpianSmsBuilder.java
  13. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/config/BladeOssConfiguration.java
  14. 47 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/config/BladeSmsConfiguration.java
  15. 2 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/OssController.java
  16. 151 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/SmsController.java
  17. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java
  18. 164 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/SmsEndpoint.java
  19. 0 23
      blade-ops/blade-resource/src/main/java/org/springblade/resource/entity/OssVO.java
  20. 83 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/entity/Sms.java
  21. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/mapper/OssMapper.java
  22. 42 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/mapper/SmsMapper.java
  23. 30 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/mapper/SmsMapper.xml
  24. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/service/IOssService.java
  25. 57 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/service/ISmsService.java
  26. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/service/impl/OssServiceImpl.java
  27. 68 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/service/impl/SmsServiceImpl.java
  28. 29 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/vo/OssVO.java
  29. 46 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/vo/SmsVO.java
  30. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/wrapper/OssWrapper.java
  31. 49 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/wrapper/SmsWrapper.java
  32. 1 1
      doc/sql/mysql/bladex-saber-mysql.sql
  33. 1 1
      doc/sql/mysql/bladex-sword-mysql.sql
  34. 275 200
      doc/sql/oracle/bladex-saber-oracle.sql
  35. 228 116
      doc/sql/oracle/bladex-sword-oracle.sql
  36. 70 5
      doc/sql/postgresql/bladex-saber-postgresql.sql
  37. 87 22
      doc/sql/postgresql/bladex-sword-postgresql.sql
  38. 72 1
      doc/sql/update/mysql-update-2.3.1~2.4.0.sql
  39. 89 0
      doc/sql/update/oracle-update-2.3.1~2.4.0.sql
  40. 90 0
      doc/sql/update/postgresql-update-2.3.1~2.4.0.sql

+ 1 - 1
README.md

@@ -40,4 +40,4 @@
 
 ## 举报有奖
 * 向官方提供有用线索并成功捣毁盗版个人或窝点,将会看成果给予 500~10000 不等的现金奖励
-* 官方唯一指定QQ:85088620
+* 官方唯一指定QQ:1272154962

+ 2 - 10
blade-ops/blade-resource/pom.xml

@@ -29,19 +29,11 @@
         </dependency>
         <dependency>
             <groupId>org.springblade</groupId>
-            <artifactId>blade-starter-oss-aliyun</artifactId>
+            <artifactId>blade-starter-oss-all</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springblade</groupId>
-            <artifactId>blade-starter-oss-minio</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springblade</groupId>
-            <artifactId>blade-starter-oss-qiniu</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springblade</groupId>
-            <artifactId>blade-starter-oss-tencent</artifactId>
+            <artifactId>blade-starter-sms-all</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springblade</groupId>

+ 2 - 2
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/AliBuilder.java → blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/AliOssBuilder.java

@@ -14,7 +14,7 @@
  *  this software without specific prior written permission.
  *  Author: Chill 庄骞 (smallchill@163.com)
  */
-package org.springblade.resource.builder;
+package org.springblade.resource.builder.oss;
 
 import com.aliyun.oss.ClientConfiguration;
 import com.aliyun.oss.OSSClient;
@@ -32,7 +32,7 @@ import org.springblade.resource.entity.Oss;
  *
  * @author Chill
  */
-public class AliBuilder {
+public class AliOssBuilder {
 
 	@SneakyThrows
 	public static OssTemplate template(Oss oss, OssRule ossRule) {

+ 2 - 2
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/MinioBuilder.java → blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/MinioOssBuilder.java

@@ -14,7 +14,7 @@
  *  this software without specific prior written permission.
  *  Author: Chill 庄骞 (smallchill@163.com)
  */
-package org.springblade.resource.builder;
+package org.springblade.resource.builder.oss;
 
 import io.minio.MinioClient;
 import lombok.SneakyThrows;
@@ -29,7 +29,7 @@ import org.springblade.resource.entity.Oss;
  *
  * @author Chill
  */
-public class MinioBuilder {
+public class MinioOssBuilder {
 
 	@SneakyThrows
 	public static OssTemplate template(Oss oss, OssRule ossRule) {

+ 6 - 6
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java → blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java

@@ -14,7 +14,7 @@
  *  this software without specific prior written permission.
  *  Author: Chill 庄骞 (smallchill@163.com)
  */
-package org.springblade.resource.builder;
+package org.springblade.resource.builder.oss;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -89,13 +89,13 @@ public class OssBuilder {
 						ossRule = new BladeOssRule(Boolean.FALSE);
 					}
 					if (oss.getCategory() == OssEnum.MINIO.getCategory()) {
-						template = MinioBuilder.template(oss, ossRule);
+						template = MinioOssBuilder.template(oss, ossRule);
 					} else if (oss.getCategory() == OssEnum.QINIU.getCategory()) {
-						template = QiniuBuilder.template(oss, ossRule);
+						template = QiniuOssBuilder.template(oss, ossRule);
 					} else if (oss.getCategory() == OssEnum.ALI.getCategory()) {
-						template = AliBuilder.template(oss, ossRule);
+						template = AliOssBuilder.template(oss, ossRule);
 					} else if (oss.getCategory() == OssEnum.TENCENT.getCategory()) {
-						template = TencentBuilder.template(oss, ossRule);
+						template = TencentOssBuilder.template(oss, ossRule);
 					}
 					templatePool.put(tenantId, template);
 					ossPool.put(tenantId, oss);
@@ -109,7 +109,7 @@ public class OssBuilder {
 	 * 获取对象存储实体
 	 *
 	 * @param tenantId 租户ID
-	 * @return Role
+	 * @return Oss
 	 */
 	public Oss getOss(String tenantId) {
 		String key = tenantId;

+ 2 - 2
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/QiniuBuilder.java → blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/QiniuOssBuilder.java

@@ -14,7 +14,7 @@
  *  this software without specific prior written permission.
  *  Author: Chill 庄骞 (smallchill@163.com)
  */
-package org.springblade.resource.builder;
+package org.springblade.resource.builder.oss;
 
 import com.qiniu.common.Zone;
 import com.qiniu.storage.BucketManager;
@@ -33,7 +33,7 @@ import org.springblade.resource.entity.Oss;
  *
  * @author Chill
  */
-public class QiniuBuilder {
+public class QiniuOssBuilder {
 
 	@SneakyThrows
 	public static OssTemplate template(Oss oss, OssRule ossRule) {

+ 2 - 2
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/TencentBuilder.java → blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/TencentOssBuilder.java

@@ -14,7 +14,7 @@
  *  this software without specific prior written permission.
  *  Author: Chill 庄骞 (smallchill@163.com)
  */
-package org.springblade.resource.builder;
+package org.springblade.resource.builder.oss;
 
 import com.qcloud.cos.COSClient;
 import com.qcloud.cos.ClientConfig;
@@ -33,7 +33,7 @@ import org.springblade.resource.entity.Oss;
  *
  * @author Chill
  */
-public class TencentBuilder {
+public class TencentOssBuilder {
 
 	@SneakyThrows
 	public static OssTemplate template(Oss oss, OssRule ossRule) {

+ 50 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/AliSmsBuilder.java

@@ -0,0 +1,50 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.builder.sms;
+
+import com.aliyuncs.DefaultAcsClient;
+import com.aliyuncs.IAcsClient;
+import com.aliyuncs.profile.DefaultProfile;
+import com.aliyuncs.profile.IClientProfile;
+import lombok.SneakyThrows;
+import org.springblade.core.redis.cache.BladeRedisCache;
+import org.springblade.core.sms.SmsTemplate;
+import org.springblade.core.sms.aliyun.AliSmsTemplate;
+import org.springblade.core.sms.props.SmsProperties;
+import org.springblade.resource.entity.Sms;
+
+/**
+ * 阿里云短信构建类
+ *
+ * @author Chill
+ */
+public class AliSmsBuilder {
+
+	@SneakyThrows
+	public static SmsTemplate template(Sms sms, BladeRedisCache redisCache) {
+		SmsProperties smsProperties = new SmsProperties();
+		smsProperties.setTemplateId(sms.getTemplateId());
+		smsProperties.setAccessKey(sms.getAccessKey());
+		smsProperties.setSecretKey(sms.getSecretKey());
+		smsProperties.setRegionId(sms.getRegionId());
+		smsProperties.setSignName(sms.getSignName());
+		IClientProfile profile = DefaultProfile.getProfile(smsProperties.getRegionId(), smsProperties.getAccessKey(), smsProperties.getSecretKey());
+		IAcsClient acsClient = new DefaultAcsClient(profile);
+		return new AliSmsTemplate(smsProperties, acsClient, redisCache);
+	}
+
+}

+ 47 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/QiniuSmsBuilder.java

@@ -0,0 +1,47 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.builder.sms;
+
+import com.qiniu.sms.SmsManager;
+import com.qiniu.util.Auth;
+import lombok.SneakyThrows;
+import org.springblade.core.redis.cache.BladeRedisCache;
+import org.springblade.core.sms.SmsTemplate;
+import org.springblade.core.sms.props.SmsProperties;
+import org.springblade.core.sms.qiniu.QiniuSmsTemplate;
+import org.springblade.resource.entity.Sms;
+
+/**
+ * 七牛云短信构建类
+ *
+ * @author Chill
+ */
+public class QiniuSmsBuilder {
+
+	@SneakyThrows
+	public static SmsTemplate template(Sms sms, BladeRedisCache redisCache) {
+		SmsProperties smsProperties = new SmsProperties();
+		smsProperties.setTemplateId(sms.getTemplateId());
+		smsProperties.setAccessKey(sms.getAccessKey());
+		smsProperties.setSecretKey(sms.getSecretKey());
+		smsProperties.setSignName(sms.getSignName());
+		Auth auth = Auth.create(smsProperties.getAccessKey(), smsProperties.getSecretKey());
+		SmsManager smsManager = new SmsManager(auth);
+		return new QiniuSmsTemplate(smsProperties, smsManager, redisCache);
+	}
+
+}

+ 138 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/SmsBuilder.java

@@ -0,0 +1,138 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.builder.sms;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.cache.utils.CacheUtil;
+import org.springblade.core.redis.cache.BladeRedisCache;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.sms.SmsTemplate;
+import org.springblade.core.sms.enums.SmsEnum;
+import org.springblade.core.sms.enums.SmsStatusEnum;
+import org.springblade.core.sms.props.SmsProperties;
+import org.springblade.core.tool.utils.Func;
+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.mapper.SmsMapper;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE;
+
+/**
+ * Sms短信服务统一构建类
+ *
+ * @author Chill
+ */
+public class SmsBuilder {
+
+	public static final String SMS_CODE = "sms:code:";
+	public static final String SMS_PARAM_KEY = "code";
+
+	private final SmsProperties smsProperties;
+	private final SmsMapper smsMapper;
+	private final BladeRedisCache redisCache;
+
+
+	public SmsBuilder(SmsProperties smsProperties, SmsMapper smsMapper, BladeRedisCache redisCache) {
+		this.smsProperties = smsProperties;
+		this.smsMapper = smsMapper;
+		this.redisCache = redisCache;
+	}
+
+	/**
+	 * SmsTemplate配置缓存池
+	 */
+	private Map<String, SmsTemplate> templatePool = new ConcurrentHashMap<>();
+
+	/**
+	 * Sms配置缓存池
+	 */
+	private Map<String, Sms> smsPool = new ConcurrentHashMap<>();
+
+
+	/**
+	 * 获取template
+	 *
+	 * @return SmsTemplate
+	 */
+	public SmsTemplate template() {
+		String tenantId = SecureUtil.getTenantId();
+		Sms sms = getSms(tenantId);
+		Sms smsCached = smsPool.get(tenantId);
+		SmsTemplate template = templatePool.get(tenantId);
+		// 若为空或者不一致,则重新加载
+		if (Func.hasEmpty(template, smsCached) || !sms.getTemplateId().equals(smsCached.getTemplateId()) || !sms.getAccessKey().equals(smsCached.getAccessKey())) {
+			synchronized (SmsBuilder.class) {
+				template = templatePool.get(tenantId);
+				if (Func.hasEmpty(template, smsCached) || !sms.getAccessKey().equals(smsCached.getAccessKey())) {
+					if (sms.getCategory() == SmsEnum.YUNPIAN.getCategory()) {
+						template = YunpianSmsBuilder.template(sms, redisCache);
+					} else if (sms.getCategory() == SmsEnum.QINIU.getCategory()) {
+						template = QiniuSmsBuilder.template(sms, redisCache);
+					} else if (sms.getCategory() == SmsEnum.ALI.getCategory()) {
+						template = AliSmsBuilder.template(sms, redisCache);
+					} else if (sms.getCategory() == SmsEnum.TENCENT.getCategory()) {
+						template = YunpianSmsBuilder.template(sms, redisCache);
+					}
+					templatePool.put(tenantId, template);
+					smsPool.put(tenantId, sms);
+				}
+			}
+		}
+		return template;
+	}
+
+
+	/**
+	 * 获取短信实体
+	 *
+	 * @param tenantId 租户ID
+	 * @return Sms
+	 */
+	public Sms getSms(String tenantId) {
+		String key = tenantId;
+		LambdaQueryWrapper<Sms> lqw = Wrappers.<Sms>query().lambda().eq(Sms::getTenantId, tenantId);
+		// 获取传参的资源编号并查询,若有则返回,若没有则调启用的配置
+		String smsCode = WebUtil.getParameter(SMS_PARAM_KEY);
+		if (StringUtil.isNotBlank(smsCode)) {
+			key = key.concat(StringPool.DASH).concat(smsCode);
+			lqw.eq(Sms::getSmsCode, smsCode);
+		} else {
+			lqw.eq(Sms::getStatus, SmsStatusEnum.ENABLE.getNum());
+		}
+		return CacheUtil.get(RESOURCE_CACHE, SMS_CODE, key, () -> {
+			Sms s = smsMapper.selectOne(lqw);
+			// 若为空则调用默认配置
+			if ((Func.isEmpty(s))) {
+				Sms defaultSms = new Sms();
+				defaultSms.setCategory(SmsEnum.QINIU.getCategory());
+				defaultSms.setAccessKey(smsProperties.getAccessKey());
+				defaultSms.setSecretKey(smsProperties.getSecretKey());
+				defaultSms.setSignName(smsProperties.getSignName());
+				return defaultSms;
+			} else {
+				return s;
+			}
+		});
+	}
+
+}

+ 46 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/TencentSmsBuilder.java

@@ -0,0 +1,46 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.builder.sms;
+
+import com.github.qcloudsms.SmsMultiSender;
+import lombok.SneakyThrows;
+import org.springblade.core.redis.cache.BladeRedisCache;
+import org.springblade.core.sms.SmsTemplate;
+import org.springblade.core.sms.props.SmsProperties;
+import org.springblade.core.sms.tencent.TencentSmsTemplate;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.resource.entity.Sms;
+
+/**
+ * 腾讯云短信构建类
+ *
+ * @author Chill
+ */
+public class TencentSmsBuilder {
+
+	@SneakyThrows
+	public static SmsTemplate template(Sms sms, BladeRedisCache redisCache) {
+		SmsProperties smsProperties = new SmsProperties();
+		smsProperties.setTemplateId(sms.getTemplateId());
+		smsProperties.setAccessKey(sms.getAccessKey());
+		smsProperties.setSecretKey(sms.getSecretKey());
+		smsProperties.setSignName(sms.getSignName());
+		SmsMultiSender smsSender = new SmsMultiSender(Func.toInt(smsProperties.getAccessKey()), sms.getSecretKey());
+		return new TencentSmsTemplate(smsProperties, smsSender, redisCache);
+	}
+
+}

+ 44 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/YunpianSmsBuilder.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.builder.sms;
+
+import com.yunpian.sdk.YunpianClient;
+import lombok.SneakyThrows;
+import org.springblade.core.redis.cache.BladeRedisCache;
+import org.springblade.core.sms.SmsTemplate;
+import org.springblade.core.sms.props.SmsProperties;
+import org.springblade.core.sms.yunpian.YunpianSmsTemplate;
+import org.springblade.resource.entity.Sms;
+
+/**
+ * 云片短信构建类
+ *
+ * @author Chill
+ */
+public class YunpianSmsBuilder {
+
+	@SneakyThrows
+	public static SmsTemplate template(Sms sms, BladeRedisCache redisCache) {
+		SmsProperties smsProperties = new SmsProperties();
+		smsProperties.setTemplateId(sms.getTemplateId());
+		smsProperties.setAccessKey(sms.getAccessKey());
+		smsProperties.setSignName(sms.getSignName());
+		YunpianClient client = new YunpianClient(smsProperties.getAccessKey()).init();
+		return new YunpianSmsTemplate(smsProperties, client, redisCache);
+	}
+
+}

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/config/BladeOssConfiguration.java

@@ -18,7 +18,7 @@ package org.springblade.resource.config;
 
 import lombok.AllArgsConstructor;
 import org.springblade.core.oss.props.OssProperties;
-import org.springblade.resource.builder.OssBuilder;
+import org.springblade.resource.builder.oss.OssBuilder;
 import org.springblade.resource.mapper.OssMapper;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;

+ 47 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/config/BladeSmsConfiguration.java

@@ -0,0 +1,47 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.config;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.redis.cache.BladeRedisCache;
+import org.springblade.core.sms.props.SmsProperties;
+import org.springblade.resource.builder.sms.SmsBuilder;
+import org.springblade.resource.mapper.SmsMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Sms配置类
+ *
+ * @author Chill
+ */
+@Configuration
+@AllArgsConstructor
+public class BladeSmsConfiguration {
+
+	private SmsProperties smsProperties;
+
+	private SmsMapper smsMapper;
+
+	private BladeRedisCache redisCache;
+
+	@Bean
+	public SmsBuilder smsBuilder() {
+		return new SmsBuilder(smsProperties, smsMapper, redisCache);
+	}
+
+}

+ 2 - 2
blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/OssController.java

@@ -30,7 +30,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.RoleConstant;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.resource.entity.Oss;
-import org.springblade.resource.entity.OssVO;
+import org.springblade.resource.vo.OssVO;
 import org.springblade.resource.service.IOssService;
 import org.springblade.resource.wrapper.OssWrapper;
 import org.springframework.cache.annotation.CacheEvict;
@@ -47,11 +47,11 @@ import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE;
  * @author BladeX
  * @since 2019-05-26
  */
+@ApiIgnore
 @RestController
 @AllArgsConstructor
 @RequestMapping("/oss")
 @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
-@ApiIgnore
 @Api(value = "对象存储接口", tags = "对象存储接口")
 public class OssController extends BladeController {
 

+ 151 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/SmsController.java

@@ -0,0 +1,151 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.annotation.PreAuth;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.RoleConstant;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.resource.entity.Sms;
+import org.springblade.resource.service.ISmsService;
+import org.springblade.resource.vo.SmsVO;
+import org.springblade.resource.wrapper.SmsWrapper;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+
+import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE;
+
+/**
+ * 短信配置表 控制器
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/sms")
+@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+@Api(value = "短信配置表", tags = "短信配置表接口")
+public class SmsController extends BladeController {
+
+	private ISmsService smsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入sms")
+	public R<SmsVO> detail(Sms sms) {
+		Sms detail = smsService.getOne(Condition.getQueryWrapper(sms));
+		return R.data(SmsWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 短信配置表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入sms")
+	public R<IPage<SmsVO>> list(Sms sms, Query query) {
+		IPage<Sms> pages = smsService.page(Condition.getPage(query), Condition.getQueryWrapper(sms));
+		return R.data(SmsWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 短信配置表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入sms")
+	public R<IPage<SmsVO>> page(SmsVO sms, Query query) {
+		IPage<SmsVO> pages = smsService.selectSmsPage(Condition.getPage(query), sms);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 短信配置表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入sms")
+	@CacheEvict(cacheNames = {RESOURCE_CACHE}, allEntries = true)
+	public R save(@Valid @RequestBody Sms sms) {
+		return R.status(smsService.save(sms));
+	}
+
+	/**
+	 * 修改 短信配置表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入sms")
+	@CacheEvict(cacheNames = {RESOURCE_CACHE}, allEntries = true)
+	public R update(@Valid @RequestBody Sms sms) {
+		return R.status(smsService.updateById(sms));
+	}
+
+	/**
+	 * 新增或修改 短信配置表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入sms")
+	@CacheEvict(cacheNames = {RESOURCE_CACHE}, allEntries = true)
+	public R submit(@Valid @RequestBody Sms sms) {
+		return R.status(smsService.submit(sms));
+	}
+
+
+	/**
+	 * 删除 短信配置表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	@CacheEvict(cacheNames = {RESOURCE_CACHE}, allEntries = true)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(smsService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 启用
+	 */
+	@PostMapping("/enable")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "配置启用", notes = "传入id")
+	@CacheEvict(cacheNames = {RESOURCE_CACHE}, allEntries = true)
+	public R enable(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
+		return R.status(smsService.enable(id));
+	}
+
+
+}

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java

@@ -25,7 +25,7 @@ import org.springblade.core.secure.annotation.PreAuth;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.RoleConstant;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.resource.builder.OssBuilder;
+import org.springblade.resource.builder.oss.OssBuilder;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 

+ 164 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/SmsEndpoint.java

@@ -0,0 +1,164 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.endpoint;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.SneakyThrows;
+import org.springblade.core.sms.model.SmsCode;
+import org.springblade.core.sms.model.SmsData;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.jackson.JsonUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.RandomType;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.resource.builder.sms.SmsBuilder;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 短信服务端点
+ *
+ * @author Chill
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/sms/endpoint")
+@Api(value = "短信服务端点", tags = "短信服务端点")
+public class SmsEndpoint {
+
+	private static final String PARAM_KEY = "code";
+	private static final String SEND_SUCCESS = "短信发送成功";
+	private static final String SEND_FAIL = "短信发送失败";
+	private static final String VALIDATE_SUCCESS = "验证码校验成功";
+	private static final String VALIDATE_FAIL = "验证码校验失败";
+
+	private SmsBuilder smsBuilder;
+
+	//================================= 短信服务校验 =================================
+
+	/**
+	 * 短信验证码发送
+	 *
+	 * @param phone 手机号
+	 */
+	@SneakyThrows
+	@PostMapping("/send-validate")
+	public R sendValidate(@RequestParam String phone) {
+		Map<String, String> params = new HashMap<>(1);
+		params.put(PARAM_KEY, StringUtil.random(6, RandomType.INT));
+		SmsCode smsCode = smsBuilder.template().sendValidate(new SmsData(params).setKey(PARAM_KEY), phone);
+		return smsCode.isSuccess() ? R.data(smsCode, SEND_SUCCESS) : R.fail(SEND_FAIL);
+	}
+
+	/**
+	 * 校验短信
+	 *
+	 * @param smsCode 短信校验信息
+	 */
+	@SneakyThrows
+	@PostMapping("/validate-message")
+	public R validateMessage(SmsCode smsCode) {
+		boolean validate = smsBuilder.template().validateMessage(smsCode);
+		return validate ? R.success(VALIDATE_SUCCESS) : R.fail(VALIDATE_FAIL);
+	}
+
+	//========== 通用短信自定义发送(支持自定义params参数传递, 推荐用于测试, 不推荐用于生产环境) ==========
+
+	/**
+	 * 发送信息
+	 *
+	 * @param params 自定义短信参数
+	 * @param phones 手机号集合
+	 */
+	@SneakyThrows
+	@PostMapping("/send-message")
+	public R sendMessage(@RequestParam String params, @RequestParam String phones) {
+		SmsData smsData = new SmsData(JsonUtil.readMap(params, String.class, String.class));
+		return send(smsData, phones);
+	}
+
+	//========== 指定短信服务发送(可根据各种场景自定拓展定制, 损失灵活性增加安全性, 推荐用于生产环境) ==========
+
+	/**
+	 * 短信通知
+	 *
+	 * @param phones 手机号集合
+	 */
+	@SneakyThrows
+	@PostMapping("/send-notice")
+	public R sendNotice(@RequestParam String phones) {
+		Map<String, String> params = new HashMap<>(3);
+		params.put("title", "通知标题");
+		params.put("content", "通知内容");
+		params.put("date", "通知时间");
+		SmsData smsData = new SmsData(params);
+		return send(smsData, phones);
+	}
+
+	/**
+	 * 订单通知
+	 *
+	 * @param phones 手机号集合
+	 */
+	@SneakyThrows
+	@PostMapping("/send-order")
+	public R sendOrder(@RequestParam String phones) {
+		Map<String, String> params = new HashMap<>(3);
+		params.put("orderNo", "订单编号");
+		params.put("packageNo", "快递单号");
+		params.put("user", "收件人");
+		SmsData smsData = new SmsData(params);
+		return send(smsData, phones);
+	}
+
+	/**
+	 * 会议通知
+	 *
+	 * @param phones 手机号集合
+	 */
+	@SneakyThrows
+	@PostMapping("/send-meeting")
+	public R sendMeeting(@RequestParam String phones) {
+		Map<String, String> params = new HashMap<>(2);
+		params.put("roomId", "会议室");
+		params.put("topic", "会议主题");
+		params.put("date", "会议时间");
+		SmsData smsData = new SmsData(params);
+		return send(smsData, phones);
+	}
+
+	//================================= 通用短信发送接口 =================================
+
+	/**
+	 * 通用短信发送接口
+	 *
+	 * @param smsData 短信内容
+	 * @param phones  手机号列表
+	 * @return 是否发送成功
+	 */
+	private R send(SmsData smsData, String phones) {
+		SmsCode smsCode = smsBuilder.template().sendMulti(smsData, Func.toStrList(phones));
+		return smsCode.isSuccess() ? R.data(smsCode, SEND_SUCCESS) : R.fail(SEND_FAIL);
+	}
+
+}

+ 0 - 23
blade-ops/blade-resource/src/main/java/org/springblade/resource/entity/OssVO.java

@@ -1,23 +0,0 @@
-package org.springblade.resource.entity;
-
-import lombok.Data;
-
-/**
- * OssVO
- *
- * @author Chill
- */
-@Data
-public class OssVO extends Oss {
-
-	/**
-	 * 分类名
-	 */
-	private String categoryName;
-
-	/**
-	 * 是否启用
-	 */
-	private String statusName;
-
-}

+ 83 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/entity/Sms.java

@@ -0,0 +1,83 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+/**
+ * 短信配置表实体类
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+@Data
+@TableName("blade_sms")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Sms对象", description = "短信配置表")
+public class Sms extends TenantEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 资源编号
+	 */
+	@ApiModelProperty(value = "资源编号")
+	private String smsCode;
+
+	/**
+	 * 模板ID
+	 */
+	@ApiModelProperty(value = "模板ID")
+	private String templateId;
+	/**
+	 * 分类
+	 */
+	@ApiModelProperty(value = "分类")
+	private Integer category;
+	/**
+	 * accessKey
+	 */
+	@ApiModelProperty(value = "accessKey")
+	private String accessKey;
+	/**
+	 * secretKey
+	 */
+	@ApiModelProperty(value = "secretKey")
+	private String secretKey;
+	/**
+	 * regionId
+	 */
+	@ApiModelProperty(value = "regionId")
+	private String regionId;
+	/**
+	 * 短信签名
+	 */
+	@ApiModelProperty(value = "短信签名")
+	private String signName;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+
+}

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/mapper/OssMapper.java

@@ -19,7 +19,7 @@ package org.springblade.resource.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.resource.entity.Oss;
-import org.springblade.resource.entity.OssVO;
+import org.springblade.resource.vo.OssVO;
 
 import java.util.List;
 

+ 42 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/mapper/SmsMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.mapper;
+
+import org.springblade.resource.entity.Sms;
+import org.springblade.resource.vo.SmsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 短信配置表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+public interface SmsMapper extends BaseMapper<Sms> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param sms
+	 * @return
+	 */
+	List<SmsVO> selectSmsPage(IPage page, SmsVO sms);
+
+}

+ 30 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/mapper/SmsMapper.xml

@@ -0,0 +1,30 @@
+<?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="org.springblade.resource.mapper.SmsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="smsResultMap" type="org.springblade.resource.entity.Sms">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="sms_code" property="smsCode"/>
+        <result column="template_id" property="templateId"/>
+        <result column="category" property="category"/>
+        <result column="access_key" property="accessKey"/>
+        <result column="secret_key" property="secretKey"/>
+        <result column="region_id" property="regionId"/>
+        <result column="sign_name" property="signName"/>
+        <result column="remark" property="remark"/>
+    </resultMap>
+
+
+    <select id="selectSmsPage" resultMap="smsResultMap">
+        select * from blade_sms where is_deleted = 0
+    </select>
+
+</mapper>

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/service/IOssService.java

@@ -19,7 +19,7 @@ package org.springblade.resource.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.resource.entity.Oss;
-import org.springblade.resource.entity.OssVO;
+import org.springblade.resource.vo.OssVO;
 
 /**
  * 服务类

+ 57 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/service/ISmsService.java

@@ -0,0 +1,57 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.resource.entity.Sms;
+import org.springblade.resource.vo.SmsVO;
+
+/**
+ * 短信配置表 服务类
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+public interface ISmsService extends BaseService<Sms> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param sms
+	 * @return
+	 */
+	IPage<SmsVO> selectSmsPage(IPage<SmsVO> page, SmsVO sms);
+
+	/**
+	 * 提交oss信息
+	 *
+	 * @param oss
+	 * @return
+	 */
+	boolean submit(Sms oss);
+
+	/**
+	 * 启动配置
+	 *
+	 * @param id
+	 * @return
+	 */
+	boolean enable(Long id);
+
+}

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/service/impl/OssServiceImpl.java

@@ -24,7 +24,7 @@ import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.resource.entity.Oss;
-import org.springblade.resource.entity.OssVO;
+import org.springblade.resource.vo.OssVO;
 import org.springblade.resource.mapper.OssMapper;
 import org.springblade.resource.service.IOssService;
 import org.springframework.stereotype.Service;

+ 68 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/service/impl/SmsServiceImpl.java

@@ -0,0 +1,68 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.resource.entity.Sms;
+import org.springblade.resource.mapper.SmsMapper;
+import org.springblade.resource.service.ISmsService;
+import org.springblade.resource.vo.SmsVO;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 短信配置表 服务实现类
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+@Service
+public class SmsServiceImpl extends BaseServiceImpl<SmsMapper, Sms> implements ISmsService {
+
+	@Override
+	public IPage<SmsVO> selectSmsPage(IPage<SmsVO> page, SmsVO sms) {
+		return page.setRecords(baseMapper.selectSmsPage(page, sms));
+	}
+
+	@Override
+	public boolean submit(Sms sms) {
+		LambdaQueryWrapper<Sms> lqw = Wrappers.<Sms>query().lambda()
+			.eq(Sms::getSmsCode, sms.getSmsCode()).eq(Sms::getTenantId, AuthUtil.getTenantId());
+		Integer cnt = baseMapper.selectCount(Func.isEmpty(sms.getId()) ? lqw : lqw.notIn(Sms::getId, sms.getId()));
+		if (cnt > 0) {
+			throw new ServiceException("当前资源编号已存在!");
+		}
+		return this.saveOrUpdate(sms);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public boolean enable(Long id) {
+		// 先禁用
+		boolean temp1 = this.update(Wrappers.<Sms>update().lambda().set(Sms::getStatus, 1));
+		// 在启用
+		boolean temp2 = this.update(Wrappers.<Sms>update().lambda().set(Sms::getStatus, 2).eq(Sms::getId, id));
+		return temp1 && temp2;
+	}
+
+}

+ 29 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/vo/OssVO.java

@@ -0,0 +1,29 @@
+package org.springblade.resource.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.resource.entity.Oss;
+
+/**
+ * OssVO
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "OssVO对象", description = "对象存储表")
+public class OssVO extends Oss {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 分类名
+	 */
+	private String categoryName;
+
+	/**
+	 * 是否启用
+	 */
+	private String statusName;
+
+}

+ 46 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/vo/SmsVO.java

@@ -0,0 +1,46 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.vo;
+
+import org.springblade.resource.entity.Sms;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 短信配置表视图实体类
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "SmsVO对象", description = "短信配置表")
+public class SmsVO extends Sms {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 分类名
+	 */
+	private String categoryName;
+
+	/**
+	 * 是否启用
+	 */
+	private String statusName;
+
+}

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/wrapper/OssWrapper.java

@@ -19,7 +19,7 @@ package org.springblade.resource.wrapper;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.resource.entity.Oss;
-import org.springblade.resource.entity.OssVO;
+import org.springblade.resource.vo.OssVO;
 import org.springblade.system.cache.DictCache;
 
 import java.util.Objects;

+ 49 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/wrapper/SmsWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.resource.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.resource.entity.Sms;
+import org.springblade.resource.vo.SmsVO;
+import org.springblade.system.cache.DictCache;
+
+import java.util.Objects;
+
+/**
+ * 短信配置表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2020-02-20
+ */
+public class SmsWrapper extends BaseEntityWrapper<Sms, SmsVO> {
+
+	public static SmsWrapper build() {
+		return new SmsWrapper();
+	}
+
+	@Override
+	public SmsVO entityVO(Sms sms) {
+		SmsVO smsVO = Objects.requireNonNull(BeanUtil.copy(sms, SmsVO.class));
+		String categoryName = DictCache.getValue("sms", sms.getCategory());
+		String statusName = DictCache.getValue("yes_no", sms.getStatus());
+		smsVO.setCategoryName(categoryName);
+		smsVO.setStatusName(statusName);
+		return smsVO;
+	}
+
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
doc/sql/mysql/bladex-saber-mysql.sql


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
doc/sql/mysql/bladex-sword-mysql.sql


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 275 - 200
doc/sql/oracle/bladex-saber-oracle.sql


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 228 - 116
doc/sql/oracle/bladex-sword-oracle.sql


+ 70 - 5
doc/sql/postgresql/bladex-saber-postgresql.sql

@@ -12,7 +12,7 @@
  Target Server Version : 110001
  File Encoding         : 65001
 
- Date: 02/01/2020 13:56:12
+ Date: 22/02/2020 00:47:58
 */
 
 
@@ -269,9 +269,14 @@ INSERT INTO "blade_dict" VALUES (1123598814738675241, 1123598814738675240, 'scop
 INSERT INTO "blade_dict" VALUES (1123598814738675242, 1123598814738675240, 'scope_category', '2', '接口权限', 2, NULL, 0, 0);
 INSERT INTO "blade_dict" VALUES (1123598814738676224, 0, 'oss', '-1', '对象存储类型', 6, NULL, 0, 0);
 INSERT INTO "blade_dict" VALUES (1123598814738676225, 1123598814738676224, 'oss', '1', 'minio', 1, NULL, 0, 0);
-INSERT INTO "blade_dict" VALUES (1123598814738676226, 1123598814738676224, 'oss', '2', 'qiniu', 2, NULL, 0, 0);
-INSERT INTO "blade_dict" VALUES (1123598814738676227, 1123598814738676224, 'oss', '3', 'ali', 3, NULL, 0, 0);
-INSERT INTO "blade_dict" VALUES (1123598814738676228, 1123598814738676224, 'oss', '4', 'tencent', 4, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677220, 0, 'sms', '-1', '短信服务类型', 11, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738676226, 1123598814738676224, 'oss', '2', '七牛云', 2, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677222, 1123598814738677220, 'sms', '2', '七牛云', 2, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677221, 1123598814738677220, 'sms', '1', '云片', 1, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738676227, 1123598814738676224, 'oss', '3', '阿里云', 3, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677223, 1123598814738677220, 'sms', '3', '阿里云', 3, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677224, 1123598814738677220, 'sms', '4', '腾讯云', 4, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738676228, 1123598814738676224, 'oss', '4', '腾讯云', 4, NULL, 0, 0);
 COMMIT;
 
 -- ----------------------------
@@ -613,7 +618,13 @@ INSERT INTO "blade_menu" VALUES (1164733379658963252, 1164733379658963251, 'dict
 INSERT INTO "blade_menu" VALUES (1164733379658963253, 1164733379658963251, 'dictbiz_edit', '修改', 'edit', '/system/dictbiz/edit', 'form', 2, 2, 2, 1, '', 0);
 INSERT INTO "blade_menu" VALUES (1164733379658963254, 1164733379658963251, 'dictbiz_delete', '删除', 'delete', '/api/blade-system/dict-biz/remove', 'delete', 3, 2, 3, 1, '', 0);
 INSERT INTO "blade_menu" VALUES (1164733379658963255, 1164733379658963251, 'dictbiz_view', '查看', 'view', '/system/dictbiz/view', 'file-text', 4, 2, 2, 1, '', 0);
-INSERT INTO "blade_menu" VALUES (1164733389658963251, 1123598815738675298, 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', 'iconfont iconicon_cspace', 2, 1, 0, 2, '', 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962251, 1123598815738675298, 'sms', '短信配置', 'menu', '/resource/sms', 'iconfont iconicon_message', 2, 1, 0, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962252, 1164733389658962251, 'sms_add', '新增', 'add', '/resource/sms/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962253, 1164733389658962251, 'sms_edit', '修改', 'edit', '/resource/sms/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962254, 1164733389658962251, 'sms_delete', '删除', 'delete', '/api/blade-resource/sms/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962255, 1164733389658962251, 'sms_view', '查看', 'view', '/resource/sms/view', 'file-text', 4, 2, 2, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962256, 1164733389658962251, 'sms_enable', '启用', 'enable', '/api/blade-resource/sms/enable', 'key', 5, 2, 2, 2, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658963251, 1123598815738675298, 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', 'iconfont iconicon_cspace', 3, 1, 0, 2, '', 0);
 COMMIT;
 
 -- ----------------------------
@@ -1076,6 +1087,12 @@ INSERT INTO "blade_role_menu" VALUES (1161272793873322993, 1164733379658963253,
 INSERT INTO "blade_role_menu" VALUES (1161272793873322994, 1164733379658963254, 1123598816738675201);
 INSERT INTO "blade_role_menu" VALUES (1161272793873322995, 1164733379658963255, 1123598816738675201);
 INSERT INTO "blade_role_menu" VALUES (1161272893873322991, 1164733389658963251, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222991, 1164733389658962251, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222992, 1164733389658962252, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222993, 1164733389658962253, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222994, 1164733389658962254, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222995, 1164733389658962255, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222996, 1164733389658962256, 1123598816738675201);
 COMMIT;
 
 -- ----------------------------
@@ -1175,6 +1192,49 @@ COMMENT ON COLUMN "blade_scope_data"."status" IS '状态';
 COMMENT ON COLUMN "blade_scope_data"."is_deleted" IS '是否已删除';
 COMMENT ON TABLE "blade_scope_data" IS '数据权限表';
 
+-- ----------------------------
+-- Table structure for blade_sms
+-- ----------------------------
+DROP TABLE IF EXISTS "blade_sms";
+CREATE TABLE "blade_sms" (
+  "id" int8 NOT NULL,
+  "tenant_id" varchar(12) COLLATE "pg_catalog"."default",
+  "category" int4,
+  "sms_code" varchar(12) COLLATE "pg_catalog"."default",
+  "template_id" varchar(64) COLLATE "pg_catalog"."default",
+  "access_key" varchar(255) COLLATE "pg_catalog"."default",
+  "secret_key" varchar(255) COLLATE "pg_catalog"."default",
+  "region_id" varchar(255) COLLATE "pg_catalog"."default",
+  "sign_name" varchar(64) COLLATE "pg_catalog"."default",
+  "remark" varchar(255) COLLATE "pg_catalog"."default",
+  "create_user" int8,
+  "create_dept" int8,
+  "create_time" timestamp(6),
+  "update_user" int8,
+  "update_time" timestamp(6),
+  "status" int4,
+  "is_deleted" int4
+)
+;
+COMMENT ON COLUMN "blade_sms"."id" IS '主键';
+COMMENT ON COLUMN "blade_sms"."tenant_id" IS '租户ID';
+COMMENT ON COLUMN "blade_sms"."category" IS '分类';
+COMMENT ON COLUMN "blade_sms"."sms_code" IS '资源编号';
+COMMENT ON COLUMN "blade_sms"."template_id" IS '模板ID';
+COMMENT ON COLUMN "blade_sms"."access_key" IS 'accessKey';
+COMMENT ON COLUMN "blade_sms"."secret_key" IS 'secretKey';
+COMMENT ON COLUMN "blade_sms"."region_id" IS 'regionId';
+COMMENT ON COLUMN "blade_sms"."sign_name" IS '短信签名';
+COMMENT ON COLUMN "blade_sms"."remark" IS '备注';
+COMMENT ON COLUMN "blade_sms"."create_user" IS '创建人';
+COMMENT ON COLUMN "blade_sms"."create_dept" IS '创建部门';
+COMMENT ON COLUMN "blade_sms"."create_time" IS '创建时间';
+COMMENT ON COLUMN "blade_sms"."update_user" IS '修改人';
+COMMENT ON COLUMN "blade_sms"."update_time" IS '修改时间';
+COMMENT ON COLUMN "blade_sms"."status" IS '状态';
+COMMENT ON COLUMN "blade_sms"."is_deleted" IS '是否已删除';
+COMMENT ON TABLE "blade_sms" IS '短信配置表';
+
 -- ----------------------------
 -- Table structure for blade_tenant
 -- ----------------------------
@@ -1454,6 +1514,11 @@ ALTER TABLE "blade_scope_api" ADD CONSTRAINT "blade_scope_api_pkey" PRIMARY KEY
 -- ----------------------------
 ALTER TABLE "blade_scope_data" ADD CONSTRAINT "blade_scope_data_pkey" PRIMARY KEY ("id");
 
+-- ----------------------------
+-- Primary Key structure for table blade_sms
+-- ----------------------------
+ALTER TABLE "blade_sms" ADD CONSTRAINT "blade_sms_pkey" PRIMARY KEY ("id");
+
 -- ----------------------------
 -- Primary Key structure for table blade_tenant
 -- ----------------------------

+ 87 - 22
doc/sql/postgresql/bladex-sword-postgresql.sql

@@ -12,7 +12,7 @@
  Target Server Version : 110001
  File Encoding         : 65001
 
- Date: 02/01/2020 13:56:57
+ Date: 22/02/2020 00:49:07
 */
 
 
@@ -269,9 +269,14 @@ INSERT INTO "blade_dict" VALUES (1123598814738675241, 1123598814738675240, 'scop
 INSERT INTO "blade_dict" VALUES (1123598814738675242, 1123598814738675240, 'scope_category', '2', '接口权限', 2, NULL, 0, 0);
 INSERT INTO "blade_dict" VALUES (1123598814738676224, 0, 'oss', '-1', '对象存储类型', 6, NULL, 0, 0);
 INSERT INTO "blade_dict" VALUES (1123598814738676225, 1123598814738676224, 'oss', '1', 'minio', 1, NULL, 0, 0);
-INSERT INTO "blade_dict" VALUES (1123598814738676226, 1123598814738676224, 'oss', '2', 'qiniu', 2, NULL, 0, 0);
-INSERT INTO "blade_dict" VALUES (1123598814738676227, 1123598814738676224, 'oss', '3', 'ali', 3, NULL, 0, 0);
-INSERT INTO "blade_dict" VALUES (1123598814738676228, 1123598814738676224, 'oss', '4', 'tencent', 4, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677220, 0, 'sms', '-1', '短信服务类型', 11, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738676226, 1123598814738676224, 'oss', '2', '七牛云', 2, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738676227, 1123598814738676224, 'oss', '3', '阿里云', 3, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677223, 1123598814738677220, 'sms', '3', '阿里云', 3, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677221, 1123598814738677220, 'sms', '1', '云片', 1, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677222, 1123598814738677220, 'sms', '2', '七牛云', 2, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738677224, 1123598814738677220, 'sms', '4', '腾讯云', 4, NULL, 0, 0);
+INSERT INTO "blade_dict" VALUES (1123598814738676228, 1123598814738676224, 'oss', '4', '腾讯云', 4, NULL, 0, 0);
 COMMIT;
 
 -- ----------------------------
@@ -611,7 +616,13 @@ INSERT INTO "blade_menu" VALUES (1164733379658963252, 1164733379658963251, 'dict
 INSERT INTO "blade_menu" VALUES (1164733379658963253, 1164733379658963251, 'dictbiz_edit', '修改', 'edit', '/system/dictbiz/edit', 'form', 2, 2, 2, 1, '', 0);
 INSERT INTO "blade_menu" VALUES (1164733379658963254, 1164733379658963251, 'dictbiz_delete', '删除', 'delete', '/api/blade-system/dict-biz/remove', 'delete', 3, 2, 3, 1, '', 0);
 INSERT INTO "blade_menu" VALUES (1164733379658963255, 1164733379658963251, 'dictbiz_view', '查看', 'view', '/system/dictbiz/view', 'file-text', 4, 2, 2, 1, '', 0);
-INSERT INTO "blade_menu" VALUES (1164733389658963251, 1123598815738675298, 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', '', 2, 1, 0, 2, '', 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962252, 1164733389658962251, 'sms_add', '新增', 'add', '/resource/sms/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962251, 1123598815738675298, 'sms', '短信配置', 'menu', '/resource/sms', '', 2, 1, 0, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962253, 1164733389658962251, 'sms_edit', '修改', 'edit', '/resource/sms/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962254, 1164733389658962251, 'sms_delete', '删除', 'delete', '/api/blade-resource/sms/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962255, 1164733389658962251, 'sms_view', '查看', 'view', '/resource/sms/view', 'file-text', 4, 2, 2, 1, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658962256, 1164733389658962251, 'sms_enable', '启用', 'enable', '/api/blade-resource/sms/enable', 'key', 5, 2, 2, 2, NULL, 0);
+INSERT INTO "blade_menu" VALUES (1164733389658963251, 1123598815738675298, 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', '', 3, 1, 0, 2, '', 0);
 COMMIT;
 
 -- ----------------------------
@@ -1074,6 +1085,12 @@ INSERT INTO "blade_role_menu" VALUES (1161272793873322993, 1164733379658963253,
 INSERT INTO "blade_role_menu" VALUES (1161272793873322994, 1164733379658963254, 1123598816738675201);
 INSERT INTO "blade_role_menu" VALUES (1161272793873322995, 1164733379658963255, 1123598816738675201);
 INSERT INTO "blade_role_menu" VALUES (1161272893873322991, 1164733389658963251, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222991, 1164733389658962251, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222992, 1164733389658962252, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222993, 1164733389658962253, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222994, 1164733389658962254, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222995, 1164733389658962255, 1123598816738675201);
+INSERT INTO "blade_role_menu" VALUES (1161272893873222996, 1164733389658962256, 1123598816738675201);
 COMMIT;
 
 -- ----------------------------
@@ -1173,28 +1190,71 @@ COMMENT ON COLUMN "blade_scope_data"."status" IS '状态';
 COMMENT ON COLUMN "blade_scope_data"."is_deleted" IS '是否已删除';
 COMMENT ON TABLE "blade_scope_data" IS '数据权限表';
 
+-- ----------------------------
+-- Table structure for blade_sms
+-- ----------------------------
+DROP TABLE IF EXISTS "blade_sms";
+CREATE TABLE "blade_sms" (
+  "id" int8 NOT NULL,
+  "tenant_id" varchar(12) COLLATE "pg_catalog"."default",
+  "category" int4,
+  "sms_code" varchar(12) COLLATE "pg_catalog"."default",
+  "template_id" varchar(64) COLLATE "pg_catalog"."default",
+  "access_key" varchar(255) COLLATE "pg_catalog"."default",
+  "secret_key" varchar(255) COLLATE "pg_catalog"."default",
+  "region_id" varchar(255) COLLATE "pg_catalog"."default",
+  "sign_name" varchar(64) COLLATE "pg_catalog"."default",
+  "remark" varchar(255) COLLATE "pg_catalog"."default",
+  "create_user" int8,
+  "create_dept" int8,
+  "create_time" timestamp(6),
+  "update_user" int8,
+  "update_time" timestamp(6),
+  "status" int4,
+  "is_deleted" int4
+)
+;
+COMMENT ON COLUMN "blade_sms"."id" IS '主键';
+COMMENT ON COLUMN "blade_sms"."tenant_id" IS '租户ID';
+COMMENT ON COLUMN "blade_sms"."category" IS '分类';
+COMMENT ON COLUMN "blade_sms"."sms_code" IS '资源编号';
+COMMENT ON COLUMN "blade_sms"."template_id" IS '模板ID';
+COMMENT ON COLUMN "blade_sms"."access_key" IS 'accessKey';
+COMMENT ON COLUMN "blade_sms"."secret_key" IS 'secretKey';
+COMMENT ON COLUMN "blade_sms"."region_id" IS 'regionId';
+COMMENT ON COLUMN "blade_sms"."sign_name" IS '短信签名';
+COMMENT ON COLUMN "blade_sms"."remark" IS '备注';
+COMMENT ON COLUMN "blade_sms"."create_user" IS '创建人';
+COMMENT ON COLUMN "blade_sms"."create_dept" IS '创建部门';
+COMMENT ON COLUMN "blade_sms"."create_time" IS '创建时间';
+COMMENT ON COLUMN "blade_sms"."update_user" IS '修改人';
+COMMENT ON COLUMN "blade_sms"."update_time" IS '修改时间';
+COMMENT ON COLUMN "blade_sms"."status" IS '状态';
+COMMENT ON COLUMN "blade_sms"."is_deleted" IS '是否已删除';
+COMMENT ON TABLE "blade_sms" IS '短信配置表';
+
 -- ----------------------------
 -- Table structure for blade_tenant
 -- ----------------------------
 DROP TABLE IF EXISTS "blade_tenant";
 CREATE TABLE "blade_tenant" (
-"id" int8 NOT NULL,
-"tenant_id" varchar(12) COLLATE "pg_catalog"."default",
-"tenant_name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
-"domain" varchar(255) COLLATE "pg_catalog"."default",
-"background_url" varchar(1000) COLLATE "pg_catalog"."default",
-"linkman" varchar(20) COLLATE "pg_catalog"."default",
-"contact_number" varchar(20) COLLATE "pg_catalog"."default",
-"address" varchar(255) COLLATE "pg_catalog"."default",
-"account_number" int2 DEFAULT '-1'::integer,
-"expire_time" timestamp(6),
-"create_user" int8,
-"create_dept" int8,
-"create_time" timestamp(6),
-"update_user" int8,
-"update_time" timestamp(6),
-"status" int4,
-"is_deleted" int4
+  "id" int8 NOT NULL,
+  "tenant_id" varchar(12) COLLATE "pg_catalog"."default",
+  "tenant_name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
+  "domain" varchar(255) COLLATE "pg_catalog"."default",
+  "background_url" varchar(1000) COLLATE "pg_catalog"."default",
+  "linkman" varchar(20) COLLATE "pg_catalog"."default",
+  "contact_number" varchar(20) COLLATE "pg_catalog"."default",
+  "address" varchar(255) COLLATE "pg_catalog"."default",
+  "account_number" int2 DEFAULT '-1'::integer,
+  "expire_time" timestamp(6),
+  "create_user" int8,
+  "create_dept" int8,
+  "create_time" timestamp(6),
+  "update_user" int8,
+  "update_time" timestamp(6),
+  "status" int4,
+  "is_deleted" int4
 )
 ;
 COMMENT ON COLUMN "blade_tenant"."id" IS '主键';
@@ -1452,6 +1512,11 @@ ALTER TABLE "blade_scope_api" ADD CONSTRAINT "blade_scope_api_pkey" PRIMARY KEY
 -- ----------------------------
 ALTER TABLE "blade_scope_data" ADD CONSTRAINT "blade_scope_data_pkey" PRIMARY KEY ("id");
 
+-- ----------------------------
+-- Primary Key structure for table blade_sms
+-- ----------------------------
+ALTER TABLE "blade_sms" ADD CONSTRAINT "blade_sms_pkey" PRIMARY KEY ("id");
+
 -- ----------------------------
 -- Primary Key structure for table blade_tenant
 -- ----------------------------

+ 72 - 1
doc/sql/update/mysql-update-2.3.1~2.4.0.sql

@@ -1,5 +1,76 @@
 -- ----------------------------
 -- 增加资源编号字段
 -- ----------------------------
-ALTER TABLE `bladex`.`blade_oss`
+ALTER TABLE `blade_oss`
     ADD COLUMN `oss_code` varchar(32) NULL COMMENT '资源编号' AFTER `category`;
+
+-- ----------------------------
+-- 增加短信配置表
+-- ----------------------------
+CREATE TABLE `blade_sms`  (
+  `id` bigint(64) NOT NULL COMMENT '主键',
+  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
+  `category` int(2) NULL DEFAULT NULL COMMENT '分类',
+  `sms_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源编号',
+  `template_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模板ID',
+  `access_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'accessKey',
+  `secret_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'secretKey',
+  `region_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'regionId',
+  `sign_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '短信签名',
+  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  `create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人',
+  `create_dept` bigint(64) NULL DEFAULT NULL COMMENT '创建部门',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人',
+  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+  `status` int(2) NULL DEFAULT NULL COMMENT '状态',
+  `is_deleted` int(2) NULL DEFAULT 0 COMMENT '是否已删除',
+ PRIMARY KEY (`id`)
+) COMMENT = '短信配置表';
+
+
+-- ----------------------------
+-- 增加短信配置菜单数据
+-- ----------------------------
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1164733389658962251', '1123598815738675298', 'sms', '短信配置', 'menu', '/resource/sms', 'iconfont iconicon_message', 2, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1164733389658962252', '1164733389658962251', 'sms_add', '新增', 'add', '/resource/sms/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1164733389658962253', '1164733389658962251', 'sms_edit', '修改', 'edit', '/resource/sms/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1164733389658962254', '1164733389658962251', 'sms_delete', '删除', 'delete', '/api/blade-resource/sms/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1164733389658962255', '1164733389658962251', 'sms_view', '查看', 'view', '/resource/sms/view', 'file-text', 4, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1164733389658962256', '1164733389658962251', 'sms_enable', '启用', 'enable', '/api/blade-resource/sms/enable', 'key', 5, 2, 2, 2, NULL, 0);
+
+-- ----------------------------
+-- 增加短信配置菜单权限数据
+-- ----------------------------
+INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
+VALUES ('1161272893873222991', '1164733389658962251', '1123598816738675201');
+INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
+VALUES ('1161272893873222992', '1164733389658962252', '1123598816738675201');
+INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
+VALUES ('1161272893873222993', '1164733389658962253', '1123598816738675201');
+INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
+VALUES ('1161272893873222994', '1164733389658962254', '1123598816738675201');
+INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
+VALUES ('1161272893873222995', '1164733389658962255', '1123598816738675201');
+INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
+VALUES ('1161272893873222996', '1164733389658962256', '1123598816738675201');
+
+-- ----------------------------
+-- 增加短信配置字典数据
+-- ----------------------------
+INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`)
+VALUES (1123598814738677220, 0, 'sms', '-1', '短信服务类型', 11, NULL, 0, 0);
+INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`)
+VALUES (1123598814738677221, 1123598814738677220, 'sms', '1', 'yunpian', 1, NULL, 0, 0);
+INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`)
+VALUES (1123598814738677222, 1123598814738677220, 'sms', '2', 'qiniu', 2, NULL, 0, 0);
+INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`)
+VALUES (1123598814738677223, 1123598814738677220, 'sms', '3', 'ali', 3, NULL, 0, 0);
+INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`)
+VALUES (1123598814738677224, 1123598814738677220, 'sms', '4', 'tencent', 4, NULL, 0, 0);

+ 89 - 0
doc/sql/update/oracle-update-2.3.1~2.4.0.sql

@@ -5,3 +5,92 @@ ALTER TABLE "BLADEX"."BLADE_OSS"
     ADD ("OSS_CODE" VARCHAR2(32) );
 
 COMMENT ON COLUMN "BLADEX"."BLADE_OSS"."OSS_CODE" IS '资源编号'
+
+-- ----------------------------
+-- 增加短信配置表
+-- ----------------------------
+CREATE TABLE "BLADEX"."BLADE_SMS" (
+"ID" NUMBER(20) NOT NULL ,
+"TENANT_ID" NVARCHAR2(12) ,
+"CATEGORY" NUMBER(11) ,
+"SMS_CODE" VARCHAR2(12) ,
+"TEMPLATE_ID" VARCHAR2(64) ,
+"ACCESS_KEY" NVARCHAR2(255) ,
+"SECRET_KEY" NVARCHAR2(255) ,
+"REGION_ID" NVARCHAR2(255) ,
+"SIGN_NAME" VARCHAR2(64) ,
+"REMARK" NVARCHAR2(255) ,
+"CREATE_USER" NUMBER(20) ,
+"CREATE_DEPT" NUMBER(20) ,
+"CREATE_TIME" DATE ,
+"UPDATE_USER" NUMBER(20) ,
+"UPDATE_TIME" DATE ,
+"STATUS" NUMBER(11) ,
+"IS_DELETED" NUMBER(11) ,
+PRIMARY KEY ("ID")
+)
+;
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."ID" IS '主键';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."TENANT_ID" IS '租户ID';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CATEGORY" IS '分类';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."SMS_CODE" IS '资源编号';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."TEMPLATE_ID" IS '模板ID';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."ACCESS_KEY" IS 'accessKey';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."SECRET_KEY" IS 'secretKey';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."REGION_ID" IS 'regionId';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."SIGN_NAME" IS '短信签名';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."REMARK" IS '备注';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CREATE_USER" IS '创建人';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CREATE_DEPT" IS '创建部门';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CREATE_TIME" IS '创建时间';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."UPDATE_USER" IS '修改人';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."UPDATE_TIME" IS '修改时间';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."STATUS" IS '状态';
+COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."IS_DELETED" IS '是否已删除';
+COMMENT ON TABLE "BLADEX"."BLADE_SMS" IS '短信配置表';
+
+-- ----------------------------
+-- 增加短信配置菜单数据
+-- ----------------------------
+INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
+VALUES ('1164733389658962251', '1123598815738675298', 'sms', '短信配置', 'menu', '/resource/sms', 'iconfont iconicon_message', 2, 1, 0, 1, NULL, 0);
+INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
+VALUES ('1164733389658962252', '1164733389658962251', 'sms_add', '新增', 'add', '/resource/sms/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
+VALUES ('1164733389658962253', '1164733389658962251', 'sms_edit', '修改', 'edit', '/resource/sms/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
+VALUES ('1164733389658962254', '1164733389658962251', 'sms_delete', '删除', 'delete', '/api/blade-resource/sms/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
+VALUES ('1164733389658962255', '1164733389658962251', 'sms_view', '查看', 'view', '/resource/sms/view', 'file-text', 4, 2, 2, 1, NULL, 0);
+INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
+VALUES ('1164733389658962256', '1164733389658962251', 'sms_enable', '启用', 'enable', '/api/blade-resource/sms/enable', 'key', 5, 2, 2, 2, NULL, 0);
+
+-- ----------------------------
+-- 增加短信配置菜单权限数据
+-- ----------------------------
+INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
+VALUES ('1161272893873222991', '1164733389658962251', '1123598816738675201');
+INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
+VALUES ('1161272893873222992', '1164733389658962252', '1123598816738675201');
+INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
+VALUES ('1161272893873222993', '1164733389658962253', '1123598816738675201');
+INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
+VALUES ('1161272893873222994', '1164733389658962254', '1123598816738675201');
+INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
+VALUES ('1161272893873222995', '1164733389658962255', '1123598816738675201');
+INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
+VALUES ('1161272893873222996', '1164733389658962256', '1123598816738675201');
+
+-- ----------------------------
+-- 增加短信配置字典数据
+-- ----------------------------
+INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
+VALUES (1123598814738677220, 0, 'sms', '-1', '短信服务类型', 11, NULL, 0, 0);
+INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
+VALUES (1123598814738677221, 1123598814738677220, 'sms', '1', 'yunpian', 1, NULL, 0, 0);
+INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
+VALUES (1123598814738677222, 1123598814738677220, 'sms', '2', 'qiniu', 2, NULL, 0, 0);
+INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
+VALUES (1123598814738677223, 1123598814738677220, 'sms', '3', 'ali', 3, NULL, 0, 0);
+INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
+VALUES (1123598814738677224, 1123598814738677220, 'sms', '4', 'tencent', 4, NULL, 0, 0);

+ 90 - 0
doc/sql/update/postgresql-update-2.3.1~2.4.0.sql

@@ -5,3 +5,93 @@ ALTER TABLE "public"."blade_oss"
     ADD COLUMN "oss_code" varchar(32);
 
 COMMENT ON COLUMN "public"."blade_oss"."oss_code" IS '资源编号';
+
+-- ----------------------------
+-- 增加短信配置表
+-- ----------------------------
+CREATE TABLE "public"."blade_sms" (
+"id" int8 NOT NULL,
+"tenant_id" varchar(12) COLLATE "pg_catalog"."default",
+"category" int4,
+"sms_code" varchar(12),
+"template_id" varchar(64),
+"access_key" varchar(255) COLLATE "pg_catalog"."default",
+"secret_key" varchar(255) COLLATE "pg_catalog"."default",
+"region_id" varchar(255),
+"sign_name" varchar(64),
+"remark" varchar(255) COLLATE "pg_catalog"."default",
+"create_user" int8,
+"create_dept" int8,
+"create_time" timestamp(6),
+"update_user" int8,
+"update_time" timestamp(6),
+"status" int4,
+"is_deleted" int4,
+PRIMARY KEY ("id")
+)
+;
+
+COMMENT ON COLUMN "public"."blade_sms"."id" IS '主键';
+COMMENT ON COLUMN "public"."blade_sms"."tenant_id" IS '租户ID';
+COMMENT ON COLUMN "public"."blade_sms"."category" IS '分类';
+COMMENT ON COLUMN "public"."blade_sms"."sms_code" IS '资源编号';
+COMMENT ON COLUMN "public"."blade_sms"."template_id" IS '模板ID';
+COMMENT ON COLUMN "public"."blade_sms"."access_key" IS 'accessKey';
+COMMENT ON COLUMN "public"."blade_sms"."secret_key" IS 'secretKey';
+COMMENT ON COLUMN "public"."blade_sms"."region_id" IS 'regionId';
+COMMENT ON COLUMN "public"."blade_sms"."sign_name" IS '短信签名';
+COMMENT ON COLUMN "public"."blade_sms"."remark" IS '备注';
+COMMENT ON COLUMN "public"."blade_sms"."create_user" IS '创建人';
+COMMENT ON COLUMN "public"."blade_sms"."create_dept" IS '创建部门';
+COMMENT ON COLUMN "public"."blade_sms"."create_time" IS '创建时间';
+COMMENT ON COLUMN "public"."blade_sms"."update_user" IS '修改人';
+COMMENT ON COLUMN "public"."blade_sms"."update_time" IS '修改时间';
+COMMENT ON COLUMN "public"."blade_sms"."status" IS '状态';
+COMMENT ON COLUMN "public"."blade_sms"."is_deleted" IS '是否已删除';
+COMMENT ON TABLE "public"."blade_sms" IS '短信配置表';
+
+-- ----------------------------
+-- 增加短信配置菜单数据
+-- ----------------------------
+INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted")
+VALUES ('1164733389658962251', '1123598815738675298', 'sms', '短信配置', 'menu', '/resource/sms', 'iconfont iconicon_message', 2, 1, 0, 1, NULL, 0);
+INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted")
+VALUES ('1164733389658962252', '1164733389658962251', 'sms_add', '新增', 'add', '/resource/sms/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted")
+VALUES ('1164733389658962253', '1164733389658962251', 'sms_edit', '修改', 'edit', '/resource/sms/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted")
+VALUES ('1164733389658962254', '1164733389658962251', 'sms_delete', '删除', 'delete', '/api/blade-resource/sms/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted")
+VALUES ('1164733389658962255', '1164733389658962251', 'sms_view', '查看', 'view', '/resource/sms/view', 'file-text', 4, 2, 2, 1, NULL, 0);
+INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted")
+VALUES ('1164733389658962256', '1164733389658962251', 'sms_enable', '启用', 'enable', '/api/blade-resource/sms/enable', 'key', 5, 2, 2, 2, NULL, 0);
+
+-- ----------------------------
+-- 增加短信配置菜单权限数据
+-- ----------------------------
+INSERT INTO "blade_role_menu"("id","menu_id","role_id")
+VALUES (1161272893873222991, 1164733389658962251, 1123598816738675201);
+INSERT INTO "blade_role_menu"("id","menu_id","role_id")
+VALUES (1161272893873222992, 1164733389658962252, 1123598816738675201);
+INSERT INTO "blade_role_menu"("id","menu_id","role_id")
+VALUES (1161272893873222993, 1164733389658962253, 1123598816738675201);
+INSERT INTO "blade_role_menu"("id","menu_id","role_id")
+VALUES (1161272893873222994, 1164733389658962254, 1123598816738675201);
+INSERT INTO "blade_role_menu"("id","menu_id","role_id")
+VALUES (1161272893873222995, 1164733389658962255, 1123598816738675201);
+INSERT INTO "blade_role_menu"("id","menu_id","role_id")
+VALUES (1161272893873222996, 1164733389658962256, 1123598816738675201);
+
+-- ----------------------------
+-- 增加短信配置字典数据
+-- ----------------------------
+INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_sealed", "is_deleted")
+VALUES (1123598814738677220, 0, 'sms', '-1', '短信服务类型', 11, NULL, 0, 0);
+INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_sealed", "is_deleted")
+VALUES (1123598814738677221, 1123598814738677220, 'sms', '1', 'yunpian', 1, NULL, 0, 0);
+INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_sealed", "is_deleted")
+VALUES (1123598814738677222, 1123598814738677220, 'sms', '2', 'qiniu', 2, NULL, 0, 0);
+INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_sealed", "is_deleted")
+VALUES (1123598814738677223, 1123598814738677220, 'sms', '3', 'ali', 3, NULL, 0, 0);
+INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_sealed", "is_deleted")
+VALUES (1123598814738677224, 1123598814738677220, 'sms', '4', 'tencent', 4, NULL, 0, 0);

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.