Jelajahi Sumber

Rename path

tsurumure 8 bulan lalu
induk
melakukan
bd0cdf6bcd

+ 2 - 2
src/main/java/com/backendsys/modules/tencent/entity/SmsCallbackStatis.java → src/main/java/com/backendsys/modules/sdk/tencent/sms/entity/TencentSmsCallbackStatis.java

@@ -1,9 +1,9 @@
-package com.backendsys.modules.tencent.entity;
+package com.backendsys.modules.sdk.tencent.sms.entity;
 
 import lombok.Data;
 
 @Data
-public class SmsCallbackStatis {
+public class TencentSmsCallbackStatis {
     private Long callback_count;
     private Long request_success_count;
     private Long callback_fail_count;

+ 2 - 2
src/main/java/com/backendsys/modules/tencent/entity/SmsStatis.java → src/main/java/com/backendsys/modules/sdk/tencent/sms/entity/TencentSmsStatis.java

@@ -1,9 +1,9 @@
-package com.backendsys.modules.tencent.entity;
+package com.backendsys.modules.sdk.tencent.sms.entity;
 
 import lombok.Data;
 
 @Data
-public class SmsStatis {
+public class TencentSmsStatis {
     private Long fee_count;
     private Long request_count;
     private Long request_success_count;

+ 5 - 7
src/main/java/com/backendsys/modules/tencent/service/TencentSmsService.java → src/main/java/com/backendsys/modules/sdk/tencent/sms/service/TencentSmsService.java

@@ -1,20 +1,18 @@
-package com.backendsys.modules.tencent.service;
+package com.backendsys.modules.sdk.tencent.sms.service;
 
-import com.backendsys.modules.tencent.entity.SmsCallbackStatis;
-import com.backendsys.modules.tencent.entity.SmsStatis;
+import com.backendsys.modules.sdk.tencent.sms.entity.TencentSmsCallbackStatis;
+import com.backendsys.modules.sdk.tencent.sms.entity.TencentSmsStatis;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
 
-import java.util.Map;
-
 public interface TencentSmsService {
 
     // [腾讯云] 发送短信 { 模板ID, 模板参数, 下发手机号码 }
     SendSmsResponse send(String template_id, String[] templateParamSet, String[] phoneNumberSet) throws TencentCloudSDKException;
 
     // [腾讯云] 获得统计短信发送数据
-    SmsStatis getSMSStatistics(String beginTime, String endTime) throws TencentCloudSDKException;
+    TencentSmsStatis getSMSStatistics(String beginTime, String endTime) throws TencentCloudSDKException;
 
     // [腾讯云] 获得回执数据统计
-    SmsCallbackStatis getSMSCallbackStatistics(String beginTime, String endTime) throws TencentCloudSDKException;
+    TencentSmsCallbackStatis getSMSCallbackStatistics(String beginTime, String endTime) throws TencentCloudSDKException;
 }

+ 22 - 32
src/main/java/com/backendsys/modules/tencent/service/impl/TencentSmsServiceImpl.java → src/main/java/com/backendsys/modules/sdk/tencent/sms/service/impl/TencentSmsServiceImpl.java

@@ -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;
     }
 
 

+ 1 - 1
src/main/java/com/backendsys/modules/sms/controller/SmsController.java

@@ -3,7 +3,7 @@ package com.backendsys.modules.sms.controller;
 import com.backendsys.modules.common.utils.Result;
 import com.backendsys.modules.sms.entity.Sms;
 import com.backendsys.modules.sms.service.SmsService;
-import com.backendsys.modules.tencent.service.TencentSmsService;
+import com.backendsys.modules.sdk.tencent.sms.service.TencentSmsService;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;

+ 2 - 3
src/main/java/com/backendsys/modules/sms/service/impl/SmsServiceImpl.java

@@ -5,10 +5,9 @@ import cn.hutool.json.JSONUtil;
 import com.backendsys.exception.CustException;
 import com.backendsys.modules.common.config.redis.utils.RedisUtil;
 import com.backendsys.modules.common.config.security.utils.HttpRequestUtil;
+import com.backendsys.modules.sdk.tencent.sms.service.TencentSmsService;
 import com.backendsys.modules.sms.dao.SmsDao;
 import com.backendsys.modules.sms.entity.Sms;
-import com.backendsys.modules.sms.service.SmsService;
-import com.backendsys.modules.tencent.service.TencentSmsService;
 import com.backendsys.utils.response.ResultEnum;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
@@ -23,7 +22,7 @@ import java.util.concurrent.TimeUnit;
 
 @Slf4j
 @Service
-public class SmsServiceImpl implements SmsService {
+public class SmsServiceImpl implements com.backendsys.modules.sms.service.SmsService {
 
     @Autowired
     private RedisUtil redisUtil;