Authored by caoyan

cps四期

@@ -5,13 +5,11 @@ package com.yoho.unions.common.service; @@ -5,13 +5,11 @@ package com.yoho.unions.common.service;
5 5
6 import java.util.List; 6 import java.util.List;
7 7
8 -import com.yoho.service.model.sms.response.CommonRspBO;  
9 -  
10 /** 8 /**
11 * @author caoyan 9 * @author caoyan
12 */ 10 */
13 public interface ISendSmsService { 11 public interface ISendSmsService {
14 12
15 - CommonRspBO smsSendByMobile(String content, List<String> mobileList); 13 + void smsSendByMobile(String content, List<String> mobileList);
16 14
17 } 15 }
@@ -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 }