|
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils; |
|
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils; |
10
|
import org.slf4j.Logger;
|
10
|
import org.slf4j.Logger;
|
11
|
import org.slf4j.LoggerFactory;
|
11
|
import org.slf4j.LoggerFactory;
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
13
|
+import org.springframework.beans.factory.annotation.Value;
|
13
|
import org.springframework.stereotype.Service;
|
14
|
import org.springframework.stereotype.Service;
|
14
|
|
15
|
|
15
|
import com.yoho.core.rest.client.ServiceCaller;
|
16
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
@@ -28,12 +29,15 @@ public class SendSmsServiceImpl implements ISendSmsService { |
|
@@ -28,12 +29,15 @@ public class SendSmsServiceImpl implements ISendSmsService { |
28
|
@Autowired
|
29
|
@Autowired
|
29
|
private ServiceCaller serviceCaller;
|
30
|
private ServiceCaller serviceCaller;
|
30
|
|
31
|
|
|
|
32
|
+ @Value("${yoho.message.controller.url}")
|
|
|
33
|
+ private String messageUrl;
|
|
|
34
|
+
|
31
|
@Override
|
35
|
@Override
|
32
|
- public CommonRspBO smsSendByMobile(String content, List<String> mobileList) {
|
36
|
+ public void smsSendByMobile(String content, List<String> mobileList) {
|
33
|
log.info("smsSendByMobile start.");
|
37
|
log.info("smsSendByMobile start.");
|
34
|
if(StringUtils.isEmpty(content) || CollectionUtils.isEmpty(mobileList)) {
|
38
|
if(StringUtils.isEmpty(content) || CollectionUtils.isEmpty(mobileList)) {
|
35
|
log.warn("smsSendByMobile fail! content is null or mobileList is empty");
|
39
|
log.warn("smsSendByMobile fail! content is null or mobileList is empty");
|
36
|
- return null;
|
40
|
+ return;
|
37
|
}
|
41
|
}
|
38
|
McSmsByMobileBO[] boArray = new McSmsByMobileBO[mobileList.size()];
|
42
|
McSmsByMobileBO[] boArray = new McSmsByMobileBO[mobileList.size()];
|
39
|
for(int i=0; i<mobileList.size(); i++) {
|
43
|
for(int i=0; i<mobileList.size(); i++) {
|
|
@@ -44,7 +48,8 @@ public class SendSmsServiceImpl implements ISendSmsService { |
|
@@ -44,7 +48,8 @@ public class SendSmsServiceImpl implements ISendSmsService { |
44
|
boArray[i] = smsBo;
|
48
|
boArray[i] = smsBo;
|
45
|
}
|
49
|
}
|
46
|
|
50
|
|
47
|
- return serviceCaller.call("message.smsSendByMobile", boArray, CommonRspBO.class);
|
51
|
+ serviceCaller.post("message.sendMessage", messageUrl + "/mcSMS/smsSendByMobile", boArray, CommonRspBO.class, null);
|
|
|
52
|
+
|
48
|
}
|
53
|
}
|
49
|
|
54
|
|
50
|
} |
55
|
} |