Authored by caoyan

cps四期

... ... @@ -5,13 +5,11 @@ package com.yoho.unions.common.service;
import java.util.List;
import com.yoho.service.model.sms.response.CommonRspBO;
/**
* @author caoyan
*/
public interface ISendSmsService {
CommonRspBO smsSendByMobile(String content, List<String> mobileList);
void smsSendByMobile(String content, List<String> mobileList);
}
... ...
... ... @@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.yoho.core.rest.client.ServiceCaller;
... ... @@ -28,12 +29,15 @@ public class SendSmsServiceImpl implements ISendSmsService {
@Autowired
private ServiceCaller serviceCaller;
@Value("${yoho.message.controller.url}")
private String messageUrl;
@Override
public CommonRspBO smsSendByMobile(String content, List<String> mobileList) {
public void smsSendByMobile(String content, List<String> mobileList) {
log.info("smsSendByMobile start.");
if(StringUtils.isEmpty(content) || CollectionUtils.isEmpty(mobileList)) {
log.warn("smsSendByMobile fail! content is null or mobileList is empty");
return null;
return;
}
McSmsByMobileBO[] boArray = new McSmsByMobileBO[mobileList.size()];
for(int i=0; i<mobileList.size(); i++) {
... ... @@ -44,7 +48,8 @@ public class SendSmsServiceImpl implements ISendSmsService {
boArray[i] = smsBo;
}
return serviceCaller.call("message.smsSendByMobile", boArray, CommonRspBO.class);
serviceCaller.post("message.sendMessage", messageUrl + "/mcSMS/smsSendByMobile", boArray, CommonRspBO.class, null);
}
}
... ...