publish 1.0.17
This commit is contained in:
20
pom.xml
20
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>springboot-parent</name>
|
||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||
@@ -57,55 +57,55 @@
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-database</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-login</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-message</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-ademo</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-database</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-login</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-message</artifactId>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.tiesheng.message.config.aliyun;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.extra.validation.ValidationUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@@ -139,7 +142,15 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
|
||||
@Override
|
||||
public MessageReqResp send(String user, JSONObject body) {
|
||||
return sendSms(user, body.getStr("template_code"), body);
|
||||
boolean mobile = Validator.isMobile(user);
|
||||
if (!mobile) {
|
||||
return null;
|
||||
}
|
||||
String templateCode = body.getStr("template_code");
|
||||
if (StrUtil.isEmpty(templateCode)) {
|
||||
return null;
|
||||
}
|
||||
return sendSms(user, templateCode, body);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-util</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.16</version>
|
||||
<version>1.0.17</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-web</artifactId>
|
||||
|
||||
@@ -28,10 +28,38 @@ public class CoreMessageService {
|
||||
CoreLogMessageMapper coreLogMessageMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param reqResp
|
||||
*/
|
||||
private void insertMessageLog(MessageReqResp reqResp) {
|
||||
if (reqResp == null) {
|
||||
return;
|
||||
}
|
||||
coreLogMessageMapper.insert(BeanUtil.copyProperties(reqResp, CoreLogMessage.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送所有消息
|
||||
*
|
||||
* @param userIds
|
||||
* @param body
|
||||
*/
|
||||
public void all(List<String> userIds, JSONObject body) {
|
||||
messageSenderList.stream().filter(TieshengMessageSender::support)
|
||||
.forEach(sender -> {
|
||||
for (String user : userIds) {
|
||||
insertMessageLog(sender.send(user, body));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param title
|
||||
* @param channels
|
||||
* @param body
|
||||
* @param channels 消息通道,如果为all时,表示发送全部通道
|
||||
*/
|
||||
@@ -41,12 +69,8 @@ public class CoreMessageService {
|
||||
}
|
||||
|
||||
messageSenderList.stream().filter(TieshengMessageSender::support)
|
||||
.forEach(sender -> {
|
||||
channels.stream().filter(it -> Objects.equals(it.getChannel(), sender.getChannel())).forEach(it -> {
|
||||
MessageReqResp reqResp = sender.send(it.getUser(), body);
|
||||
coreLogMessageMapper.insert(BeanUtil.copyProperties(reqResp, CoreLogMessage.class));
|
||||
});
|
||||
});
|
||||
.forEach(sender -> channels.stream().filter(it -> Objects.equals(it.getChannel(), sender.getChannel()))
|
||||
.forEach(it -> insertMessageLog(sender.send(it.getUser(), body))));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +78,6 @@ public class CoreMessageService {
|
||||
* 发送消息
|
||||
*
|
||||
* @param userChannel
|
||||
* @param title
|
||||
* @param body
|
||||
*/
|
||||
public MessageReqResp send(UserChannel userChannel, JSONObject body) {
|
||||
@@ -67,7 +90,7 @@ public class CoreMessageService {
|
||||
sender -> Objects.equals(sender.getChannel(), userChannel.getChannel()) && sender.support());
|
||||
if (messageSender != null) {
|
||||
MessageReqResp reqResp = messageSender.send(userChannel.getUser(), body);
|
||||
coreLogMessageMapper.insert(BeanUtil.copyProperties(reqResp, CoreLogMessage.class));
|
||||
insertMessageLog(reqResp);
|
||||
return reqResp;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user