1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

refactor sms log

This commit is contained in:
fangjian0423 2019-03-04 15:38:01 +08:00
parent 14d505b53d
commit 5e9cfaba0e
4 changed files with 23 additions and 10 deletions

View File

@ -61,6 +61,13 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

View File

@ -17,15 +17,20 @@ package org.springframework.cloud.alicloud.sms;
import java.text.ParseException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.alicloud.context.AliCloudProperties;
import org.springframework.cloud.alicloud.context.sms.SmsProperties;
import org.springframework.cloud.alicloud.sms.base.DefaultAlicomMessagePuller;
import org.springframework.cloud.alicloud.sms.endpoint.EndpointManager;
import org.springframework.cloud.alicloud.sms.endpoint.ReceiveMessageEntity;
import com.aliyuncs.dysmsapi.model.v20170525.*;
import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsResponse;
import com.aliyuncs.dysmsapi.model.v20170525.SendBatchSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendBatchSmsResponse;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
@ -34,7 +39,7 @@ import com.aliyuncs.exceptions.ServerException;
*/
public final class SmsServiceImpl extends AbstractSmsService {
private static final Log log = LogFactory.getLog(SmsServiceImpl.class);
private static final Logger log = LoggerFactory.getLogger(SmsServiceImpl.class);
/**
* will expose user to call this method send sms message
* @param sendSmsRequest

View File

@ -26,8 +26,8 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aliyun.mns.client.CloudQueue;
import com.aliyun.mns.common.ClientException;
@ -39,7 +39,8 @@ import com.aliyun.mns.model.Message;
*/
public class DefaultAlicomMessagePuller {
private Log log = LogFactory.getLog(DefaultAlicomMessagePuller.class);
private static final Logger log = LoggerFactory
.getLogger(DefaultAlicomMessagePuller.class);
private String mnsAccountEndpoint = "https://1943695596114318.mns.cn-hangzhou.aliyuncs.com/";// 阿里通信消息的endpoint,固定
private String endpointNameForPop = "cn-hangzhou";

View File

@ -21,8 +21,8 @@ import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aliyun.mns.client.CloudAccount;
import com.aliyun.mns.client.CloudQueue;
@ -42,7 +42,7 @@ import com.aliyuncs.profile.IClientProfile;
*
*/
public class TokenGetterForAlicom {
private Log log = LogFactory.getLog(TokenGetterForAlicom.class);
private static final Logger log = LoggerFactory.getLogger(TokenGetterForAlicom.class);
private String accessKeyId;
private String accessKeySecret;
private String endpointNameForPop;