mirror of https://github.com/ZhongFuCheng3y/austin
parent
c217a85295
commit
ec2950b0b3
@ -0,0 +1,41 @@
|
|||||||
|
package com.java3y.austin.support.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.setting.dialect.Props;
|
||||||
|
import com.ctrip.framework.apollo.Config;
|
||||||
|
import com.java3y.austin.support.service.ConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 3y
|
||||||
|
* 读取配置实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ConfigServiceImpl implements ConfigService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本地配置
|
||||||
|
*/
|
||||||
|
private static final String PROPERTIES_PATH = "local.properties";
|
||||||
|
private Props props = new Props(PROPERTIES_PATH);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* apollo配置
|
||||||
|
*/
|
||||||
|
@Value("${apollo.bootstrap.enabled}")
|
||||||
|
private Boolean enableApollo;
|
||||||
|
@Value("${apollo.bootstrap.namespaces}")
|
||||||
|
private String namespaces;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getProperty(String key, String defaultValue) {
|
||||||
|
if (enableApollo) {
|
||||||
|
Config config = com.ctrip.framework.apollo.ConfigService.getConfig(namespaces.split(StrUtil.COMMA)[0]);
|
||||||
|
return config.getProperty(key, defaultValue);
|
||||||
|
} else {
|
||||||
|
return props.getProperty(key, defaultValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
discard = []
|
discardMsgIds = []
|
||||||
deduplication = {"deduplication_10":{"num":1,"time":300},"deduplication_20":{"num":5}}
|
deduplicationRule = {"deduplication_10":{"num":1,"time":300},"deduplication_20":{"num":5}}
|
||||||
emailAccount =[{"email_10":{"host":"smtp.qq.com","port":465,"user":"23423432@qq.com","pass":"23423432","from":"234234234@qq.com"}}]
|
emailAccount =[{"email_10":{"host":"smtp.qq.com","port":465,"user":"23423423@qq.com","pass":"23423432432423423","from":"234@qq.com","starttlsEnable":true,"auth":true,"sslEnable":true}},{"email_20":{"host":"smtp.163.com","port":465,"user":"22222@163.com","pass":"23432423","from":"234324324234@163.com","starttlsEnable":false,"auth":true,"sslEnable":true}}]
|
||||||
smsAccount = [{"sms_10":{"url":"sms.tencentcloudapi.com","region":"ap-guangzhou","secretId":"234234","secretKey":"234324324","smsSdkAppId":"2343242","templateId":"234234","signName":"Java3y公众号","supplierId":10,"supplierName":"腾讯云"}},{"sms_20":{"url":"https://sms.yunpian.com/v2/sms/tpl_batch_send.json","apikey":"23423432","tpl_id":"23423432","supplierId":20,"supplierName":"云片"}}]
|
smsAccount = [{"sms_10":{"url":"sms.tencentcloudapi.com","region":"ap-guangzhou","secretId":"234234","secretKey":"234324324","smsSdkAppId":"2343242","templateId":"234234","signName":"Java3y公众号","supplierId":10,"supplierName":"腾讯云"}},{"sms_20":{"url":"https://sms.yunpian.com/v2/sms/tpl_batch_send.json","apikey":"23423432","tpl_id":"23423432","supplierId":20,"supplierName":"云片"}}]
|
||||||
enterpriseWechatAccount = [{"enterprise_wechat_10":{"corpId":"23423423","corpSecret":"-234324234","agentId":1000002,"token":"234234","aesKey":"23423423"}}]
|
enterpriseWechatAccount = [{"enterprise_wechat_10":{"corpId":"23423423","corpSecret":"-234324234","agentId":1000002,"token":"234234","aesKey":"23423423"}}]
|
||||||
dingDingRobotAccount = [{"ding_ding_robot_10":{"secret":"234324324324","webhook":"https://oapi.dingtalk.com/robot/send?access_token=8d03b68d081f732343243242343247328b0c3003d164715d2c6c6e56"}}]
|
dingDingRobotAccount = [{"ding_ding_robot_10":{"secret":"234324324324","webhook":"https://oapi.dingtalk.com/robot/send?access_token=8d03b68d081f732343243242343247328b0c3003d164715d2c6c6e56"}}]
|
||||||
dingDingWorkNoticeAccount =[{"ding_ding_work_notice_10":{"appKey":"23423423","appSecret":"tQpvmkR863dYcuKDVfM23432432432423Nlx_fYLLLlpPJWHvWKbTu","agentId":"1523423423242"}}]
|
dingDingWorkNoticeAccount =[{"ding_ding_work_notice_10":{"appKey":"23423423","appSecret":"tQpvmkR863dYcuKDVfM23432432432423Nlx_fYLLLlpPJWHvWKbTu","agentId":"1523423423242"}}]
|
||||||
flowControl = {"flow_control_40":1}
|
flowControlRule = {"flow_control_40":1}
|
||||||
geTuiAccount = [{"ge_tui_account_10":{"appId":"23423423","appKey":"234234234","masterSecret":"2342342342342"}}]
|
geTuiAccount = [{"ge_tui_account_10":{"appId":"23423423","appKey":"234234234","masterSecret":"2342342342342"}}]
|
||||||
msg_type_sms_config = [{"message_type_10":[{"weights":99,"scriptName":"TencentSmsScript"},{"weights":1,"scriptName":"YunPianSmsScript"}]},{"message_type_20":[{"weights":20,"scriptName":"YunPianSmsScript"}]},{"message_type_30":[{"weights":20,"scriptName":"TencentSmsScript"}]},{"message_type_40":[{"weights":20,"scriptName":"TencentSmsScript"}]}]
|
msgTypeSmsConfig = [{"message_type_10":[{"weights":99,"scriptName":"TencentSmsScript"},{"weights":1,"scriptName":"YunPianSmsScript"}]},{"message_type_20":[{"weights":20,"scriptName":"YunPianSmsScript"}]},{"message_type_30":[{"weights":20,"scriptName":"TencentSmsScript"}]},{"message_type_40":[{"weights":20,"scriptName":"TencentSmsScript"}]}]
|
Loading…
Reference in new issue