Commit b0e21fca authored by qinxunjia's avatar qinxunjia

短信配置

parent 166af8e9
......@@ -6,7 +6,7 @@
<groupId>org.example</groupId>
<artifactId>sms-plugin</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<name>插件服务</name>
<description>DM hub集成插件服务</description>
......
package com.bgy.sms.channel.dmHub.config;
import com.bgy.sms.channel.bgy.config.BgySMSConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -21,6 +20,8 @@ public class DmHubConfig {
public static boolean surlConfig;
public static String surlAddValue;
@Value("${system.config.dmHub.applicationId}")
public void setApplicationId(String applicationId) {
DmHubConfig.applicationId = applicationId;
......@@ -55,10 +56,16 @@ public class DmHubConfig {
public void setShortUrl(String shortUrl) {
DmHubConfig.shortUrl = shortUrl;
}
@Value("${system.config.dmHub.surlConfig}")
public void setSurlConfig(Boolean surlConfig) {
DmHubConfig.surlConfig = surlConfig;
}
@Value("${system.config.dmHub.surlAddValue}")
public void setSurlAddValue(String surlAddValue) {
DmHubConfig.surlAddValue = surlAddValue;
}
}
......@@ -576,7 +576,7 @@ public class MessageServiceImpl implements MessageService {
if ("surl".equals(key)) {
if (DmHubConfig.surlConfig) {
info = "https://" + info;
info = DmHubConfig.surlAddValue + info;
}
}
paramsMap.put(keyBuffer.toString(), String.valueOf(info));
......
......@@ -52,7 +52,8 @@ system:
appId: 1smsdemo
appSecret: ac031765c3a8c9acc4747808e4fe5918
shortUrl: urlshort-xsma-sit.bgy.com.cn
surlConfig: false
surlConfig: true
surlAddValue: https://
logging:
level: debug
......
......@@ -50,6 +50,7 @@ system:
appSecret: ${smsSecret}
shortUrl: ${shortUrl}
surlConfig: ${surlConfig}
surlAddValue: ${surlAddValue}
logging:
level: ${logLevel}
......
......@@ -49,6 +49,7 @@ system:
appSecret: ac031765c3a8c9acc4747808e4fe5918
shortUrl: urlshort-xsma-sit.bgy.com.cn
surlConfig: true
surlAddValue: https://
logging:
level: debug
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment