//package cn.com.poc.support.sms.channel.bl;
//
//
//
//import cn.com.poc.support.sms.constant.SmsConstant;
//import cn.com.poc.common.dto.SmsDto;
//import cn.com.poc.support.sms.ThirdPlatformSmsService;
//import cn.com.yict.framemax.core.i18n.I18nMessageException;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//
///**
// * @author Focan.Zhong
// */
//@Service
//public class BlSmsService implements ThirdPlatformSmsService {
//
//    private Logger logger = LoggerFactory.getLogger(this.getClass());
//
//    @Resource
//    private CommonParamConfigService commonParamConfigService;
//
//    @Resource
//    private BlAbstractHttpClient blAbstractHttpClient;
//
//    /**
//     * 第三方平台验证码
//     *
//     * @param smsDto
//     * @return
//     */
//    @Override
//    public void doSend(SmsDto smsDto) throws Exception {
//
//        //查询配置
//        BlConfigEntity blThirdPartyConfig = commonParamConfigService.getBlThirdPartyConfig();
//        if (blThirdPartyConfig == null
//                || StringUtils.isBlank(blThirdPartyConfig.getAppKey())
//                || StringUtils.isBlank(blThirdPartyConfig.getAppSecret())
//                || StringUtils.isBlank(blThirdPartyConfig.getSysId())) {
//            throw new I18nMessageException("百联通开放平台配置异常！");
//        }
//
//        //调百联通手机号注册接口
//        BlMemberRequest request = new BlMemberRequest();
//        request.setVerifyCodeType(smsDto.getVerifyCodeType());
//        //滑块验证类型（必传） 2.图形验证码，3.滑块验证
//        request.setVerifyImgType(smsDto.getVerifyImgType());
//        // VerifyImgType = 2
//        request.setVerifyImgCode(smsDto.getVerifyImgCode());
//        // VerifyImgType = 3
//        request.setTimestamp(System.currentTimeMillis() + "");
//        request.setUniqueFlag(smsDto.getUniqueFlag());
//        request.setxPercent(smsDto.getxPercent());
//
//        request.setMobile(smsDto.getMobilePhone());
//        request.setSysid(blThirdPartyConfig.getSysId());
//
//        BlMemberAuthResult blMemberAuthResult = blAbstractHttpClient.doRequest(
//                blThirdPartyConfig.getAppKey(),
//                blThirdPartyConfig.getAppSecret(),
//                BlMemberApi.CHECK_AND_SEND_SMS,
//                request);
//
//        // FAIL("0","滑块校验失败") INVALID("2","无效已过期的滑块验证码"),
//        // SEND_CODE_SUCCESS("3","发送短信验证码成功"),
//        // SEND_CODE_FAIL("4","发送短信验证码失败"),
//        // OPERATING_FREQUENCY("5","操作过于频繁，请稍后再试！"),
//        // VERIFY_CODE_FAIL("6","验证码错误")
//        if (!SmsConstant.Status.BL.SEND_CODE_SUCCESS.getCode().equals(blMemberAuthResult.getStatus())) {
//            throw new I18nMessageException(SmsConstant.Status.BL.getByStatus(blMemberAuthResult.getStatus()), blMemberAuthResult.getMsg());
//        }
//
//    }
//}
//
//
//
