Commit b0e21fca authored by qinxunjia's avatar qinxunjia

短信配置

parent 166af8e9
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<groupId>org.example</groupId> <groupId>org.example</groupId>
<artifactId>sms-plugin</artifactId> <artifactId>sms-plugin</artifactId>
<version>1.0.3</version> <version>1.0.4</version>
<name>插件服务</name> <name>插件服务</name>
<description>DM hub集成插件服务</description> <description>DM hub集成插件服务</description>
......
package com.bgy.sms.channel.dmHub.config; 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.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -21,6 +20,8 @@ public class DmHubConfig { ...@@ -21,6 +20,8 @@ public class DmHubConfig {
public static boolean surlConfig; public static boolean surlConfig;
public static String surlAddValue;
@Value("${system.config.dmHub.applicationId}") @Value("${system.config.dmHub.applicationId}")
public void setApplicationId(String applicationId) { public void setApplicationId(String applicationId) {
DmHubConfig.applicationId = applicationId; DmHubConfig.applicationId = applicationId;
...@@ -55,10 +56,16 @@ public class DmHubConfig { ...@@ -55,10 +56,16 @@ public class DmHubConfig {
public void setShortUrl(String shortUrl) { public void setShortUrl(String shortUrl) {
DmHubConfig.shortUrl = shortUrl; DmHubConfig.shortUrl = shortUrl;
} }
@Value("${system.config.dmHub.surlConfig}") @Value("${system.config.dmHub.surlConfig}")
public void setSurlConfig(Boolean surlConfig) { public void setSurlConfig(Boolean surlConfig) {
DmHubConfig.surlConfig = 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 { ...@@ -576,7 +576,7 @@ public class MessageServiceImpl implements MessageService {
if ("surl".equals(key)) { if ("surl".equals(key)) {
if (DmHubConfig.surlConfig) { if (DmHubConfig.surlConfig) {
info = "https://" + info; info = DmHubConfig.surlAddValue + info;
} }
} }
paramsMap.put(keyBuffer.toString(), String.valueOf(info)); paramsMap.put(keyBuffer.toString(), String.valueOf(info));
......
...@@ -52,7 +52,8 @@ system: ...@@ -52,7 +52,8 @@ system:
appId: 1smsdemo appId: 1smsdemo
appSecret: ac031765c3a8c9acc4747808e4fe5918 appSecret: ac031765c3a8c9acc4747808e4fe5918
shortUrl: urlshort-xsma-sit.bgy.com.cn shortUrl: urlshort-xsma-sit.bgy.com.cn
surlConfig: false surlConfig: true
surlAddValue: https://
logging: logging:
level: debug level: debug
......
...@@ -50,6 +50,7 @@ system: ...@@ -50,6 +50,7 @@ system:
appSecret: ${smsSecret} appSecret: ${smsSecret}
shortUrl: ${shortUrl} shortUrl: ${shortUrl}
surlConfig: ${surlConfig} surlConfig: ${surlConfig}
surlAddValue: ${surlAddValue}
logging: logging:
level: ${logLevel} level: ${logLevel}
......
...@@ -49,6 +49,7 @@ system: ...@@ -49,6 +49,7 @@ system:
appSecret: ac031765c3a8c9acc4747808e4fe5918 appSecret: ac031765c3a8c9acc4747808e4fe5918
shortUrl: urlshort-xsma-sit.bgy.com.cn shortUrl: urlshort-xsma-sit.bgy.com.cn
surlConfig: true surlConfig: true
surlAddValue: https://
logging: logging:
level: debug 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