|
@@ -1,28 +1,18 @@
|
|
|
-package com.backendsys.modules.tencent.service.impl;
|
|
|
+package com.backendsys.modules.sdk.tencent.sms.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import cn.hutool.json.JSONArray;
|
|
|
-import cn.hutool.json.JSONObject;
|
|
|
-import cn.hutool.json.JSONUtil;
|
|
|
import com.backendsys.exception.CustException;
|
|
|
-import com.backendsys.modules.common.config.redis.utils.RedisUtil;
|
|
|
-import com.backendsys.modules.tencent.entity.SmsCallbackStatis;
|
|
|
-import com.backendsys.modules.tencent.entity.SmsStatis;
|
|
|
-import com.backendsys.modules.tencent.service.TencentSmsService;
|
|
|
-import com.backendsys.utils.MapUtil;
|
|
|
+import com.backendsys.modules.sdk.tencent.sms.entity.TencentSmsCallbackStatis;
|
|
|
+import com.backendsys.modules.sdk.tencent.sms.entity.TencentSmsStatis;
|
|
|
+import com.backendsys.modules.sdk.tencent.sms.service.TencentSmsService;
|
|
|
import com.tencentcloudapi.common.Credential;
|
|
|
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
|
|
import com.tencentcloudapi.common.profile.ClientProfile;
|
|
|
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
|
|
import com.tencentcloudapi.sms.v20210111.models.*;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
-
|
|
|
@Service
|
|
|
public class TencentSmsServiceImpl implements TencentSmsService {
|
|
|
|
|
@@ -70,7 +60,7 @@ public class TencentSmsServiceImpl implements TencentSmsService {
|
|
|
* https://cloud.tencent.com/document/product/382/55965
|
|
|
*/
|
|
|
@Override
|
|
|
- public SmsStatis getSMSStatistics(String beginTime, String endTime) throws TencentCloudSDKException {
|
|
|
+ public TencentSmsStatis getSMSStatistics(String beginTime, String endTime) throws TencentCloudSDKException {
|
|
|
|
|
|
if (StrUtil.isEmpty(beginTime)) throw new CustException("beginTime 不能为空");
|
|
|
if (StrUtil.isEmpty(endTime)) throw new CustException("endTime 不能为空");
|
|
@@ -91,11 +81,11 @@ public class TencentSmsServiceImpl implements TencentSmsService {
|
|
|
|
|
|
// String resStr = SendStatusStatisticsResponse.toJsonString(response);
|
|
|
|
|
|
- SmsStatis smsStatis = new SmsStatis();
|
|
|
- smsStatis.setFee_count(statis.getFeeCount());
|
|
|
- smsStatis.setRequest_count(statis.getRequestCount());
|
|
|
- smsStatis.setRequest_success_count(statis.getRequestSuccessCount());
|
|
|
- return smsStatis;
|
|
|
+ TencentSmsStatis tencentSmsStatis = new TencentSmsStatis();
|
|
|
+ tencentSmsStatis.setFee_count(statis.getFeeCount());
|
|
|
+ tencentSmsStatis.setRequest_count(statis.getRequestCount());
|
|
|
+ tencentSmsStatis.setRequest_success_count(statis.getRequestSuccessCount());
|
|
|
+ return tencentSmsStatis;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -103,7 +93,7 @@ public class TencentSmsServiceImpl implements TencentSmsService {
|
|
|
* https://cloud.tencent.com/document/product/382/55966
|
|
|
*/
|
|
|
@Override
|
|
|
- public SmsCallbackStatis getSMSCallbackStatistics(String beginTime, String endTime) throws TencentCloudSDKException {
|
|
|
+ public TencentSmsCallbackStatis getSMSCallbackStatistics(String beginTime, String endTime) throws TencentCloudSDKException {
|
|
|
|
|
|
if (StrUtil.isEmpty(beginTime)) throw new CustException("beginTime 不能为空");
|
|
|
if (StrUtil.isEmpty(endTime)) throw new CustException("endTime 不能为空");
|
|
@@ -121,17 +111,17 @@ public class TencentSmsServiceImpl implements TencentSmsService {
|
|
|
|
|
|
// String resStr = SendStatusStatisticsResponse.toJsonString(response);
|
|
|
|
|
|
- SmsCallbackStatis smsCallbackStatis = new SmsCallbackStatis();
|
|
|
- smsCallbackStatis.setCallback_count(statis.getCallbackCount());
|
|
|
- smsCallbackStatis.setRequest_success_count(statis.getRequestSuccessCount());
|
|
|
- smsCallbackStatis.setCallback_fail_count(statis.getCallbackFailCount());
|
|
|
- smsCallbackStatis.setCallback_success_count(statis.getCallbackSuccessCount());
|
|
|
- smsCallbackStatis.setInternal_error_count(statis.getInternalErrorCount());
|
|
|
- smsCallbackStatis.setInvalid_number_count(statis.getInvalidNumberCount());
|
|
|
- smsCallbackStatis.setShutdown_error_count(statis.getShutdownErrorCount());
|
|
|
- smsCallbackStatis.setBlack_list_count(statis.getBlackListCount());
|
|
|
- smsCallbackStatis.setFrequency_limit_count(statis.getFrequencyLimitCount());
|
|
|
- return smsCallbackStatis;
|
|
|
+ TencentSmsCallbackStatis tencentSmsCallbackStatis = new TencentSmsCallbackStatis();
|
|
|
+ tencentSmsCallbackStatis.setCallback_count(statis.getCallbackCount());
|
|
|
+ tencentSmsCallbackStatis.setRequest_success_count(statis.getRequestSuccessCount());
|
|
|
+ tencentSmsCallbackStatis.setCallback_fail_count(statis.getCallbackFailCount());
|
|
|
+ tencentSmsCallbackStatis.setCallback_success_count(statis.getCallbackSuccessCount());
|
|
|
+ tencentSmsCallbackStatis.setInternal_error_count(statis.getInternalErrorCount());
|
|
|
+ tencentSmsCallbackStatis.setInvalid_number_count(statis.getInvalidNumberCount());
|
|
|
+ tencentSmsCallbackStatis.setShutdown_error_count(statis.getShutdownErrorCount());
|
|
|
+ tencentSmsCallbackStatis.setBlack_list_count(statis.getBlackListCount());
|
|
|
+ tencentSmsCallbackStatis.setFrequency_limit_count(statis.getFrequencyLimitCount());
|
|
|
+ return tencentSmsCallbackStatis;
|
|
|
}
|
|
|
|
|
|
|