🚀 v1.0.0

This commit is contained in:
冷冷 2018-05-22 21:22:29 +08:00
parent bfafec7559
commit 7bca8041ab
6 changed files with 16 additions and 13 deletions

View File

@ -29,6 +29,11 @@ public class MobileCodeReceiveListener {
log.info("消息中心接收到短信发送请求-> 手机号:{} -> 验证码: {} ", mobileMsgTemplate.getMobile(), mobileMsgTemplate.getContext());
String channel = mobileMsgTemplate.getChannel();
SmsMessageHandler messageHandler = messageHandlerMap.get(channel);
if (messageHandler == null) {
log.error("没有找到指定的路由通道,不进行发送处理完毕!");
return;
}
messageHandler.execute(mobileMsgTemplate);
long useTime = System.currentTimeMillis() - startTime;
log.info("调用 {} 短信网关处理完毕,耗时 {}毫秒", channel, useTime);

View File

@ -28,8 +28,13 @@ public class MobileServiceChangeReceiveListener {
public void receive(MobileMsgTemplate mobileMsgTemplate) {
long startTime = System.currentTimeMillis();
log.info("消息中心接收到短信发送请求-> 手机号:{} -> 信息体:{} ", mobileMsgTemplate.getMobile(), mobileMsgTemplate.getContext());
String type = mobileMsgTemplate.getType();
SmsMessageHandler messageHandler = messageHandlerMap.get(type);
String channel = mobileMsgTemplate.getChannel();
SmsMessageHandler messageHandler = messageHandlerMap.get(channel);
if (messageHandler == null) {
log.error("没有找到指定的路由通道,不进行发送处理完毕!");
return;
}
messageHandler.execute(mobileMsgTemplate);
long useTime = System.currentTimeMillis() - startTime;
log.info("调用 {} 短信网关处理完毕,耗时 {}毫秒", mobileMsgTemplate.getType(), useTime);

View File

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
public class DemoController {
@GetMapping("/user")
@GetMapping("/")
public Authentication user(Authentication authentication) {
return authentication;
}

View File

@ -29,14 +29,6 @@ spring:
name: pig-sso-client-demo
profiles:
active: dev
redis:
remote: true #是否是cachecloud 获取
host: 106.14.69.75
port: 6381
password:
logging:
config: classpath:logback.xml
---
spring:
profiles: dev

View File

@ -191,7 +191,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
new MobileMsgTemplate(
mobile,
contextJson.toJSONString(),
EnumSmsChannel.ALIYUN.getName(),
CommonConstant.ALIYUN_SMS,
EnumSmsChannelTemplate.LOGIN_NAME_LOGIN.getSignName(),
EnumSmsChannelTemplate.LOGIN_NAME_LOGIN.getTemplate()
));

View File

@ -1,6 +1,7 @@
package com.github.pig.monitor.filter;
import com.alibaba.fastjson.JSONObject;
import com.github.pig.common.constant.CommonConstant;
import com.github.pig.common.constant.MqQueueConstant;
import com.github.pig.common.constant.enums.EnumSmsChannel;
import com.github.pig.common.constant.enums.EnumSmsChannelTemplate;
@ -77,7 +78,7 @@ public class StatusChangeNotifier extends AbstractStatusChangeNotifier {
new MobileMsgTemplate(
CollUtil.join(monitorMobilePropertiesConfig.getMobile().getMobiles(), ","),
contextJson.toJSONString(),
EnumSmsChannel.ALIYUN.getName(),
CommonConstant.ALIYUN_SMS,
EnumSmsChannelTemplate.SERVICE_STATUS_CHANGE.getSignName(),
EnumSmsChannelTemplate.SERVICE_STATUS_CHANGE.getTemplate()
));