|
|
|
@@ -10,6 +10,7 @@ import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxMsgConfig; |
|
|
|
import com.iformall.domain.po.WxMsgModel; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.vo.GetMessageChannelVO; |
|
|
|
import com.iformall.enums.EnumMsgModelStatus; |
|
|
|
import com.iformall.enums.EnumVerifyCode; |
|
|
|
import com.iformall.exception.BizMessageException; |
|
|
|
@@ -17,6 +18,7 @@ import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.WxMsgConfigMapper; |
|
|
|
import com.iformall.mapper.WxMsgModelMapper; |
|
|
|
import com.iformall.service.WxMsgModelService; |
|
|
|
import com.iformall.sms.EnumSMSChannel; |
|
|
|
import com.iformall.sms.SMSFactory; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -144,5 +146,20 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { |
|
|
|
return new ResultData(list); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData getMessageChannel(TenantEntity tenantInfo) { |
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.updateTenantInfo(tenantInfo); |
|
|
|
List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); |
|
|
|
if (wxMsgConfigs.size() == 0) { |
|
|
|
return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND.getCode(), "您还未接入短信运营商,请联系平台管理员"); |
|
|
|
} |
|
|
|
wxMsgConfig = wxMsgConfigs.get(0); |
|
|
|
EnumSMSChannel channelEnum = EnumSMSChannel.getEnum(wxMsgConfig.getSmsChannel()); |
|
|
|
GetMessageChannelVO vo = new GetMessageChannelVO(); |
|
|
|
vo.setSmsChannel(wxMsgConfig.getSmsChannel()); |
|
|
|
vo.setSuffix(channelEnum != null ? channelEnum.getSuffix() : ""); |
|
|
|
vo.setMaxSize(channelEnum != null ? channelEnum.getPerSize() : 0); |
|
|
|
return new ResultData(vo); |
|
|
|
} |
|
|
|
} |